Commit ba3f2cd
committed
perf(parquet): make dictionary passthrough opt-in and restrict it to STRING
Addresses the review on #257.
The compaction rewrite no longer turns `parquet.read.enable-dictionary-passthrough`
on. It is a table option, off by default, and the rewrite only vetoes it - when the
output is not Parquet, when `parquet.enable-dictionary` is false, or when a
shredding writer is active - logging the reason at DEBUG for a table that did ask
for it. Forwarding trades compaction CPU for output size, and a Parquet column
chunk carries one dictionary, so a multi-file rewrite can keep the first input
file's and write the rest of the row group plain; whether that trade is worth
taking depends on the data, so it is left to the table.
Restrict the reader to STRING. Parquet stores BINARY in the same BYTE_ARRAY leaf
and dictionary-encodes it the same way, but no value accessor here can read a
`dictionary(int32, binary)`: ColumnarUtils::GetView() asserts on it and returns an
empty view in a release build, and LiteralConverter rejects it. Since the option
applies to every read of the table, the gate gets that restriction, not the layout
predicate - ArrowUtils::IsDictionaryLayoutRecoverableValueType() still accepts
`utf8|binary`, which is what the writer can recover, so the writer keeps the
capability for a future producer.
Also from the review: use CastingUtils::Cast() instead of arrow::compute::Cast();
hold the Arrow pool adaptor in DataFileIndexWriter as a member declared before the
index writers, so it outlives every buffer allocated through it; drop the batch
schema cache in ParquetFormatWriter::ResolveBatchSchema(); read the two Parquet
option names in core as local constants rather than through the format layer's
headers.
The changing-dictionary benchmark now rotates one alphabet and shifts the indices
back by the same amount, so it writes the same logical column as its pair and the
delta is the fallback rather than a difference in the data.1 parent 450eed2 commit ba3f2cd
19 files changed
Lines changed: 809 additions & 246 deletions
File tree
- benchmark
- docs/source
- examples
- user_guide
- src/paimon
- common/utils/arrow
- core
- io
- operation
- format/parquet
- test/inte
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
286 | 310 | | |
287 | 311 | | |
288 | 312 | | |
| |||
979 | 1003 | | |
980 | 1004 | | |
981 | 1005 | | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
982 | 1010 | | |
983 | 1011 | | |
984 | 1012 | | |
| |||
988 | 1016 | | |
989 | 1017 | | |
990 | 1018 | | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
991 | 1037 | | |
992 | 1038 | | |
993 | 1039 | | |
| |||
1356 | 1402 | | |
1357 | 1403 | | |
1358 | 1404 | | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1359 | 1413 | | |
1360 | 1414 | | |
1361 | 1415 | | |
| |||
0 commit comments