Skip to content

Use ParquetPushDecoder in ParquetOpener#20839

Merged
Dandandan merged 5 commits intoapache:mainfrom
Dandandan:poc_push_decoder
Mar 11, 2026
Merged

Use ParquetPushDecoder in ParquetOpener#20839
Dandandan merged 5 commits intoapache:mainfrom
Dandandan:poc_push_decoder

Conversation

@Dandandan
Copy link
Contributor

@Dandandan Dandandan commented Mar 10, 2026

Which issue does this PR close?

Rationale for this change

We want to split IO and CPU to allow for more (NUMA-aware) parallelism and utilizing IO and CPU better.
This allows for e.g. more coalescing, prefetching, parallel IO, more parallel / incremental decoding etc.
Also this allows doing morsels only on a CPU level and not doing IO multiple times for each morsel.

What changes are included in this PR?

Just refactor ParquetOpener to use ParquetPushDecoder. I used claude to rewrite it and to keep changes small.

Are these changes tested?

Existing tests. Nothing should change, the arrow-rs code also uses ParquetPushDecoder.

Are there any user-facing changes?

@github-actions github-actions bot added the datasource Changes to the datasource crate label Mar 10, 2026
@Dandandan
Copy link
Contributor Author

run benchmarks

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing poc_push_decoder (beced87) to 92078d9 diff using: tpch_mem clickbench_partitioned clickbench_extended
Results will be posted here when complete

