ODS层读数不准问题

原因:

  默认情况下 hive.input.format=org.apache.hadoop.hive.ql.io.CombineHiveInputFormat(切片),此设置的功能是将输入目录的小文件进行切片合并,但是误将lzo.index文件也作为数据,故导致读数不准。

解决:

  不使用CombineHiveInputFormat,使用HiveInputFormat即可,set hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat,此设置默认使用表中设置的inputformat进行切片来读数据,使用表的数据格式,这样就不会将索引文件也作为数据处理了

  我们可以在Hive的配置文件中设置(/opt/module/hive/conf/hive-site.xml),设置完成后重启Hive即可

vim /opt/module/hive/conf/hive-site.xml
<!-- 修改CombineHiveInputFormat为HiveInputFormat  -->
<property>
    <name>hive.input.format</name>
    <value>org.apache.hadoop.hive.ql.io.HiveInputFormat</value>
</property>
</configuration>
原文地址:https://www.cnblogs.com/LzMingYueShanPao/p/14945809.html