【背景】刚升级到4.0.1
【是否存算分离】否
【StarRocks版本】4.0.1
【集群规模】 3fe +7be
【详述】创建一个elasticsearch的catalog,然后使用这个catalog进行查询报错:
General error: 1064 Only support use correlated columns in the where clause of subqueries
查询语句:
SQL: select `bid`, count(id) as total_count, sum(interaction_count) as interaction_count, 0 as cost, sum(if(pos > 0, 1, 0)) as pos_count, sum(if(pos < 0, 1, 0)) as neg_count from `test` where `bid` in (1) and `industry_id` = 1 and `bid` in (1) and `date` between 2025-01-01 and 2025-09-30 and `id` in (select `id` from `es_database`.`default_db`.`dev-test-*` where esquery(id, '{\"bool\":{\"must\":[{\"term\":{\"industryid\":{\"value\":1}}},{\"terms\":{\"bid\":[1]}},{\"range\":{\"date\":{\"gte\":\"2025-01-01\",\"lte\":\"2025-09-30\"}}},{\"bool\":{\"must\":[{\"bool\":{\"should\":[{\"match_phrase\":{\"text\":\"茶\"}},{\"match_phrase\":{\"image_text\":\"茶\"}},{\"match_phrase\":{\"video_text\":\"茶\"}}]}}]}}]}}')) group by `bid`
通过grant把表权限赋重新给用户之后第一次查询可以成功执行,过一会查询又报错。