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

Connecting to opendistro from Apache Superset throws SQL parse exception #5

Closed
syamat opened this issue Dec 16, 2019 · 7 comments
Closed
Labels
bug Something isn't working opendistro

Comments

@syamat
Copy link

syamat commented Dec 16, 2019

The following error is thrown while creating a new Database connection on Open Distro 1.2.0 after installing opendistro plugin using "pip install elasticsearch-dbapi[aws]".
The connection string I gave is "odelasticsearch+http://localhost:9200/"
Incoming request /_opendistro/_sql/?format=csv: SELECT 1
[2019-12-16T09:30:14,137][ERROR][c.a.o.s.p.RestSqlAction ] [ATVDI] 77d855ee-1f9e-411c-a79f-464860adcba7 Client side error during query execution
java.lang.NullPointerException: null
at com.amazon.opendistroforelasticsearch.sql.parser.SqlParser.parseSelect(SqlParser.java:71) ~[opendistro_sql-1.2.0.0.jar:1.2.0.0]
at com.amazon.opendistroforelasticsearch.sql.parser.SqlParser.parseSelect(SqlParser.java:60) ~[opendistro_sql-1.2.0.0.jar:1.2.0.0]
at com.amazon.opendistroforelasticsearch.sql.query.ESActionFactory.create(ESActionFactory.java:87) ~[opendistro_sql-1.2.0.0.jar:1.2.0.0]
at com.amazon.opendistroforelasticsearch.sql.plugin.SearchDao.explain(SearchDao.java:59) ~[opendistro_sql-1.2.0.0.jar:1.2.0.0]
at com.amazon.opendistroforelasticsearch.sql.plugin.RestSqlAction.explainRequest(RestSqlAction.java:156) [opendistro_sql-1.2.0.0.jar:1.2.0.0]
at com.amazon.opendistroforelasticsearch.sql.plugin.RestSqlAction.prepareRequest(RestSqlAction.java:127) [opendistro_sql-1.2.0.0.jar:1.2.0.0]
at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:92) [elasticsearch-7.2.0.jar:7.2.0]
at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:240) [elasticsearch-7.2.0.jar:7.2.0]

@dpgaspar
Copy link
Member

dpgaspar commented Dec 18, 2019

Hi @syamat,

First, opendistro is still not fully supported (yet).

opendistro does not implement SELECT 1 this happens on superset when you test the database connection. I remember that you could create the connection anyway. Note that opendistro is not well supported and you will not be able to create most charts on superset with it (only sqllab)

@syamat
Copy link
Author

syamat commented Dec 19, 2019

No, I just clicked the "Test Connection" button while creating a "Database"in Superset that connects to a OD instance. Screenshot is attached.
Screenshot at 2019-12-19 12-46-50

@syamat
Copy link
Author

syamat commented Dec 19, 2019

It seems the issue is only which clicking the Test Connection, the connection works in SQL Lab when query.

@dpgaspar
Copy link
Member

Yes exactly. Yet, I'll implement a select 1 proxy for it

@dpgaspar dpgaspar added opendistro bug Something isn't working labels Dec 19, 2019
@markharding
Copy link

@dpgaspar is there a work around for this?
I am currently still getting (open distro AWS 7.4)

{
  "error": {
    "reason": "Invalid SQL query",
    "details": "Failed to parse query due to offending symbol [<EOF>] at: 'SELECT 1' <--- HERE... More details: Expecting tokens in {'SELECT', '('}",
    "type": "SyntaxAnalysisException"
  },
  "status": 400
}

@syamat syamat mentioned this issue Jan 7, 2021
@dai-chen
Copy link

@dpgaspar FYI, We've been currently working on a new query engine for ODFE SQL plugin with many improvements. This issue is already fixed in PR: opendistro-for-elasticsearch/sql#542. The new engine is experimental and disabled by default. You can follow the instruction here to preview: https://github.com/opendistro-for-elasticsearch/sql#experimental

@dpgaspar
Copy link
Member

dpgaspar commented Feb 8, 2021

This is supported on 0.2.0 released today

@dpgaspar dpgaspar closed this as completed Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working opendistro
Projects
None yet
Development

No branches or pull requests

4 participants