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

feat(iceberg): add support for creating new iceberg tables with partition keys #20340

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

Conversation

jayakasadev
Copy link
Contributor

@jayakasadev jayakasadev commented Jan 29, 2025

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

What's changed and what's your intention?

  • add partition_by field to iceberg sink when creating new iceberg table
    • allow users to pass a list of fields or function wrapped fields (ie year(date_column))

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

@@ -1446,6 +1502,7 @@ mod test {
r#type: "upsert".to_owned(),
force_append_only: false,
primary_key: Some(vec!["v1".to_owned()]),
partition_by: Some(vec!["v1".to_owned(), "identity(v2)".to_owned()]),
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 we should test all partition cases here, e.g
v1, identity(v1), truncate(4,v2), bucket(5,v1), year(v3), month(v4), day(v5), hour(v6), void(v1)

let mut partition_fields =
Vec::<UnboundPartitionField>::with_capacity(partition_by.len());
for partition_field in partition_by {
let re = Regex::new(r"\w+(\(\w+\))?").unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

This Regex can be created outside the for loop. Also according to v1, identity(v1), truncate(4,v2), bucket(5,v1), year(v3), month(v4), day(v5), hour(v6), void(v1), maybe we can check the prefix first and capture the param according to different transform type

@jayakasadev jayakasadev requested a review from ZENOTME February 6, 2025 16:40
@jayakasadev jayakasadev force-pushed the add_iceberg_partitions branch from 1f0f0c5 to 65e01f0 Compare February 6, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants