sql
sql copied to clipboard
[FEATURE] [IMPROVEMENT] PPL Error needs improvement
Is your feature request related to a problem?
I am writing PPL to query an index and just display some fields. If I run
source=moviegeek-logs-*
I see fields like trace_id, method, span_id, index
I can run source=moviegeek-logs-* | fields trace_id, span_id, method
and get the expected table.
If I add index
: source=moviegeek-logs-* | fields trace_id, span_id, method, index
I get the following error in the output panel:
Events: Bad Request, this query is not runnable.
- Is there something special about the "index" field?
- A better error message here would be invaluable.
What solution would you like?
Better error messaging around syntax and other problems
What alternatives have you considered?
None
Do you have any additional context?
None
Every time I need to understand why it's failing, I need to do it directly via API. This makes it cumbersome to use the Workbench.
Example:
POST /_opendistro/_ppl { "query": """ source=opensearch_dashboards_sample_data_logs | fields host, clientip, response, bytes | where response='503' or response='404' """ }
Meta fields are not available for querying at the moment. I think your issue is very similar to #639, #432 and #339.
There was issue and PR for the second question regarding error message: https://github.com/opendistro-for-elasticsearch/sql/pull/872
But later the changes were reverted for some reason: https://github.com/opensearch-project/sql/commit/5cea8b4e3dcac16eb2efa07a18712322eab490e3
@Yury-Fridlyand "index" in this case was a field on the document, not the meta field.