StarRocks / starrocks

StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries.
https://starrocks.io
Apache License 2.0
8.74k stars 1.75k forks source link

无法通过 external catalog 查询 elasticsearch 8.13.4 中的索引信息 #47537

Open asdfsx opened 3 months ago

asdfsx commented 3 months ago

ElasticSearch 版本 8.13.4 StarRocks 版本 3.3

使用 starrocks/allin1-ubuntu:3.3-latest 创建测试用的StarRocks服务。连接本地的ElasticSearch

按照文档在DBeaver中执行

CREATE EXTERNAL CATALOG es_test
COMMENT 'test123'
PROPERTIES
(
    "type" = "es",
    "es.type" = "_doc",
    "hosts" = "http://172.18.1.111:9200",
    "user" = "elastic",
    "password" = "elastic",
    "es.nodes.wan.only" = "true"
);

之后尝试通过show tables from es_test.default_db;获取索引信息。

目前无法获取任何索引,在日志中也没有看到错误。 通过kibana可以看到Elasitc中是存在索引的。

image

asdfsx commented 3 months ago

看了一下源码, https://github.com/StarRocks/starrocks/blob/ea923b75aaa80b16777d8a0beb0ce2b548b0f7b4/fe/fe-core/src/main/java/com/starrocks/connector/elasticsearch/EsRestClient.java#L377-L384 是不是因为在进行listTables 时,对索引名进行了过滤导致前缀到.的索引无法成为external catalog? 目前 datastream 的数据时存放在.ds为前缀的索引中。如果我想查询由elastic datastream的数据的话怎么处理呢? 这个问题貌似变成了 starrocks 是否支持elastic datastream? @Jay-ju