Special alias name cannot pass the old Druid and new ANTLR parser #209
Comments
I get a similar error when an index name contains a dot midstream.
It complains about the first dot. If I surround the index name with backticks I get:
Interestingly, it works on indexes with a dot as the first char.
|
Thanks @tjbaker , we will take a look into the discrepancy. What version of plugin are you using? |
aws elasticsearch R20190927-P3 GET /_cat/plugins |
Can you also provide the Elasticsearch version, that will help us to map correct opendistro SQL plugin version. |
|
Hi @Jianfei-Li, I found out that the fix for #212 could be a workaround for this issue. Basically we added support for quoted table or field name with special character by backticks. And this seem work well for alias too. The following queries worked for me. Please try it out from your side too:
|
Hi @tjbaker, I tested and the backticks didn't work for your case. Because of dot in index name and our support for PartiQL syntax, we need to figure out better way to differentiate regular index and nested field in regular index, ex. |
Fixed this in new query engine in the same way. Backticks or double quotes are required due to alias name starting with number. Please see more details: https://github.com/opendistro-for-elasticsearch/sql/blob/master/docs/user/general/identifiers.rst. |
The following query with field alias
843d-8ab6f-ad74ed5-a47673781bb959ae
will fail the old Druid parser.But replacing string between dash with single letter can pass the old Druid parser.
The alias above can pass our new ANTLR parser. However, new parser seems not allow dot in alias name. For example:
The text was updated successfully, but these errors were encountered: