查詢Hive表,報錯:Failed with exception java.io.IOException:parquet.io.ParquetDecodingException: Can not read value at 0 in block -1 in file hdfs://xxx:8020/user/hive/warehouse/tmp.db/table1/part-00000.snappy.parquet
解決辦法:
構建SparkSession時,增加 spark.sql.parquet.writeLegacyFormat:
SparkSession.builder()
.config("spark.sql.parquet.writeLegacyFormat", true)
.enableHiveSupport()
.getOrCreate()