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

Error in FilterBox SQL Query using elasticsearch-dbapi 0.1.2/0.2.0 on Elasticsearch 7.x.x #13321

Open
Polignao opened this issue Feb 24, 2021 · 0 comments

Comments

@Polignao
Copy link

@Polignao Polignao commented Feb 24, 2021

As the self explanatory title says, I'm getting this error when trying to use elasticsearch as database for a filterbox.

Superset versions I tested this on: 0.990-dev, 1.0.1

Superset is installed using Docker Desktop on Windows 10 19042.804
https://hub.docker.com/r/amancevice/superset/ for 1.0.1
https://hub.docker.com/r/apache/incubator-superset for 0.990-dev

Elasticsearch is in Docker too, following guide here:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html

WARNING:elasticsearch:POST http://host.docker.internal:9200/_sql/ [status:400 request:0.015s]
DEBUG:elasticsearch:> {"query":"SELECT "street.keyword" AS "street.keyword"\nFROM "italy-addresses"\nWHERE ((lower(city.keyword) like '%roma%'))\nGROUP BY "street.keyword"\nLIMIT 1000"}
DEBUG:elasticsearch:< {"error":{"root_cause":[{"type":"verification_exception","reason":"Found 1 problem\nline 3:9: Unknown function [lower], did you mean [POWER]?"}],"type":"verification_exception","reason":"Found 1 problem\nline 3:9: Unknown function [lower], did you mean [POWER]?"},"status":400}

I don't know if it's only me getting this or if I'm just missing something.

In the Elasticsearch's official documentation it is possible to find the equivalent for the function lower() as LCASE:
https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-functions-string.html#sql-functions-string-lcase

Steps to reproduce:

  • Create a filterbox from an elasticsearch dataset
  • Create a dashboard with the filterbox in it
  • Type something in the filterbox and wait for error to occur

It seems noone is getting this error so I think I might be doing something wrong.
Since I don't know who generates the query with the lower() function I explored the code that manipulates SQL in Superset, Elasticsearch db engine and elasticsearch-dbapi, but had no luck.

Any advice is welcome!

Thanks!

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

Successfully merging a pull request may close this issue.

None yet
2 participants