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

fix(iceberg): fix iceberg predicate pushdown #20571

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

chenzl25
Copy link
Contributor

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

Comment on lines -87 to +88
ScalarImpl::Timestamp(t) => Some(IcebergDatum::timestamp_nanos(
t.0.and_utc().timestamp_nanos_opt()?,
ScalarImpl::Timestamp(t) => Some(IcebergDatum::timestamp_micros(
t.0.and_utc().timestamp_micros(),
Copy link
Member

Choose a reason for hiding this comment

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

Are we fixing a different bug here? And do we have a test covering this branch 🤪

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just found that timestamp is microsecond precision for both risingwave and iceberg 😆

Copy link
Member

Choose a reason for hiding this comment

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

date <= DATE '2025-02-10' - interval '5' day

So the right side changes from timestamp_nanos to timestamp_micros.
And then will we pushdown or not predicate for it after the PR?

I don't fully get the reason of the type change here. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even though iceberg-rs has already handled it well.

Copy link
Contributor Author

@chenzl25 chenzl25 Feb 21, 2025

Choose a reason for hiding this comment

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

date <= DATE '2025-02-10' - interval '5' day

We won't push down this predicate because the lhs with data type date and the rhs is timestamp.
We can push down the predicate if we change it to date <= (DATE '2025-02-10' - interval '5' day)::date

Copy link
Member

Choose a reason for hiding this comment

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

Just found that timestamp is microsecond precision for both risingwave and iceberg 😆

I found iceberg has a timestamp_ns type. And we've supported to convert it to RisingWave timestamp in #19221

So it seems using either one is ok here...? 🤔

Copy link
Contributor Author

@chenzl25 chenzl25 Feb 22, 2025

Choose a reason for hiding this comment

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

We can support timestamp_ns after this PR #20192

@chenzl25 chenzl25 added this pull request to the merge queue Feb 21, 2025
Merged via the queue into main with commit e202dac Feb 21, 2025
45 of 46 checks passed
@chenzl25 chenzl25 deleted the dyaln/fix_iceberg_predicate_push_down branch February 21, 2025 16:27
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.

BUG: Unable to convert timestamp_ns to date in iceberg table
3 participants