Hive无法读取Parquet

查询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()

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章