Failed with exception java.io.IOException:org.apache.parquet.io.ParquetDecodingException: Can not read value at 0 in block -1 in file hdfs://hadoop102:8020/warehouse/gmall/ads_user_action4/dt=2020-06-14/part-00000-52558b00-e39f-453c-8d9a-a924776a0aa7.c000.snappy.parquet
记录一次spark on hive,写数据到hive表后,使用hive查询报错的问题。
网上查了好多都没有查到具体原因,最后在spark官网找到了问题所在,有一个参数:spark.sql.parquet.writeLegacyFormat,默认为false。
先看官网解释:
If true, data will be written in a way of Spark 1.4 and earlier. For example, decimal values will be written in Apache Parquet’s fixed-length byte array format, which other systems such as Apache Hive and Apache Impala use. If false, the newer format