Dynamically create Hive external table with Avro schema on Parquet Data

后端 未结 1 746
逝去的感伤
逝去的感伤 2020-12-10 21:09

I\'m trying to dynamically (without listing column names and types in Hive DDL) create a Hive external table on parquet data files. I have the Avro schema of underlying parq

1条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 21:49

    Below query works:

    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';
    

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