According to the official doc of elasticsearch/opendistro, the SQL translate API could translate SQL query into elasticsearch DSL. However, it only returns columns, filters, size and sorting operators without any index/table name.
E.g., given sql query SELECT * FROM library LIMIT 2
, the SQL translate API will respond:
{
"size": 2,
"_source": false,
"fields": [
{
"field": "author"
},
{
"field": "name"
},
{
"field": "page_count"
},
{
"field": "release_date",
"format": "strict_date_optional_time_nanos"
}
]
}
And the index name (library
) is missing. I tried opendistro and it is the same.
Notice that for aggregated query across two table/index, it will return Physical Plan
and Logical Plan
that contains TableScan
attributes.