Naarcha-AWS c69f860bfe
Add PPL and SQL section (#1111)
* Merge pull request #1 from Yury-Fridlyand/dev-update-sql-relevance-docs

Update SQL plugin relevance functions documentation.

Co-authored-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>

* Address PR feedback.

Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>

* Address PR feedback by @joshuali925.

Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>

* Remove PPL page from Observability Plugin. Add link to Observability page. Make some simple formatting changes

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>

* Reword paragraph

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>

* Adds SQL and PPL API and other SQL plugin changes

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Formatting changes

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Incorporates editorial comments

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>
Signed-off-by: Naarcha-AWS <naarcha@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Co-authored-by: Yury Fridlyand <yuryf@bitquilltech.com>
Co-authored-by: MaxKsyunz <maxk@bitquilltech.com>
Co-authored-by: Fanit Kolchina <kolchfa@amazon.com>
2022-09-26 12:28:00 -04:00

1.5 KiB

layout title parent nav_order
default Troubleshooting SQL and PPL 88

Troubleshooting

The SQL plugin is stateless, so troubleshooting is mostly focused on why a particular query fails.

The most common error is the dreaded null pointer exception, which can occur during parsing errors or when using the wrong HTTP method (POST vs. GET and vice versa). The POST method and HTTP request body offer the most consistent results:

POST _plugins/_sql
{
  "query": "SELECT * FROM my-index WHERE ['name.firstname']='saanvi' LIMIT 5"
}

If a query isn't behaving the way you expect, use the _explain API to see the translated query, which you can then troubleshoot. For most operations, _explain returns OpenSearch query DSL. For UNION, MINUS, and JOIN, it returns something more akin to a SQL execution plan.

Sample request

POST _plugins/_sql/_explain
{
  "query": "SELECT * FROM my-index LIMIT  50"
}

Sample response

{
  "from": 0,
  "size": 50
}

Index mapping verification exception

If you see the following verification exception:

{
  "error": {
    "reason": "There was internal problem at backend",
    "details": "When using multiple indices, the mappings must be identical.",
    "type": "VerificationException"
  },
  "status": 503
}

Make sure the index in your query is not an index pattern and is not an index pattern and doesn't have multiple types.

If these steps don't work, submit a Github issue here.