将压缩 (GZIP) 数据从 S3 导入到 Hive



我在s3://mybucket/file/*.gzip中有一堆.gzip文件。

我正在使用以下内容加载到表中:

set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;
set hive.exec.max.dynamic.partitions.pernode=1000;
set hive.enforce.bucketing = true;
SET hive.exec.compress.output=true;
SET io.seqfile.compression.type=BLOCK;
SET mapred.output.compression.codec=org.apache.hadoop.io.compress.GzipCodec;
create external table db.tablename(col1 dataype,col1 dataype,col1 dataype,col1     dataype) PARTITIONED BY (col datatype)
CLUSTERED BY (col2) SORTED BY (col1,col2) into 200 BUCKETS
ROW FORMAT DELIMITED FIELDS TERMINATED BY 't' LINES TERMINATED BY 'n' LOCATION 's3://mybucket/file';

它创建表,但不将数据从 s3 加载到 hive/hdfs。

感谢任何帮助?

谢谢桑吉夫

我认为您在 s3://mybucket/file/中的文件没有按照正确的 Hive 分区目录结构组织。我建议您在 s3://mybucket/file/上创建一个没有分区和存储桶的外部表,然后编写 hive 查询以从该表中读取数据并写入分区/存储桶表。

最新更新