Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

SHOW/DESCRIBE explain throws exception #404

Closed
dai-chen opened this issue Mar 31, 2020 · 1 comment
Closed

SHOW/DESCRIBE explain throws exception #404

dai-chen opened this issue Mar 31, 2020 · 1 comment
Labels
bug Something isn't working JDBC/ODBC formatting This issue is related to JDBC or ODBC driver client SQL

Comments

@dai-chen
Copy link
Member

Explain SHOW/DESCRIBE throws exception. It is supposed to either disable explain for SHOW/DESCRIBE or return friendly message to user.

POST _opendistro/_sql/_explain
{  
  "query": "SHOW TABLES LIKE %"
}

{
  "error" : {
    "root_cause" : [
      {
        "type" : "json_parse_exception",
        "reason" : "Unrecognized token 'org': was expecting ('true', 'false' or 'null')\n at [Source: java.io.StringReader@358b216d; line: 1, column: 4]"
      }
    ],
    "type" : "json_parse_exception",
    "reason" : "Unrecognized token 'org': was expecting ('true', 'false' or 'null')\n at [Source: java.io.StringReader@358b216d; line: 1, column: 4]"
  },
  "status" : 400
}
@dai-chen dai-chen added the bug Something isn't working label Mar 31, 2020
@penghuo penghuo added the JDBC/ODBC formatting This issue is related to JDBC or ODBC driver client label Apr 15, 2020
@dai-chen dai-chen added the SQL label Sep 11, 2020
@penghuo
Copy link
Contributor

penghuo commented Dec 11, 2020

POST _opendistro/_sql/_explain
{  
  "query": """
    SHOW TABLES LIKE %
  """
}

{
  "root": {
    "name": "ProjectOperator",
    "description": {
      "fields": "[TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS, TYPE_CAT, TYPE_SCHEM, TYPE_NAME, SELF_REFERENCING_COL_NAME, REF_GENERATION]"
    },
    "children": [
      {
        "name": "FilterOperator",
        "description": {
          "conditions": """like(TABLE_NAME, "%")"""
        },
        "children": [
          {
            "name": "ElasticsearchSystemIndexScan",
            "description": {
              "request": "ElasticsearchCatIndicesRequest{}"
            },
            "children": []
          }
        ]
      }
    ]
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working JDBC/ODBC formatting This issue is related to JDBC or ODBC driver client SQL
Projects
None yet
Development

No branches or pull requests

2 participants