@Dandandan Dandandan changed the title PoC Parquet pushdecoder PoC Use ParquetPushDecoder Mar 10, 2026
loop {
match decoder.try_decode() {
Ok(DecodeResult::NeedsData(ranges)) => {
match reader.get_byte_ranges(ranges.clone()).await {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I think is what you meant @alamb this way instead of get_byte_ranges here, we can push this to a IO morsel queue instead (and possibly do prefetching / more coalescing / split IO requests / etc.)

@github-actions github-actions bot added the core Core DataFusion crate label Mar 10, 2026
@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and poc_push_decoder
--------------------
Benchmark clickbench_extended.json
--------------------
┏━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query    ┃        HEAD ┃ poc_push_decoder ┃       Change ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 0 │  2288.42 ms │      17026.37 ms │ 7.44x slower │
│ QQuery 1 │   750.50 ms │       6731.57 ms │ 8.97x slower │
│ QQuery 2 │  1603.37 ms │      13018.71 ms │ 8.12x slower │
│ QQuery 3 │   993.31 ms │       7461.21 ms │ 7.51x slower │
│ QQuery 4 │  2124.50 ms │      13184.49 ms │ 6.21x slower │
│ QQuery 5 │ 26392.67 ms │     211969.12 ms │ 8.03x slower │
│ QQuery 6 │  3590.87 ms │      27356.96 ms │ 7.62x slower │
│ QQuery 7 │  2637.32 ms │      20235.95 ms │ 7.67x slower │
└──────────┴─────────────┴──────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Benchmark Summary               ┃             ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ Total Time (HEAD)               │  40380.95ms │
│ Total Time (poc_push_decoder)   │ 316984.38ms │
│ Average Time (HEAD)             │   5047.62ms │
│ Average Time (poc_push_decoder) │  39623.05ms │
│ Queries Faster                  │           0 │
│ Queries Slower                  │           8 │
│ Queries with No Change          │           0 │
│ Queries with Failure            │           0 │
└─────────────────────────────────┴─────────────┘
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ poc_push_decoder ┃       Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ QQuery 0  │     2.52 ms │          2.57 ms │    no change │
│ QQuery 1  │    45.88 ms │         49.36 ms │ 1.08x slower │
│ QQuery 2  │   149.30 ms │        157.96 ms │ 1.06x slower │
│ QQuery 3  │   156.75 ms │        163.69 ms │    no change │
│ QQuery 4  │   965.12 ms │       1048.72 ms │ 1.09x slower │
│ QQuery 5  │  1169.66 ms │       1261.82 ms │ 1.08x slower │
│ QQuery 6  │     6.05 ms │         15.53 ms │ 2.57x slower │
│ QQuery 7  │    52.36 ms │         55.72 ms │ 1.06x slower │
│ QQuery 8  │  1301.16 ms │       1455.66 ms │ 1.12x slower │
│ QQuery 9  │  1650.33 ms │       1781.23 ms │ 1.08x slower │
│ QQuery 10 │   312.63 ms │        334.76 ms │ 1.07x slower │
│ QQuery 11 │   360.44 ms │        386.19 ms │ 1.07x slower │
│ QQuery 12 │  1116.36 ms │       1190.45 ms │ 1.07x slower │
│ QQuery 13 │  1741.28 ms │       1867.61 ms │ 1.07x slower │
│ QQuery 14 │  1108.63 ms │       1196.77 ms │ 1.08x slower │
│ QQuery 15 │  1104.82 ms │       1183.43 ms │ 1.07x slower │
│ QQuery 16 │  2283.21 ms │       2471.50 ms │ 1.08x slower │
│ QQuery 17 │  2288.17 ms │       2467.64 ms │ 1.08x slower │
│ QQuery 18 │  4591.78 ms │       5033.92 ms │ 1.10x slower │
│ QQuery 19 │   118.05 ms │        137.71 ms │ 1.17x slower │
│ QQuery 20 │  1731.85 ms │       1950.83 ms │ 1.13x slower │
│ QQuery 21 │  1960.88 ms │       2249.75 ms │ 1.15x slower │
│ QQuery 22 │  3378.25 ms │       3657.68 ms │ 1.08x slower │
│ QQuery 23 │ 10828.51 ms │      13166.48 ms │ 1.22x slower │
│ QQuery 24 │   192.35 ms │        220.17 ms │ 1.14x slower │
│ QQuery 25 │   407.23 ms │        414.90 ms │    no change │
│ QQuery 26 │   175.20 ms │        225.36 ms │ 1.29x slower │
│ QQuery 27 │  2486.63 ms │       2708.09 ms │ 1.09x slower │
│ QQuery 28 │ 21555.54 ms │      24054.55 ms │ 1.12x slower │
│ QQuery 29 │   991.61 ms │       1024.23 ms │    no change │
│ QQuery 30 │  1146.90 ms │       1242.90 ms │ 1.08x slower │
│ QQuery 31 │  1220.07 ms │       1326.99 ms │ 1.09x slower │
│ QQuery 32 │  4015.85 ms │       4120.93 ms │    no change │
│ QQuery 33 │  5178.55 ms │       5721.70 ms │ 1.10x slower │
│ QQuery 34 │  5203.80 ms │       6103.74 ms │ 1.17x slower │
│ QQuery 35 │  1083.21 ms │       1164.78 ms │ 1.08x slower │
│ QQuery 36 │   178.06 ms │        181.09 ms │    no change │
│ QQuery 37 │    70.78 ms │         70.93 ms │    no change │
│ QQuery 38 │   109.69 ms │        112.95 ms │    no change │
│ QQuery 39 │   326.88 ms │        334.29 ms │    no change │
│ QQuery 40 │    38.09 ms │         42.67 ms │ 1.12x slower │
│ QQuery 41 │    32.22 ms │         35.17 ms │ 1.09x slower │
│ QQuery 42 │    28.91 ms │         32.81 ms │ 1.13x slower │
└───────────┴─────────────┴──────────────────┴──────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary               ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)               │ 82865.57ms │
│ Total Time (poc_push_decoder)   │ 92425.23ms │
│ Average Time (HEAD)             │  1927.11ms │
│ Average Time (poc_push_decoder) │  2149.42ms │
│ Queries Faster                  │          0 │
│ Queries Slower                  │         34 │
│ Queries with No Change          │          9 │
│ Queries with Failure            │          0 │
└─────────────────────────────────┴────────────┘
--------------------
Benchmark tpch_mem_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ poc_push_decoder ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 103.42 ms │        102.24 ms │     no change │
│ QQuery 2  │  31.64 ms │         30.51 ms │     no change │
│ QQuery 3  │  37.28 ms │         38.44 ms │     no change │
│ QQuery 4  │  30.11 ms │         31.01 ms │     no change │
│ QQuery 5  │  84.93 ms │         80.27 ms │ +1.06x faster │
│ QQuery 6  │  23.33 ms │         20.11 ms │ +1.16x faster │
│ QQuery 7  │ 151.44 ms │        142.62 ms │ +1.06x faster │
│ QQuery 8  │  41.90 ms │         39.26 ms │ +1.07x faster │
│ QQuery 9  │ 108.49 ms │         97.84 ms │ +1.11x faster │
│ QQuery 10 │  73.93 ms │         64.32 ms │ +1.15x faster │
│ QQuery 11 │  19.37 ms │         17.74 ms │ +1.09x faster │
│ QQuery 12 │  67.63 ms │         54.01 ms │ +1.25x faster │
│ QQuery 13 │  55.03 ms │         51.10 ms │ +1.08x faster │
│ QQuery 14 │  15.68 ms │         14.33 ms │ +1.09x faster │
│ QQuery 15 │  28.93 ms │         29.28 ms │     no change │
│ QQuery 16 │  27.22 ms │         27.23 ms │     no change │
│ QQuery 17 │ 134.11 ms │        140.37 ms │     no change │
│ QQuery 18 │ 263.83 ms │        261.32 ms │     no change │
│ QQuery 19 │  40.42 ms │         42.83 ms │  1.06x slower │
│ QQuery 20 │  55.33 ms │         55.24 ms │     no change │
│ QQuery 21 │ 192.29 ms │        192.50 ms │     no change │
│ QQuery 22 │  22.03 ms │         22.50 ms │     no change │
└───────────┴───────────┴──────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary               ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)               │ 1608.36ms │
│ Total Time (poc_push_decoder)   │ 1555.08ms │
│ Average Time (HEAD)             │   73.11ms │
│ Average Time (poc_push_decoder) │   70.69ms │
│ Queries Faster                  │        10 │
│ Queries Slower                  │         1 │
│ Queries with No Change          │        11 │
│ Queries with Failure            │         0 │
└─────────────────────────────────┴───────────┘

@Dandandan
Copy link
Contributor Author

run benchmarks

@github-actions github-actions bot added physical-plan Changes to the physical-plan crate and removed core Core DataFusion crate labels Mar 10, 2026
@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing poc_push_decoder (1a23f17) to 92078d9 diff using: tpch_mem clickbench_partitioned clickbench_extended
Results will be posted here when complete

@github-actions github-actions bot added documentation Improvements or additions to documentation sql SQL Planner development-process Related to development process of DataFusion logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates optimizer Optimizer rules core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) substrait Changes to the substrait crate catalog Related to the catalog crate common Related to common crate execution Related to the execution crate proto Related to proto crate functions Changes to functions implementation ffi Changes to the ffi crate spark labels Mar 10, 2026
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Mar 10, 2026
@github-actions github-actions bot removed documentation Improvements or additions to documentation sql SQL Planner development-process Related to development process of DataFusion logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates optimizer Optimizer rules core Core DataFusion crate labels Mar 10, 2026
loop {
match state.decoder.try_decode() {
Ok(DecodeResult::NeedsData(ranges)) => {
match state.reader.get_byte_ranges(ranges.clone()).await {
Copy link
Contributor Author

@Dandandan Dandandan Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems slightly faster to coalesce adjacent ranges (even for local storage) to remove some IO requests, mainly beneficial for TPC-DS it seems (see #20839 (comment)), and somehow for tpch_mem as well (I guess more batches will be batch_size sized).
But I kept it out of this diff.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think considering that optimization as a follow on is a good idea.

@alamb
Copy link
Contributor

alamb commented Mar 10, 2026

Checking this PR out now

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Dandandan -- I think this looks great to me. I had some stylistic comments, but otherwise it is good to me

I think we should leave this PR open for at least another day in case anyone else would like to comment.

For anyone else reviewing this PR, the ParquetStreamDecoder that is currently used in DataFusion is just a wrapper over the ParquetPushDecoder so as @Dandandan I don't expect this to do anything except make it easier to control the decoding process more carefully in DataFusion

It would also be nice to move the bloom filter handling upstream to avoid having to use the ParquetStreamBuilder . I'll try and file a ticket upstream before we merge this one

)?,
);
let mut bf_builder =
ParquetRecordBatchStreamBuilder::new_with_metadata(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is unfortunate that we need to create a new builder simply to read out the bloom filters (seems like because prune_by_bloom_filters calls ParquetRecordBatchStreamBuilder::get_row_group_column_bloom_filter

It seems like maybe upstream we should move the bloom filter reading into the ParquetMetadataDecoder 🤔 (as a follow on PR / cleanup)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out @ethe filed a very similar request here already:

@Dandandan
Copy link
Contributor Author

I addressed the feedback, will merge tomorrow if no new comments.

@comphead
Copy link
Contributor

@mbutrovich FYI

@comphead
Copy link
Contributor

Thanks @Dandandan just yesterday I was looking into datafusion parquet reads takes more memory comparing to jvm+native and came to some hotspots, one of them as you mentioned in get_byte_ranges

let me try to run my test case with this PR and see benefits

@Dandandan
Copy link
Contributor Author

Dandandan commented Mar 10, 2026

Thanks @Dandandan just yesterday I was looking into datafusion parquet reads takes more memory comparing to jvm+native and came to some hotspots, one of them as you mentioned in get_byte_ranges

let me try to run my test case with this PR and see benefits

In theory this change shouldn't change anything currently (pure refactoring to allow for future improvements), do you think it does?

When running locally, I found we can make some queries a bit faster by coalescing adjacent ranges (this happens sometimes and saves IO requests / syscalls (and also combines a few allocations, but the latter effect will be small I think)), but left this for a future PR.

Are you aware get_byte_ranges uses spawn_blocking for launching IO locally? If you have e.g. places driving the IO, this can start a lot of threads (and thus extra memory as well).

@Dandandan
Copy link
Contributor Author

Dandandan commented Mar 10, 2026

run benchmark clickbench_partitioned tpch tpcds

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing poc_push_decoder (853d1db) to fd97799 diff using: clickbench_partitioned
Results will be posted here when complete

@comphead
Copy link
Contributor

For anyone else reviewing this PR, the ParquetStreamDecoder that is currently used in DataFusion is just a wrapper over the ParquetPushDecoder so as @Dandandan I don't expect this to do anything except make it easier to control the decoding process more carefully in DataFusion

Right, seems seeing the decoder currently being called

image

In theory this change shouldn't change anything currently (pure refactoring to allow for future improvements), do you think it does?

Initially I hoped the PR addresses some memory concerns we currently see 😄

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and poc_push_decoder
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ poc_push_decoder ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │     2.54 ms │          2.61 ms │     no change │
│ QQuery 1  │    47.79 ms │         48.11 ms │     no change │
│ QQuery 2  │   151.02 ms │        153.97 ms │     no change │
│ QQuery 3  │   156.00 ms │        158.13 ms │     no change │
│ QQuery 4  │   930.82 ms │        984.87 ms │  1.06x slower │
│ QQuery 5  │  1211.06 ms │       1211.62 ms │     no change │
│ QQuery 6  │     6.22 ms │          6.06 ms │     no change │
│ QQuery 7  │    52.35 ms │         51.69 ms │     no change │
│ QQuery 8  │  1304.67 ms │       1354.58 ms │     no change │
│ QQuery 9  │  1690.09 ms │       1757.75 ms │     no change │
│ QQuery 10 │   326.55 ms │        317.38 ms │     no change │
│ QQuery 11 │   379.14 ms │        364.38 ms │     no change │
│ QQuery 12 │  1122.55 ms │       1138.59 ms │     no change │
│ QQuery 13 │  1782.81 ms │       1768.58 ms │     no change │
│ QQuery 14 │  1141.26 ms │       1175.91 ms │     no change │
│ QQuery 15 │  1121.79 ms │       1128.40 ms │     no change │
│ QQuery 16 │  2307.04 ms │       2346.83 ms │     no change │
│ QQuery 17 │  2295.98 ms │       2344.39 ms │     no change │
│ QQuery 18 │  5214.04 ms │       4470.04 ms │ +1.17x faster │
│ QQuery 19 │   125.23 ms │        118.30 ms │ +1.06x faster │
│ QQuery 20 │  1877.15 ms │       1853.72 ms │     no change │
│ QQuery 21 │  2097.60 ms │       2077.54 ms │     no change │
│ QQuery 22 │  3543.58 ms │       3555.23 ms │     no change │
│ QQuery 23 │ 11506.72 ms │      11157.78 ms │     no change │
│ QQuery 24 │   188.40 ms │        175.74 ms │ +1.07x faster │
│ QQuery 25 │   427.01 ms │        420.25 ms │     no change │
│ QQuery 26 │   206.34 ms │        198.54 ms │     no change │
│ QQuery 27 │  2690.25 ms │       2579.39 ms │     no change │
│ QQuery 28 │ 23228.03 ms │      21446.76 ms │ +1.08x faster │
│ QQuery 29 │   951.91 ms │        962.90 ms │     no change │
│ QQuery 30 │  1202.43 ms │       1278.76 ms │  1.06x slower │
│ QQuery 31 │  1237.45 ms │       1251.59 ms │     no change │
│ QQuery 32 │  4315.82 ms │       4212.54 ms │     no change │
│ QQuery 33 │  5318.25 ms │       5191.46 ms │     no change │
│ QQuery 34 │  5837.58 ms │       5601.55 ms │     no change │
│ QQuery 35 │  1087.84 ms │       1112.71 ms │     no change │
│ QQuery 36 │   180.13 ms │        185.78 ms │     no change │
│ QQuery 37 │    71.75 ms │         69.17 ms │     no change │
│ QQuery 38 │   110.76 ms │        111.71 ms │     no change │
│ QQuery 39 │   349.18 ms │        332.99 ms │     no change │
│ QQuery 40 │    38.44 ms │         40.04 ms │     no change │
│ QQuery 41 │    33.55 ms │         33.21 ms │     no change │
│ QQuery 42 │    28.90 ms │         31.16 ms │  1.08x slower │
└───────────┴─────────────┴──────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary               ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)               │ 87898.01ms │
│ Total Time (poc_push_decoder)   │ 84782.70ms │
│ Average Time (HEAD)             │  2044.14ms │
│ Average Time (poc_push_decoder) │  1971.69ms │
│ Queries Faster                  │          4 │
│ Queries Slower                  │          3 │
│ Queries with No Change          │         36 │
│ Queries with Failure            │          0 │
└─────────────────────────────────┴────────────┘

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing poc_push_decoder (853d1db) to fd97799 diff using: tpch
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and poc_push_decoder
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Query     ┃      HEAD ┃ poc_push_decoder ┃    Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ QQuery 1  │ 176.51 ms │        172.43 ms │ no change │
│ QQuery 2  │  81.91 ms │         83.99 ms │ no change │
│ QQuery 3  │ 117.86 ms │        114.87 ms │ no change │
│ QQuery 4  │  74.21 ms │         72.86 ms │ no change │
│ QQuery 5  │ 158.73 ms │        158.31 ms │ no change │
│ QQuery 6  │  64.37 ms │         64.81 ms │ no change │
│ QQuery 7  │ 194.32 ms │        191.58 ms │ no change │
│ QQuery 8  │ 156.58 ms │        157.63 ms │ no change │
│ QQuery 9  │ 221.76 ms │        212.05 ms │ no change │
│ QQuery 10 │ 177.59 ms │        173.75 ms │ no change │
│ QQuery 11 │  61.97 ms │         60.48 ms │ no change │
│ QQuery 12 │ 116.55 ms │        111.49 ms │ no change │
│ QQuery 13 │ 223.41 ms │        219.14 ms │ no change │
│ QQuery 14 │  83.47 ms │         84.13 ms │ no change │
│ QQuery 15 │ 120.41 ms │        120.21 ms │ no change │
│ QQuery 16 │  56.49 ms │         58.32 ms │ no change │
│ QQuery 17 │ 253.61 ms │        249.22 ms │ no change │
│ QQuery 18 │ 302.19 ms │        296.83 ms │ no change │
│ QQuery 19 │ 127.03 ms │        121.98 ms │ no change │
│ QQuery 20 │ 124.65 ms │        124.04 ms │ no change │
│ QQuery 21 │ 245.65 ms │        243.18 ms │ no change │
│ QQuery 22 │  39.39 ms │         39.96 ms │ no change │
└───────────┴───────────┴──────────────────┴───────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary               ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)               │ 3178.67ms │
│ Total Time (poc_push_decoder)   │ 3131.25ms │
│ Average Time (HEAD)             │  144.48ms │
│ Average Time (poc_push_decoder) │  142.33ms │
│ Queries Faster                  │         0 │
│ Queries Slower                  │         0 │
│ Queries with No Change          │        22 │
│ Queries with Failure            │         0 │
└─────────────────────────────────┴───────────┘

@alamb-ghbot
Copy link

🤖 ./gh_compare_branch.sh gh_compare_branch.sh Running
Linux aal-dev 6.14.0-1018-gcp #19~24.04.1-Ubuntu SMP Wed Sep 24 23:23:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Comparing poc_push_decoder (853d1db) to fd97799 diff using: tpcds
Results will be posted here when complete

@alamb-ghbot
Copy link

🤖: Benchmark completed

Details

Comparing HEAD and poc_push_decoder
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃        HEAD ┃ poc_push_decoder ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │    72.78 ms │         68.28 ms │ +1.07x faster │
│ QQuery 2  │   248.41 ms │        231.35 ms │ +1.07x faster │
│ QQuery 3  │   153.73 ms │        147.85 ms │     no change │
│ QQuery 4  │  1877.67 ms │       1813.90 ms │     no change │
│ QQuery 5  │   255.36 ms │        250.45 ms │     no change │
│ QQuery 6  │  1440.33 ms │       1433.08 ms │     no change │
│ QQuery 7  │   486.53 ms │        487.53 ms │     no change │
│ QQuery 8  │   166.96 ms │        162.10 ms │     no change │
│ QQuery 9  │   270.52 ms │        284.31 ms │  1.05x slower │
│ QQuery 10 │   164.67 ms │        154.60 ms │ +1.07x faster │
│ QQuery 11 │  1258.78 ms │       1219.81 ms │     no change │
│ QQuery 12 │    63.46 ms │         62.42 ms │     no change │
│ QQuery 13 │   532.53 ms │        514.62 ms │     no change │
│ QQuery 14 │  1819.37 ms │       1826.00 ms │     no change │
│ QQuery 15 │    27.36 ms │         27.28 ms │     no change │
│ QQuery 16 │    62.83 ms │         62.07 ms │     no change │
│ QQuery 17 │   345.51 ms │        335.00 ms │     no change │
│ QQuery 18 │   192.31 ms │        178.86 ms │ +1.08x faster │
│ QQuery 19 │   209.05 ms │        204.37 ms │     no change │
│ QQuery 20 │    23.60 ms │         23.09 ms │     no change │
│ QQuery 21 │    35.04 ms │         34.73 ms │     no change │
│ QQuery 22 │   712.97 ms │        711.80 ms │     no change │
│ QQuery 23 │  1765.76 ms │       1754.78 ms │     no change │
│ QQuery 24 │   643.99 ms │        638.22 ms │     no change │
│ QQuery 25 │   501.32 ms │        491.63 ms │     no change │
│ QQuery 26 │   120.53 ms │        119.15 ms │     no change │
│ QQuery 27 │   492.20 ms │        483.51 ms │     no change │
│ QQuery 28 │   288.64 ms │        292.13 ms │     no change │
│ QQuery 29 │   431.91 ms │        422.35 ms │     no change │
│ QQuery 30 │    71.99 ms │         69.94 ms │     no change │
│ QQuery 31 │   292.50 ms │        282.21 ms │     no change │
│ QQuery 32 │    81.15 ms │         79.21 ms │     no change │
│ QQuery 33 │   204.74 ms │        197.67 ms │     no change │
│ QQuery 34 │   150.97 ms │        144.42 ms │     no change │
│ QQuery 35 │   167.25 ms │        161.56 ms │     no change │
│ QQuery 36 │   280.35 ms │        280.83 ms │     no change │
│ QQuery 37 │   242.84 ms │        242.61 ms │     no change │
│ QQuery 38 │   147.33 ms │        142.03 ms │     no change │
│ QQuery 39 │   194.45 ms │        187.67 ms │     no change │
│ QQuery 40 │   177.11 ms │        171.97 ms │     no change │
│ QQuery 41 │    26.27 ms │         26.16 ms │     no change │
│ QQuery 42 │   144.52 ms │        139.40 ms │     no change │
│ QQuery 43 │   123.27 ms │        119.41 ms │     no change │
│ QQuery 44 │    27.81 ms │         27.98 ms │     no change │
│ QQuery 45 │    85.82 ms │         83.45 ms │     no change │
│ QQuery 46 │   312.06 ms │        300.65 ms │     no change │
│ QQuery 47 │   981.68 ms │        961.36 ms │     no change │
│ QQuery 48 │   392.86 ms │        387.09 ms │     no change │
│ QQuery 49 │   355.61 ms │        355.81 ms │     no change │
│ QQuery 50 │   330.15 ms │        325.51 ms │     no change │
│ QQuery 51 │   299.22 ms │        290.83 ms │     no change │
│ QQuery 52 │   145.62 ms │        139.88 ms │     no change │
│ QQuery 53 │   141.69 ms │        138.69 ms │     no change │
│ QQuery 54 │   200.16 ms │        194.83 ms │     no change │
│ QQuery 55 │   143.05 ms │        139.13 ms │     no change │
│ QQuery 56 │   203.38 ms │        200.10 ms │     no change │
│ QQuery 57 │   279.20 ms │        276.81 ms │     no change │
│ QQuery 58 │   480.19 ms │        480.32 ms │     no change │
│ QQuery 59 │   330.86 ms │        311.70 ms │ +1.06x faster │
│ QQuery 60 │   209.27 ms │        202.92 ms │     no change │
│ QQuery 61 │   238.03 ms │        232.35 ms │     no change │
│ QQuery 62 │  1338.52 ms │       1375.05 ms │     no change │
│ QQuery 63 │   143.74 ms │        137.56 ms │     no change │
│ QQuery 64 │  1097.54 ms │       1083.41 ms │     no change │
│ QQuery 65 │   342.68 ms │        339.12 ms │     no change │
│ QQuery 66 │   393.91 ms │        365.50 ms │ +1.08x faster │
│ QQuery 67 │   525.26 ms │        513.01 ms │     no change │
│ QQuery 68 │   368.75 ms │        355.30 ms │     no change │
│ QQuery 69 │   159.51 ms │        149.12 ms │ +1.07x faster │
│ QQuery 70 │   482.66 ms │        479.05 ms │     no change │
│ QQuery 71 │   181.03 ms │        176.43 ms │     no change │
│ QQuery 72 │  1991.67 ms │       2009.64 ms │     no change │
│ QQuery 73 │   145.76 ms │        141.44 ms │     no change │
│ QQuery 74 │   785.57 ms │        756.67 ms │     no change │
│ QQuery 75 │   403.09 ms │        393.32 ms │     no change │
│ QQuery 76 │   176.23 ms │        176.49 ms │     no change │
│ QQuery 77 │   273.15 ms │        271.92 ms │     no change │
│ QQuery 78 │   581.14 ms │        569.50 ms │     no change │
│ QQuery 79 │   312.32 ms │        303.95 ms │     no change │
│ QQuery 80 │   492.55 ms │        485.91 ms │     no change │
│ QQuery 81 │    52.04 ms │         51.01 ms │     no change │
│ QQuery 82 │   267.46 ms │        263.16 ms │     no change │
│ QQuery 83 │    72.02 ms │         72.88 ms │     no change │
│ QQuery 84 │    67.08 ms │         62.40 ms │ +1.07x faster │
│ QQuery 85 │   206.02 ms │        197.44 ms │     no change │
│ QQuery 86 │    56.20 ms │         55.95 ms │     no change │
│ QQuery 87 │   146.93 ms │        143.53 ms │     no change │
│ QQuery 88 │   239.91 ms │        233.88 ms │     no change │
│ QQuery 89 │   157.71 ms │        157.17 ms │     no change │
│ QQuery 90 │    43.82 ms │         42.69 ms │     no change │
│ QQuery 91 │    94.57 ms │         89.44 ms │ +1.06x faster │
│ QQuery 92 │    80.18 ms │         79.13 ms │     no change │
│ QQuery 93 │   273.32 ms │        270.24 ms │     no change │
│ QQuery 94 │    88.78 ms │         87.38 ms │     no change │
│ QQuery 95 │   240.62 ms │        236.25 ms │     no change │
│ QQuery 96 │   108.12 ms │        104.38 ms │     no change │
│ QQuery 97 │   187.33 ms │        181.26 ms │     no change │
│ QQuery 98 │   203.75 ms │        196.85 ms │     no change │
│ QQuery 99 │ 15757.44 ms │      15995.23 ms │     no change │
└───────────┴─────────────┴──────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary               ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)               │ 50663.94ms │
│ Total Time (poc_push_decoder)   │ 50332.38ms │
│ Average Time (HEAD)             │   511.76ms │
│ Average Time (poc_push_decoder) │   508.41ms │
│ Queries Faster                  │          9 │
│ Queries Slower                  │          1 │
│ Queries with No Change          │         89 │
│ Queries with Failure            │          0 │
└─────────────────────────────────┴────────────┘

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Dandandan

@Dandandan
Copy link
Contributor Author

Thanks for the reviews!

@alamb
Copy link
Contributor

alamb commented Mar 11, 2026

Thanks @Dandandan just yesterday I was looking into datafusion parquet reads takes more memory comparing to jvm+native and came to some hotspots, one of them as you mentioned in get_byte_ranges

I think some of the changes we are planning with "Morsels" may make it easier to control memory usage (e.g. not buffer entire row groups). However, I don't have a concrete example to show yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasource Changes to the datasource crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite ParquetOpener using ParquetPushDecoder

4 participants