Skip to content

[Bug] DOE query error when index mapping has dynamic_template #14761

@qidaye

Description

@qidaye

Search before asking

  • I had searched in the issues and found no similar issues.

Version

12791f1

What's Wrong?

ES external table dose not query normally.

What You Expected?

Query normally.

How to Reproduce?

  1. create ES index
curl -X PUT "localhost:9201/test?pretty" -H 'Content-Type: application/json' -d'
{
  "mappings": {
      "dynamic_templates" : [
        {
          "message_full" : {
            "match" : "message_full",
            "mapping" : {
              "fields" : {
                "keyword" : {
                  "ignore_above" : 2048,
                  "type" : "keyword"
                }
              },
              "type" : "text"
            }
          }
        },
        {
          "message" : {
            "match" : "message",
            "mapping" : {
              "type" : "text"
            }
          }
        },
        {
          "strings" : {
            "match_mapping_type" : "string",
            "mapping" : {
              "type" : "keyword"
            }
          }
        }
      ], 
      "properties": { 
        "title":    { "type": "text" ,"fields": {
          "keyword": {
          "ignore_above": 256,
          "type": "keyword"
          }
          } }, 
        "name":     { "type": "text"  }, 
        "age":      { "type": "integer" }
      }
    
  }
}
'
  1. create Doris ES external table
CREATE EXTERNAL TABLE `es` (
`name` varchar(20) COMMENT "",
`age` varchar(20) COMMENT ""
) ENGINE=ELASTICSEARCH
PROPERTIES (
"hosts" = "http://localhost:9201",
"index" = "test"
);
  1. query es table
  2. get error
ERROR 1105 (HY000): errCode = 2, detailMessage = fetch es table [es] metadata failure: org.json.simple.JSONArray cannot be cast to org.json.simple.JSONObject

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions