创建 Hive 表以从 parquet/avro schema 读取 parquet 文件 [英] Create Hive table to read parquet files from parquet/avro schema
本文介绍了创建 Hive 表以从 parquet/avro schema 读取 parquet 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们正在寻找一种解决方案,以便创建一个外部配置单元表,以根据 parquet/avro 架构从 parquet 文件中读取数据.
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.
换句话说,如何从 parquet/avro schema 生成 hive 表?
in other way, how to generate a hive table from a parquet/avro schema ?
谢谢:)
推荐答案
尝试以下使用 avro schema:
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';
动态创建在 Parquet 数据上使用 Avro 架构的 Hive 外部表
这篇关于创建 Hive 表以从 parquet/avro schema 读取 parquet 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文