我的表test_orc包含(对于一个分区):
col1 col2 part1
abc def 1
ghi jkl 1
mno pqr 1
koi hai 1
jo pgl 1
hai tre 1
Run Code Online (Sandbox Code Playgroud)
通过跑步
hive --orcfiledump /hive/user.db/test_orc/part1=1/000000_0
Run Code Online (Sandbox Code Playgroud)
我得到以下信息:
Structure for /hive/a0m01lf.db/test_orc/part1=1/000000_0 .
2018-02-18 22:10:24 INFO: org.apache.hadoop.hive.ql.io.orc.ReaderImpl - Reading ORC rows from /hive/a0m01lf.db/test_orc/part1=1/000000_0 with {include: null, offset: 0, length: 9223372036854775807} .
Rows: 6 .
Compression: ZLIB .
Compression size: 262144 .
Type: struct<_col0:string,_col1:string> .
Stripe Statistics:
Stripe 1:
Column 0: count: 6 .
Column 1: count: 6 min: abc max: mno sum: 17 .
Column 2: count: 6 min: def max: tre sum: 18 .
File Statistics:
Column 0: count: 6 .
Column 1: count: 6 min: abc max: mno sum: 17 .
Column 2: count: 6 min: def max: tre sum: 18 .
Stripes:
Stripe: offset: 3 data: 58 rows: 6 tail: 49 index: 67 .
Stream: column 0 section ROW_INDEX start: 3 length 9 .
Stream: column 1 section ROW_INDEX start: 12 length 29 .
Stream: column 2 section ROW_INDEX start: 41 length 29 .
Stream: column 1 section DATA start: 70 length 20 .
Stream: column 1 section LENGTH start: 90 length 12 .
Stream: column 2 section DATA start: 102 length 21 .
Stream: column 2 section LENGTH start: 123 length 5 .
Encoding column 0: DIRECT .
Encoding column 1: DIRECT_V2 .
Encoding column 2: DIRECT_V2 .
Run Code Online (Sandbox Code Playgroud)
关于条纹的部分是什么意思?
首先,让我们看看 ORC 文件是什么样子的。
\n\n\n\n现在上图中以及您的问题中使用了一些关键字!
\n\n索引数据- 包括每列的最小值和最大值以及每列中的行位置。(也可以包括位字段或布隆过滤器。)行索引条目提供偏移量,使得能够在解压缩块内查找正确的压缩块和字节。 请注意,ORC 索引仅用于选择条带和行组,而不用于回答查询。
行数据- 实际数据。用于表扫描。
条带页脚- 条带页脚包含每列的编码和流的目录(包括它们的位置)。为了描述每个流,ORC 存储流的类型、列 ID 和流\xe2\x80\x99s 大小(以字节为单位)。每个流中存储内容的详细信息取决于列的类型和编码。
Postscript - 保存压缩参数和压缩页脚的大小。
现在!谈论 orcfiledump 的输出。
\n\n此外,您可以使用 orcfiledump 的各种选项来获得“所需”结果。遵循方便的指南。
\n\n// Hive version 0.11 through 0.14:\nhive --orcfiledump <location-of-orc-file>\n\n// Hive version 1.1.0 and later:\nhive --orcfiledump [-d] [--rowindex <col_ids>] <location-of-orc-file>\n\n// Hive version 1.2.0 and later:\nhive --orcfiledump [-d] [-t] [--rowindex <col_ids>] <location-of-orc-file>\n\n// Hive version 1.3.0 and later:\nhive --orcfiledump [-j] [-p] [-d] [-t] [--rowindex <col_ids>] [--recover] [--skip-dump] \n [--backup-path <new-path>] <location-of-orc-file-or-directory>\nRun Code Online (Sandbox Code Playgroud)\n\n遵循上述命令中使用的选项的快速指南。
\n\n希望有帮助!
\n| 归档时间: |
|
| 查看次数: |
6437 次 |
| 最近记录: |