Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable predicate batch_iceberg_predicate_pushdown #20058

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kwannoel
Copy link
Contributor

@kwannoel kwannoel commented Jan 7, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note

Copy link
Contributor Author

kwannoel commented Jan 7, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment on lines 40 to +41
fn apply(&self, plan: PlanRef) -> Option<PlanRef> {
let filter: &BatchFilter = plan.as_batch_filter()?;
let input = filter.input();
let scan: &BatchIcebergScan = input.as_batch_iceberg_scan()?;
// NOTE(kwannoel): We only fill iceberg predicate here.
assert_eq!(scan.predicate, IcebergPredicate::AlwaysTrue);

let predicate = filter.predicate().clone();
let (iceberg_predicate, rw_predicate) =
rw_predicate_to_iceberg_predicate(predicate, scan.schema().fields());
let scan = scan.clone_with_predicate(iceberg_predicate);
if rw_predicate.always_true() {
Some(scan.into())
} else {
let filter = filter
.clone_with_input(scan.into())
.clone_with_predicate(rw_predicate);
Some(filter.into())
}
Some(plan)
Copy link

Choose a reason for hiding this comment

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

The original code had an assertion that scan.predicate must be AlwaysTrue. By changing this function to simply return Some(plan), that assertion could be violated. Consider either removing the assertion if it's no longer needed, or adding validation to ensure scan.predicate remains AlwaysTrue when bypassing the transformation logic.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@kwannoel kwannoel force-pushed the 01-07-disable_predicate_batch_iceberg_predicate_pushdown branch from ebf92f1 to c85f07e Compare January 8, 2025 01:18
@kwannoel kwannoel force-pushed the kwannoel/iceberg-predicate-pushdown-perf branch from 08f770b to 7b260c9 Compare January 8, 2025 04:12
Base automatically changed from kwannoel/iceberg-predicate-pushdown-perf to main January 8, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant