Hive doesn't read partitioned parquet files generated by Spark

后端 未结 2 616
离开以前
离开以前 2020-12-14 23:28

I\'m having a problem to read partitioned parquet files generated by Spark in Hive. I\'m able to create the external table in hive but when I try to select a few lines, hive

2条回答
  •  时光说笑
    2020-12-14 23:53

    I finally found the problem. When you create tables in Hive, where partitioned data already exists in S3 or HDFS, you need to run a command to update the Hive Metastore with the table's partition structure. Take a look here: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-RecoverPartitions(MSCKREPAIRTABLE)

    The commands are:
    
    MSCK REPAIR TABLE table_name;
    
    
    And on Hive running in Amazon EMR you can use:
    
    ALTER TABLE table_name RECOVER PARTITIONS;
    

提交回复
热议问题