Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated SQL is incorrect if the index name contains special characters #3

Open
haoliangyu opened this issue Mar 1, 2024 · 1 comment

Comments

@haoliangyu
Copy link
Member

haoliangyu commented Mar 1, 2024

While ElasticSearch allows . (or other special characters) in the index name, the SQL generated from this provider will fail with a parsing error. Double-quoting the index name will fix the issue.

This does not work

SELECT * FROM index.name

This works

SELECT * FROM "index.name"

It is mentioned at the ElasticSearch SQL documentation:

If the table name contains special SQL characters (such as .,-,*,etc…​) use double quotes to escape them

This bug can be fixed at https://github.com/koopjs/koop-provider-elastic-sql/blob/main/src/model.js#L130.

@haoliangyu haoliangyu changed the title Generated SQL is incorrect if the index name contains a dot or other special characters Generated SQL is incorrect if the index name contains special characters Mar 1, 2024
@rgwozdz
Copy link
Member

rgwozdz commented Mar 1, 2024

Thanks @haoliangyu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants