使用parquet-mr@1.11.0
,我有一个架构,例如:
schema message page {
required binary url (STRING);
optional binary content (STRING);
}
- 我正在进行单行查找
url
以检索相关的content
- 行按 排序
url
。
该文件是使用以下内容创建的:
- parquet.block.size:256 MB
- parquet.page.size:10 MB
使用parquet-tools
我能够验证我确实有我的列索引和/或我的列的偏移量:
column index for column url:
Boudary order: ASCENDING
null count min max
page-0 0 http://materiais.(...)delos-de-curriculo https://api.quero(...)954874/toogle_like
page-1 0 https://api.quero(...)880/toogle_dislike https://api.quero(...)ior-online/encceja
page-2 0 https://api.quero(...)erior-online/todos https://api.quero(...)nte-em-saude/todos
offset index for column url:
offset compressed size first row index
page-0 4 224274 0
page-1 224278 100168 20000
page-2 324446 67778 40000
column index for column content:
NONE
offset index for column content:
offset compressed size first row index
page-0 392224 504412 0
page-1 896636 784246 125
page-2 1680882 641212 200
page-3 2322094 684826 275
[... truncated ...]
page-596 256651848 183162 53100
使用配置为:
AvroParquetReader
.<GenericRecord>builder(HadoopInputFile.fromPath(path, conf))
.withFilter(FilterCompat.get(
FilterApi.eq(
FilterApi.binaryColumn(urlKey),
Binary.fromString(url)
)
))
.withConf(conf)
.build();
多亏了column-index
,column-offsets
我希望读者只能阅读 2 页:
- 包含使用列索引
url
匹配的那个。min/max
- 然后,包含
content
使用偏移索引的匹配行索引的那个。
但是我看到的是读者正在阅读和解码该content
列的数百页(~250MB),我是否错过了 PageIndex 在 parquet-mr 中应该如何工作的一些内容?
查看“加载页面”和“跳过记录”日志行,这是试图在应用过滤器之前构建整个记录url
,在我看来,这会破坏 PageIndex 的目的。
我试图在网上查看并深入了解阅读器的工作原理,但我找不到任何东西。
编辑
我发现一个 2015 年的公开 PRparquet-column
暗示当前读者(至少在当时)确实在应用谓词之前使用所有必需的列构建整个记录:
https://github.com/apache/parquet-mr/pull/288
但在这种情况下,我看不到column offsets
.