我们定义了相当多的 impala 表,并假设我们使用 Snappy 压缩。 ( Parquet 文件)
然而,没有人真正知道我们在现有表上实际使用的压缩类型。
impala 文档似乎没有指定如何从现有表中获取压缩类型。
有没有办法通过impala找到使用的压缩类型?
最佳答案
到目前为止,Impala 中没有命令可以告诉您存储为 parquet 的表中使用的压缩类型,但有一个解决方法。您可以做的是查看表中的 parquet 文件之一,然后使用 parquet-tools 元命令来查看正在使用的压缩。
-- 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 元命令的输出将显示行组输出下使用的压缩类型。
关于impala - 通过 Impala 的 Parquet 压缩类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36469888/