doris2.1.3,insert into doris_table select xxx from hive_catalog.hive_schema.hive_table偶发性没有数据插入

Viewed 111

doris2.1.3,insert into doris_table select xxx from hive_catalog.
hive_schema.hive_table偶发性没有数据插入

插入的语句:

truncate table bbg_doris.dw_cs_cash_performance_abnormal partition p20240606;
insert into bbg_doris.dw_cs_cash_performance_abnormal select cdate, tj_time, store_id, siebel_id, emp_id, type, channel, tran_seq_no, tran_datetime, sku_count, 1 nums from hive.data_trans.dw_cs_cash_performance_abnormal;

以上语句为先清除doris表特定分区的数据,然后插入该分区的数据,其中hive表只包含该分区的数据

近7次有两次没有数据。任务执行没有报错,正常结束,从audit_log表中查询该语句的执行情况也正常:
1717741939565.png

但是查询该表,当日(2024-06-06)没有数据,最近8天有两天没有数据:
1717742037976.png
见图()

补充截图:
图1:presto可以查到数据:
007c044aedf3c2e4c1c114abdb17cc7.png
图2、显示这张hive表查了4次,第一次没有查到数据,后续3次都查到了
d3821e9769c276b82037cf5cea7d6f3.png

2 Answers

先试试用脚本,重复执行select部分,看看会不会出现空集。另外,insert 语句会返回插入的行数,也记录下日志看看

捕获到一次插入失败的日志,怀疑是hive catalog有时候查不到数据,这张hive表实际是有数据的,在presto能查到,但是在doris中有时候查不到:

mysql: [Warning] Using a password on the command line interface can be insecure.

truncate table bbg_doris.ads_cs_dan_item_member_ratio_1d partition p20240611

Query OK, 0 rows affected (0.08 sec)

insert into bbg_doris.ads_cs_dan_item_member_ratio_1d
select * from hive.data_trans.ads_cs_dan_item_member_ratio_1d_doris

Query OK, 0 rows affected (0.13 sec)
{'label':'label_bc33b15ee9e84a1d_8cb1df387e1f8a0c', 'status':'VISIBLE', 'txnId':'4298641'}

Bye