现象:公司使用flink cdc的时候,往hudi同步的数据是13140条数据,模式用的是cow,生成的parquet格式文件的时候,每upstert一次,用hive使用count查询的时候一下子是之前数据的十倍,131400条了,用presto查询不会出现这种情况。
解决方案:
在使用hive做聚合查询的时候,前面加上以下参数
set hive.input.format= org.apache.hadoop.hive.ql.io.HiveInputFormat;
没有加参数之前的查询结果:
select count(1) from ods_sony_hudi_ty_user_vip;
set hive.input.format= org.apache.hadoop.hive.ql.io.HiveInputFormat;
select count(1) from ods_sony_hudi_ty_user_vip;