doris: [Bug] Query es catalog error

Search before asking

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

Version

doris master

What’s Wrong?

query es catalog error.

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

What You Expected?

query normally

How to Reproduce?

At first, apply the two PRs in master, because the PRs solve other es problem.

  https://github.com/apache/doris/pull/22046/files
  https://github.com/apache/doris/pull/22279/files 

Then start es.

  1. mapping
curl -XPUT "http://127.0.0.1:9200/test_table8"  -H "Content-Type:application/json" -d '{
      "settings": {
        "number_of_shards": 1,
        "number_of_replicas": 0,
        "index": {
          "max_result_window": 864000000
        }
      },
      "mappings": {
        "dynamic": "strict",
        "properties": {
          "id": {
            "type": "long"
          },
          "uuid": {
            "type": "keyword"
          },
          "version": {
            "type": "keyword"
          },
          "desc": {
            "type": "keyword"
          },
          "reserve": {
            "type": "keyword"
          },
          "is_new": {
            "type": "keyword"
          }
        }
      }
    }'
  1. add column
  curl -X POST "http://127.0.0.1:9200/test_table8/_mappings"  -H "Content-Type:application/json" -d '{
      "properties": {
          "company_id": {
            "type": "long"
          },
          "dacs_license_type": {
            "type": "keyword"
          },
          "os": {
            "type": "keyword"
          },
          "dacs_version": {
            "type": "keyword"
          },
          "session_id": {
            "type": "keyword"
          },
          "original_data_trace_id": {
            "type": "keyword"
          }
      }
    }'
  1. put data in es
  curl "http://127.0.0.1:9200/test_table8/_doc/1" -H "Content-Type:application/json" -X POST -d '{
    "company_id": 0,
    "dacs_license_type": "abc",
    "os": "Windows 10 Pro 2009",
    "is_new": 0,
    "reserve": 0,
    "id": 12,
    "uuid": "A52C86027FCF3E44719C62E1EB4E30CDDC403464",
    "desc": 2724,
    "dacs_version": 0,
    "original_data_trace_id": 0,
    "session_id": 0,
    "version": "0123"
}' 
  1. put another data in es, but this data does not contain all columns
 curl "http://127.0.0.1:9200/test_table8/_doc/2" -H "Content-Type:application/json" -X POST -d '{
    "company_id": 0,
    "os": "Windows 10 Pro 2009",
    "is_new": 0,
    "reserve": 0,
    "uuid": "A52C86027FCF3E44719C62E1EB4E30CDDC403464",
    "desc": 2724,
    "dacs_version": 0,
    "original_data_trace_id": 0,
    "session_id": 0
}'
  1. query es catalog
select * from test_table8;
ERROR 1105 (HY000): errCode = 2, detailMessage = (10.16.10.6)[CANCELLED][RUNTIME_ERROR]Expected value of type: STRING; but found type: Array; Document slice is : []
  1. but if query a column which is in step 4, it’s OK
select session_id from test_table8;

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

2.0.3.1 selectdb0doris 并没有解决 image image @liugddx

还有更奇怪的

CREATE CATALOG es PROPERTIES ( “type”=“es”, “hosts”=“http://ip:9200”, );

esquery查询语句

select * from test where esquery(k4, ‘{ “match_phrase”: { “k4”: “doris on es” } }’);

报错: [CANCELLED][NOT_IMPLEMENTED_ERROR]esquery only supported on es table

文档内不是支持 扩展的 esquery? https://doris.apache.org/zh-CN/docs/lakehouse/multi-catalog/es/#扩展的-esqueryfield-querydsl

PUT test
{
   "settings": {
      "index": {
         "number_of_shards": "1",
         "number_of_replicas": "0"
      }
   },
  "mappings": {
    "properties": {
      "k1": {
        "type": "long",
        "index": "true"
      },
      "k2": {
        "type": "date",
        "format": "yyyy-MM-dd"
      },
      "k3": {
        "type": "text",
        "analyzer": "ik_max_word",
        "search_analyzer": "ik_max_word"
      },
      "k4": {
        "type": "text",
        "analyzer": "ik_max_word",
        "search_analyzer": "ik_max_word"
      },
      "k5": {
        "type": "float"
      }
    }
  }
}

@liugddx