You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
curl -X POST "localhost:9200/_plugins/_sql?format=json&pretty=true" -H "Content-Type: application/json" -d'
{
"query": "select 1"
}'
{
"error": {
"reason": "Invalid SQL query",
"details": "Cannot invoke \"com.alibaba.druid.sql.ast.statement.SQLTableSource.getAlias()\" because the return value of \"com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock.getFrom()\" is null",
"type": "NullPointerException"
},
"status": 400
}
What is the expected behavior?
Return valid json response
Additional info
Stacktrace
java.lang.NullPointerException: Cannot invoke "com.alibaba.druid.sql.ast.statement.SQLTableSource.getAlias()" because the return value of "com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock.getFrom()" is null
at org.opensearch.sql.legacy.parser.SqlParser.parseSelect(SqlParser.java:81) ~[legacy-3.0.0.0-SNAPSHOT.jar:?]
at org.opensearch.sql.legacy.parser.SqlParser.parseSelect(SqlParser.java:68) ~[legacy-3.0.0.0-SNAPSHOT.jar:?]
at org.opensearch.sql.legacy.query.OpenSearchActionFactory.create(OpenSearchActionFactory.java:120) ~[legacy-3.0.0.0-SNAPSHOT.jar:?]
at org.opensearch.sql.legacy.plugin.SearchDao.explain(SearchDao.java:48) ~[legacy-3.0.0.0-SNAPSHOT.jar:?]
at org.opensearch.sql.legacy.plugin.RestSqlAction.explainRequest(RestSqlAction.java:243) [legacy-3.0.0.0-SNAPSHOT.jar:?]
at org.opensearch.sql.legacy.plugin.RestSqlAction.lambda$prepareRequest$1(RestSqlAction.java:172) [legacy-3.0.0.0-SNAPSHOT.jar:?]
at org.opensearch.sql.legacy.plugin.RestSQLQueryAction.lambda$prepareRequest$0(RestSQLQueryAction.java:92) [legacy-3.0.0.0-SNAPSHOT.jar:?]
The text was updated successfully, but these errors were encountered:
What is the bug?
NPE with json respone formatter on "SELECT 1"
It works fine with default format
How can one reproduce the bug?
What is the expected behavior?
Return valid json response
Additional info
Stacktrace
The text was updated successfully, but these errors were encountered: