Skip to content

feat: DH-21522: allow column region optimizations in Predicate Pushdown filtering#7666

Merged
lbooker42 merged 45 commits intodeephaven:mainfrom
lbooker42:nightly/DH-21522-parquettablelocation
Apr 25, 2026
Merged

feat: DH-21522: allow column region optimizations in Predicate Pushdown filtering#7666
lbooker42 merged 45 commits intodeephaven:mainfrom
lbooker42:nightly/DH-21522-parquettablelocation

Conversation

@lbooker42
Copy link
Copy Markdown
Contributor

@lbooker42 lbooker42 commented Feb 10, 2026

This PR refactors predicate pushdown filtering for regioned column sources to support both table-location and per-column-region optimizations, enabling more granular (region-level) pushdown planning and execution.

Changes:

  • Introduces a new RegionedPushdownAction model (Location vs Region actions) and new regioned pushdown filter context types.
  • Updates regioned pushdown execution to run per-region and merge results, enabling column-region pushdown participation.
  • Refactors ParquetTableLocation pushdown logic from an internal enum to the new action-based API and updates the engine interfaces accordingly.

Code Coverage Summary:

  • ImmutableConstant[Type]Source
    • makePushdownFilterContext / estimatePushdownFilterCost at 100%
    • pushdownFilter effectively 100% (empty selection detection not tested, might not be reachable without dedicated test)

@lbooker42 lbooker42 marked this pull request as draft February 10, 2026 18:02
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 10, 2026

No docs changes detected for 9fe11c9

@lbooker42 lbooker42 changed the title Nightly/dh 21522 parquettablelocation DH-21522: allow column region optimizations in Predicate Pushdown filtering Feb 10, 2026
@lbooker42 lbooker42 requested a review from Copilot February 10, 2026 18:03
@lbooker42 lbooker42 self-assigned this Feb 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors predicate pushdown filtering for regioned column sources to support both table-location and per-column-region optimizations, enabling more granular (region-level) pushdown planning and execution.

Changes:

  • Introduces a new RegionedPushdownAction model (Location vs Region actions) and new regioned pushdown filter context types.
  • Updates regioned pushdown execution to run per-region and merge results, enabling column-region pushdown participation.
  • Refactors ParquetTableLocation pushdown logic from an internal enum to the new action-based API and updates the engine interfaces accordingly.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
extensions/parquet/table/src/test/java/io/deephaven/parquet/table/location/ParquetTableLocationTest.java Removes the prior unit test that validated pushdown mode cost ordering.
extensions/parquet/table/src/main/java/io/deephaven/parquet/table/location/ParquetTableLocation.java Implements location-level supported actions and action contexts for parquet pushdown planning/execution.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/regioned/RegionedPushdownHelper.java Adds shared utilities for region-thread context and combining per-region pushdown results.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/regioned/RegionedPushdownFilterMatcher.java Introduces the regioned action-based pushdown matcher API.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/regioned/RegionedPushdownFilterContext.java Adds a regioned pushdown context carrying column definitions + rename mappings.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/regioned/RegionedPushdownFilterLocationContext.java Extends the regioned context with access to the current table location.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/regioned/RegionedPushdownAction.java Defines the new pushdown action abstraction (Location/Region) and related context interfaces.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/regioned/RegionedColumnSourceManager.java Refactors manager-level pushdown scheduling/merging and exposes internals needed for region pushdown.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/regioned/RegionedColumnSourceBase.java Refactors regioned column source pushdown to operate directly on regions with location-aware contexts.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/regioned/GenericColumnRegionBase.java Adds default region-level pushdown orchestration combining region + location actions by cost.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/regioned/ColumnRegion.java Makes column regions pushdown-capable via RegionedPushdownFilterMatcher.
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/UnionSourceManager.java Updates to use the new BasePushdownFilterContext#filter() accessor.
engine/table/src/main/java/io/deephaven/engine/table/impl/locations/impl/AbstractTableLocation.java Adds default action-based pushdown planning/execution for table locations.
engine/table/src/main/java/io/deephaven/engine/table/impl/locations/TableLocation.java Switches TableLocation to the new RegionedPushdownFilterMatcher API.
engine/table/src/main/java/io/deephaven/engine/table/impl/PushdownResult.java Adds a new cost constant for region-level single-value optimizations.
engine/table/src/main/java/io/deephaven/engine/table/impl/PushdownFilterMatcher.java Provides default implementations for pushdown matcher methods.
engine/table/src/main/java/io/deephaven/engine/table/impl/BasePushdownFilterContext.java Makes the base context abstract and introduces filter() accessor (encapsulation change).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lbooker42 lbooker42 changed the title DH-21522: allow column region optimizations in Predicate Pushdown filtering feat: DH-21522: allow column region optimizations in Predicate Pushdown filtering Feb 24, 2026
@lbooker42 lbooker42 marked this pull request as ready for review February 24, 2026 23:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 64 out of 64 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

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

Shipping comments and partial review.

Comment thread engine/table/src/main/java/io/deephaven/engine/table/impl/PushdownResult.java Outdated
Comment thread engine/table/src/main/java/io/deephaven/engine/table/impl/PushdownResult.java Outdated
Comment thread engine/table/src/main/java/io/deephaven/engine/table/impl/PushdownResult.java Outdated
Copy link
Copy Markdown
Contributor

@cpwright cpwright left a comment

Choose a reason for hiding this comment

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

placeholder

Copy link
Copy Markdown
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

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

Finished full pass.

Comment thread engine/table/src/main/java/io/deephaven/engine/table/impl/PushdownResult.java Outdated
Comment thread engine/table/src/main/java/io/deephaven/engine/table/impl/PushdownResult.java Outdated
Comment thread engine/table/src/main/java/io/deephaven/engine/table/impl/PushdownResult.java Outdated

private static final RegionedPushdownAction.Location ParquetRowGroupMetadata =
new RegionedPushdownAction.Location(
() -> QueryTable.DISABLE_WHERE_PUSHDOWN_PARQUET_ROW_GROUP_METADATA,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feels weird to centralize something that mentions Parquet on QueryTable.

…ation' into nightly/DH-21522-parquettablelocation

# Conflicts:
#	engine/table/src/main/java/io/deephaven/engine/table/impl/PushdownResult.java
Copy link
Copy Markdown
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

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

.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 94 out of 94 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

final long regionFirstIncludedKey = maybeIt.peekNextKey();
final REGION_TYPE region = pageStore.lookupRegion(regionFirstIncludedKey);
final RowSequence regionRows = maybeIt.getNextRowSequenceThrough(region.maxRow(regionFirstIncludedKey));
final long regionFirstKey = regionFirstIncludedKey & pageStore.mask();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm pretty sure this is wrong. I think you should use io.deephaven.engine.page.Page#firstRow, as in final long regionFirstKey = region.firstRow(regionFirstIncludedKey);. I think you're getting the last possible row key, not the first.

@lbooker42 lbooker42 merged commit 90c5d1f into deephaven:main Apr 25, 2026
24 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants