连接StarRocks出现异常: "build chunk meta error"

org.jkiss.dbeaver.model.sql.DBSQLException: SQL 错误 [1064] [42000]: build chunk meta error
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:133)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:513)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$0(SQLQueryJob.java:444)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:171)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:431)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:816)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:3468)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:118)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:171)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:116)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:4796)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.sql.SQLSyntaxErrorException: build chunk meta error
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:764)
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:330)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:130)
… 12 more

SQL:

SELECT
t.member_nbr,
t.consume_cnt_renew_pre_90d,
t.consume_cnt_renew_aft_30d,
t.ts,
t.row_number_num
from
(
select
c.member_nbr,
c.consume_cnt_renew_pre_90d,
c.consume_cnt_renew_aft_30d,
c.ts,
ROW_NUMBER() over (PARTITION by b.member_nbr
order by
ts) as row_number_num
from
(
select
cc.bind_phone,
cc.channel_id,
cc.channel_type
from
((
select
bind_phone,
channel_id,
channel_type
from
ma_touching_result
where
channel_id = 602
and channel_type = 110
and touching_result = 1
except
select
bind_phone,
channel_id,
channel_type
from
ma_touching_result
where
channel_id = 602
and channel_type = 110
and touching_result = 0)
)cc) a
join ma_channel_segment_detail b on
a.channel_id = b.channel_id
and a.bind_phone = b.bind_phone
join
ads_user_sams_member_renew_analysis_dtl_di c on
b.member_nbr = c.member_nbr
where
a.channel_id = 602
and a.channel_type = 110
and c.ts BETWEEN ‘2023-07-18’ and ‘2023-08-16’
and c.member_nbr is not null
and c.member9_nbr is not null
and c.is_renew_mbr is not null)t
where
row_number_num = 1

测试出来发现, 在Follower节点执行就报错, 在Leader节点执行就成功

临时解决办法:

  • 重启这个fe节点, 重新加载元数据

be.WARNING 发一下看看

SELECT
part_id,
process_id,
process_name,
process_desc,
wo_type,
count(*) AS INPUT_NUM,
sum(current_status) as ok,
sum(current_status) - sum(work_flag) AS ng,
sum(work_flag) AS scrap ,
‘2023-09-15 08’ AS timeB,
‘2023-09-16 10’ AS timeE
FROM
(

SELECT
	st.part_id,
	pt.model_id,
	ps.process_name,
	case when  ps.process_desc is null then 'N/A'  else ps.process_desc  end as process_desc	,
	ps.process_id,
	wb.wo_type,
	st.serial_number,
	pt.route_id,
	case when  st.work_flag = 0  then 1 else  0  end  AS  ok_label,
	case when  st.work_flag = 1  then 1 else  st.current_status  end  AS  current_status,
	st.work_flag,
	ROW_NUMBER() OVER(PARTITION BY st.process_id, st.serial_number ORDER BY st.out_process_time DESC) AS rn
FROM
	ods.ods_2023cmm_sajet_g_sn_travel  st
INNER JOIN ods.ods_2023cmm_sajet_sys_part pt ON
	pt.part_id = st.part_id
INNER JOIN ods.ods_2023cmm_sajet_g_wo_base wb ON
	wb.work_order = st.work_order
INNER JOIN ods.ods_2023cmm_sajet_sys_process ps ON
	ps.process_id = st.process_id
WHERE
	pt.model_id = 10000011
	AND st.process_id = 100053
	AND st.out_process_time >= '2023-09-15 08:00:00'
	AND st.out_process_time < '2023-09-15 10:00:00' 
	
	)  t_lyc

WHERE
rn = 1
GROUP BY
part_id,
process_id,
process_name,
process_desc,
wo_type ;

报错信息:
org.jkiss.dbeaver.model.sql.DBSQLException: SQL 错误 [1064] [42000]: build chunk meta error
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:133)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:510)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$0(SQLQueryJob.java:441)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:169)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:428)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:813)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:3280)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:118)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:169)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:116)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:4589)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.sql.SQLSyntaxErrorException: build chunk meta error
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:764)
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:330)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:130)
… 12 more

我也是,请问是啥原因引起的呢

使用开窗函数 ROW_NUMBER() 时报错

image
临时解决方案 放在外层嵌套

:+1::+1::+1::+1::+1::+1::+1:

可以提供下当时 查询报错时的 be.info 日志么

https://github.com/StarRocks/starrocks/pull/33671 已经在这个pr里fix了. 3.0后版本不存在这个问题.