Does DBeaver client translate SQL queries to API calls?

Following this document we have created a DBeaver connection to a testing Elasticsearch instance running the 30-day trial license.

We tried SQL queries like select * from "my-index-000001" limit 10; and the DBeaver client got results like a relational database, although we know Elasticsearch is not relational.

For example, if the overall _mapping schema of the index contains an attribute like eav_waiver but the current document does not contain the attribute. Then DBeaver's behavior is to let the row display a default NULL on the corresponding column. Please let me know if I misunderstood something here.

Our Question:

Elasticsearch works with API calls by default, so we believe there must be a translation from SQL to API call in the DBeaver JDBC connection, right?

If yes, when running a SQL query, how can we check the translated API call?

We are new to Elasticsearch, so we highly appreciate any hints and suggestions.

Nope the translate happens on the elasticsearch side.

You can even see what it translates to

1 Like

Thank you, @stephenb.

Following your link, I got the below sample command:

# select * from "my-index-000001" limit 10;
POST /_sql/translate
{
  "query": "select * from \"my-index-000001\" limit 10"
}

# Result:
# {
#   "size": 10,
#   "_source": false,
#   "fields": [
#     {
#       "field": "@timestamp",
#       "format": "strict_date_optional_time_nanos"
#     },
#     {
#       "field": "create_ts",
#       "format": "strict_date_optional_time_nanos"
#     },
#     
#     ...
#   ],
#   "sort": [
#     {
#       "_doc": {
#         "order": "asc"
#       }
#     }
#   ],
#   "track_total_hits": -1
# }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.