apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.3k stars 3.21k forks source link

[Bug] VARIANT 子列不存在时报 [INTERNAL_ERROR]Not found field_name, #32203

Open xumingxiang opened 6 months ago

xumingxiang commented 6 months ago

Search before asking

Version

2.1.0

What's Wrong?

使用 VARIANT 字段存储 map 数据,查询时如果字段没有所查询的子列,会报异常。比如我下面这个表的数据 微信截图_20240313225502 其中最后一列Tags字段是 VARIANT 类型,tags中的键值对是由业务无脑写入,无法提前预设,可能为空,可能不一致。 使用 SELECT * from LogChunk_1 where Tags['tag_key1'] is not null and CAST(tags['tag_key1'] as text) MATCH_ANY 'tag_val1' order byTimeDESC limit 10 查询便会报如下 `SQL 错误

errCode = 2, detailMessage = (172.16.56.137)[CANCELLED]failed to initialize storage reader. tablet=17136, res=[INTERNAL_ERROR]Not found field_name, field_name:Tags.tag_key1, schema:[Thread(8), Tags(9), Source(5), tags.tag_key1(-1), Title(6), Level(3), Time(2), CreateDate(1), Message(7), IP(4), AppId(0)]

What You Expected?

希望查询时能过滤掉没有对应子列的数据,而不是直接报错

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

Code of Conduct

eldenmoon commented 5 months ago

I will fix it

eldenmoon commented 5 months ago

可以在https://ask.selectdb.com 提问,问题会更快解决

eldenmoon commented 5 months ago

先CAST(tags['tag_key1'] as text) -> CAST(Tags['tag_key1'] as text) 试试, 是个bug

eldenmoon commented 5 months ago

This PR will help to fix this issue: https://github.com/apache/doris/pull/32999