Create Hive table to read parquet files from parquet/avro schema

前端 未结 1 577
眼角桃花
眼角桃花 2020-12-05 22:13

We are looking for a solution in order to create an external hive table to read data from parquet files according to a parquet/avro schema.

in other way, how to gene

相关标签:
1条回答
  • 2020-12-05 22:36

    Try below using avro schema:

    CREATE TABLE avro_test ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe' STORED AS AVRO TBLPROPERTIES ('avro.schema.url'='myHost/myAvroSchema.avsc'); 
    
    CREATE EXTERNAL TABLE parquet_test LIKE avro_test STORED AS PARQUET LOCATION 'hdfs://myParquetFilesPath';
    

    Same query is asked in Dynamically create Hive external table with Avro schema on Parquet Data

    0 讨论(0)
提交回复
热议问题