Skip to content

Conversation

@leekeiabstraction
Copy link
Contributor

Purpose

Linked issue: close #209

Brief change log

  • Added PartitionGetter
  • Added Partition utils
  • PartitionNameConverter logics are rolled into Partition utils as they are not used by any other component
  • Added validation functions in TablePath

Tests

  • Added test cases that mirror Java side

@leekeiabstraction
Copy link
Contributor Author

@luoyuxia @fresh-borzoni Appreciate your reviews here

Copy link

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 introduces partition-related utilities for the Fluss Rust client, mirroring functionality from the Java implementation. It adds partition validation, auto-partition generation, and partition value conversion capabilities.

Changes:

  • Added PartitionGetter for extracting partition names/specs from rows
  • Added partition utilities including validation and auto-partition time generation
  • Added validation functions to TablePath for name and prefix checking
  • Added new InvalidPartition error variant

Reviewed changes

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

Show a summary per file
File Description
crates/fluss/src/util/partition.rs New file containing partition validation, auto-partition generation, and datum-to-string conversion utilities
crates/fluss/src/util/mod.rs Exports the new partition module
crates/fluss/src/metadata/table.rs Adds validation methods for table/partition names and prefixes
crates/fluss/src/error.rs Adds InvalidPartition error variant for partition-related errors
crates/fluss/src/client/table/partition_getter.rs Implements PartitionGetter to extract partition information from rows, with comprehensive test coverage

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

@leekeiabstraction
Copy link
Contributor Author

Copilot comments have been addressed

Copy link
Contributor

@fresh-borzoni fresh-borzoni left a comment

Choose a reason for hiding this comment

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

@leekeiabstraction Thank you for the PR.
Left comments. PTAL

@leekeiabstraction
Copy link
Contributor Author

@fresh-borzoni Thank you for great catches. I've updated the PR accordingly. PTAL!

Copy link
Contributor

@luoyuxia luoyuxia left a comment

Choose a reason for hiding this comment

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

@leekeiabstraction Thanks for the pr. Left some comments. PTAL

@leekeiabstraction
Copy link
Contributor Author

@luoyuxia @fresh-borzoni Thank you for your reviews. Addressed/answered comments. PTAL!

Copy link
Contributor

@fresh-borzoni fresh-borzoni left a comment

Choose a reason for hiding this comment

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

@leekeiabstraction Thanks for the PR. LGTM
Left comment for the discussion.

@leekeiabstraction
Copy link
Contributor Author

@luoyuxia @fresh-borzoni Thank you for the great comments. Addressed them. PTAL


fn get_reordered_partition_values(
partition_keys: &[String],
partition_keys: &Arc<[String]>,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:
mb just &[String]?
and pass partition_keys.as_ref()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's hold this off, it's hard-ish to tell what best arg type to use until everything is wired together. I might even remove this function in the final wiring PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

well, it's actually widening the accepted args.
I've approved PR before, so treat it as just discussion :)

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.

Introduce PartitionUtils, PartitionNameConverters and PartitionGetter

3 participants