Insert Into 使用join和where时报错
Sql语句如下
insert into nodeid_15759616930091501870
select col_b8ff236f9c8f5a51e1c7041b11c68378, col_035aa15235d66d9dc704c02de879badb
from (
select `a`.col_b8ff236f9c8f5a51e1c7041b11c68378, 1 col_035aa15235d66d9dc704c02de879badb
from nodeid_15759456123033821049 as a
left JOIN nodeid_15759456123033821049_tmp as b on b.id=a.id -- and b.id=1
where b.id=1
) a
- 当 join 和 where 同时存在时 ,insert into select 语句会报错, 单独 select xxxx 语句正常执行。
- 将 where 语句 转为 and b.id=1 , insert into 语句也会正常执行
- 当创建目标表 buckets 为 1/1 时,insert into 语句也会正常执行
# 目标表默认参数
TABLE: nodeid_15759759282784611571
PREAGGREGATION: ON
partitions=1/1
rollup: nodeid_15759759282784611571
buckets=10/10
cardinality=36
avgRowSize=685.2222
numNodes=3
tuple ids: 4
上述 insert into 语句执行报错为 all partitions have no load data
This error means that all data has been filtered becuase of quality. I see that you have left join in your select statement, please check the column type of your destination table is nullable.
And what's your Doris' version? Better to upgrade your Doris, then you will have message about filtered data.
Thank you for your answer.
- destination table is not nullable and data_type is correct .
- doris version is not lastest. this is download by October 6, 2019 download type : git clone https://github.com/apache/incubator-doris.git
You can alter your table and change the column to nullable. Then execute the insert statement again to see if it will success. Is this Doris env your production env? If it is not, you can upgrade Doris to latest and test it again.
Thank You. target_table data is null and the target column have change the column to nullable(can receive null val).
My Doris version == 0.10.0 , Doris is not lastest.
Will update Doris . need some time to test.