Skip to content

[Bug] ES Catalog Query Error #40406

@sunny19930321

Description

@sunny19930321

Search before asking

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

Version

2.1.6

What's Wrong?

ERROR 1105 (HY000): errCode = 2, detailMessage = (9.134.114.29)[CANCELLED]Expected value of type: STRING; but found type: Array; Document slice is : []

What You Expected?

normal query

How to Reproduce?

create es index

curl -XPUT -u elastic:Admin@123 "http://******:9200/es_table1" -H "Content-Type:application/json" -d '{
   "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 0,
    "index": {
     "max_result_window": 864000000
    }
   },
   "mappings": {
    "dynamic": "true",
    "properties": {
     "id": {
      "type": "long"
     },
     "uuid": {
      "type": "keyword"
     },
     "version": {
      "type": "keyword"
     },
     "reserve": {
      "type": "keyword"
     }
    }
   }
  }'

query es data, version fields exist as arrays and strings

curl  -X GET -u elastic:Admin@123 "http://******:9200/es_table1/_search?pretty"
{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 3,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "es_table1",
        "_type" : "_doc",
        "_id" : "1",
        "_score" : 1.0,
        "_source" : {
          "id" : 0
        }
      },
      {
        "_index" : "es_table1",
        "_type" : "_doc",
        "_id" : "2",
        "_score" : 1.0,
        "_source" : {
          "id" : 1,
          "uuid" : "111",
          "version": "1111"
        }
      },
      {
        "_index" : "es_table1",
        "_type" : "_doc",
        "_id" : "3",
        "_score" : 1.0,
        "_source" : {
          "id" : 2,
          "uuid" : "[]",
          "version" : [ ],
          "reserve" : [ ]
        }
      }
    ]
  }
}

create catalog

CREATE CATALOG `es_catalog1` PROPERTIES (
"password" = "Admin@123",
"mapping_es_id" = "true",
"type" = "es",
"user" = "elastic",
"hosts" = "http://****:9200",
"nodes_discovery"='false'
);

mysql> select * from es_catalog1.default_db.es_table1;
ERROR 1105 (HY000): errCode = 2, detailMessage = (9.134.114.29)[CANCELLED]Expected value of type: STRING; but found type: Array; Document slice is : []

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