amazon-archives / sql-jdbc

🔍 Open Distro for Elasticsearch JDBC Driver
Apache License 2.0
111 stars 49 forks source link

Failed to read index from Dbeaver #57

Closed sandeep-veerlapati closed 4 years ago

sandeep-veerlapati commented 4 years ago

I am using a Dbeaver to access Elasticsearch service on AWS. I am facing an error while trying to access an index having around 100 fields. Though I am able to query the index from the editor, I can't see the schema in the data explorer. Please find below image for more details about the error. image

penghuo commented 4 years ago

Thanks for reporting the issue. Is it possible to share the index mapping to help debug the issue. My current guess is the type is missing from the ElasticsearchType.

Jayu8 commented 4 years ago

Attached the index mapping

penghuo commented 4 years ago

The issues in because the SQL plugin return the field without type info when the field in Elasticsearch mapping is object type. User are not required to set the field type to object explicitly, as this is the default value.

Result of query DESCRIBE TABLES LIKE kbs-datalake COLUMNS LIKE %

    [
      "elasticsearch",
      null,
      "kbs-datalake",
      "stats",
      null,
      null,
      null,
      null,
      null,
      10,
      2,
      null,
      null,
      null,
      null,
      null,
      10,
      "",
      null,
      null,
      null,
      null,
      "NO",
      ""
    ],
penghuo commented 4 years ago

One workaround is add the "type":"object" for the field explicitly