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

 

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