【详述】使用 array_agg 函数时, 提示错误: com.starrocks.common.UserException: Internal error: std::get: wrong index for variant
【背景】做过哪些操作?
【业务影响】 是
【是否存算分离】 是
【StarRocks版本】3.2.8
【集群规模】例如:3fe(1 follower+2observer)+20be
【机器信息】be 16C/64G/万兆
【联系方式】StarRocks 3.0-存算分离用户群: 可以自然点嘛
【附件】
SELECT '20240731' AS __d,
IFNULL(base.device_id, '') AS ifa,
array_agg(ifa_bundle.bundle) AS media_bundle_array,
IFNULL(base.make, '') AS make,
IFNULL(base.model, '') AS model,
IFNULL(base.osv, '') AS os_version,
IFNULL(base.lang_code, '') AS lang_code,
IFNULL(base.region, '') AS region,
base.latest_day as latest_day,
base.country as country
from (SELECT device_id,
make,
model,
osv,
lang_code,
region,
latest_day,
country
FROM dws.rtb_ml_di_summary
where __d = '20240731')
as base
LEFT JOIN (SELECT device_id, bundle
FROM dws.rtb_did_bundle) AS ifa_bundle
ON base.device_id = ifa_bundle.device_id
GROUP BY IFNULL(base.device_id, ''),
IFNULL(base.make, ''),
IFNULL(base.model, ''),
IFNULL(base.osv, ''),
IFNULL(base.lang_code, ''),
IFNULL(base.region, ''),
base.latest_day,
base.country;
- 查询报错:
process failed.
com.starrocks.common.UserException: Internal error: std::get: wrong index for variant
at com.starrocks.qe.StmtExecutor.handleDMLStmt(StmtExecutor.java:2219) ~[starrocks-fe.jar:?]
at com.starrocks.load.InsertOverwriteJobRunner.executeInsert(InsertOverwriteJobRunner.java:322) ~[starrocks-fe.jar:?]
at com.starrocks.load.InsertOverwriteJobRunner.doLoad(InsertOverwriteJobRunner.java:161) ~[starrocks-fe.jar:?]
at com.starrocks.load.InsertOverwriteJobRunner.handle(InsertOverwriteJobRunner.java:141) ~[starrocks-fe.jar:?]
at com.starrocks.load.InsertOverwriteJobRunner.transferTo(InsertOverwriteJobRunner.java:201) ~[starrocks-fe.jar:?]
at com.starrocks.load.InsertOverwriteJobRunner.prepare(InsertOverwriteJobRunner.java:223) ~[starrocks-fe.jar:?]
at com.starrocks.load.InsertOverwriteJobRunner.handle(InsertOverwriteJobRunner.java:138) ~[starrocks-fe.jar:?]
at com.starrocks.load.InsertOverwriteJobRunner.run(InsertOverwriteJobRunner.java:126) ~[starrocks-fe.jar:?]
at com.starrocks.load.InsertOverwriteJobMgr.executeJob(InsertOverwriteJobMgr.java:87) ~[starrocks-fe.jar:?]
at com.starrocks.qe.StmtExecutor.handleInsertOverwrite(StmtExecutor.java:1803) ~[starrocks-fe.jar:?]
at com.starrocks.qe.StmtExecutor.handleDMLStmt(StmtExecutor.java:1893) ~[starrocks-fe.jar:?]
at com.starrocks.qe.StmtExecutor.handleDMLStmtWithProfile(StmtExecutor.java:1812) ~[starrocks-fe.jar:?]
at com.starrocks.qe.StmtExecutor.execute(StmtExecutor.java:671) ~[starrocks-fe.jar:?]
at com.starrocks.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:415) ~[starrocks-fe.jar:?]
at com.starrocks.qe.ConnectProcessor.dispatch(ConnectProcessor.java:610) ~[starrocks-fe.jar:?]
at com.starrocks.qe.ConnectProcessor.processOnce(ConnectProcessor.java:917) ~[starrocks-fe.jar:?]
at com.starrocks.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:69) ~[starrocks-fe.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: com.starrocks.common.DdlException: Internal error: std::get: wrong index for variant
at com.starrocks.common.ErrorReport.reportDdlException(ErrorReport.java:95) ~[starrocks-fe.jar:?]
at com.starrocks.qe.StmtExecutor.handleDMLStmt(StmtExecutor.java:2023) ~[starrocks-fe.jar:?]
... 19 more
如果将
array_agg(ifa_bundle.bundle) AS media_bundle_array,
改为
array_agg(distinct ifa_bundle.bundle) AS media_bundle_array,
可以正常运行,
怀疑array_agg函数, 不带distinct时有 bug