通过 Impala Parquet压缩型

rta7y2nd  于 2021-06-26  发布在  Impala
关注(0)|答案(1)|浏览(246)

我们已经定义了很多impala表,并且假设我们使用的是snappy压缩(Parquet文件)
但是,没有人真正知道我们在现有表上实际使用的是什么压缩类型。
impala文档似乎没有指定如何从现有表中获取压缩类型。
有没有办法通过 Impala 找到使用过的压缩类型?

kq0g1dla

kq0g1dla1#

到目前为止,在impala中还没有命令可以告诉您存储为parquet的表中使用的压缩类型,但是有一个解决方法。您可以查看表中的一个Parquet文件,然后使用parquet tools meta命令查看正在使用的压缩。

-- step1) run hdfs dfs -ls to determine the location and name for a parquet file
hdfs dfs -ls /yourTableLocationPath
-- step2) parquet-tools really only works locally right now so you will need to copy the file to a local directory
hdfs dfs -get /yourTableLocationPath/yourFileName /yourLocalPath
-- step3) run parquet-tools meta command
parquet-tools meta /yourLocalPath/yourFileName

parquet tools meta命令的输出将显示行组输出下使用的压缩类型。

相关问题