Skip to content

Conversation

@leekeiabstraction
Copy link
Contributor

Purpose

Linked issue: close #178

Brief change log

  • Add partitioning support in Upsert / Lookup
  • Add Integration test
  • Added example

@leekeiabstraction leekeiabstraction changed the title Kvpartition Implement partitioning in Upsert / Lookup Jan 28, 2026
@leekeiabstraction
Copy link
Contributor Author

@luoyuxia @fresh-borzoni

Would appreciate your reviews here. I will address the rebase conflict in follow up commits.

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 pull request implements partitioning support for Upsert and Lookup operations in the Fluss Rust client, addressing issue #178. The changes enable the client to handle partitioned tables, bringing it to feature parity with the Java implementation.

Changes:

  • Introduced PhysicalTablePath to represent table paths with optional partition information, replacing direct TablePath usage in write/lookup paths
  • Modified metadata structures to track partition information including partition IDs and names
  • Implemented PartitionGetter to extract partition information from rows based on partition keys
  • Updated Upsert and Lookup operations to handle partitioned tables by routing operations to the correct partition
  • Added comprehensive integration tests and example code for partitioned KV tables

Reviewed changes

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

Show a summary per file
File Description
crates/fluss/src/metadata/table.rs Changed partition_keys from Vec to Arc<[String]> for better sharing; added PhysicalTablePath support; fixed typo in panic message
crates/fluss/src/cluster/cluster.rs Added partition metadata tracking and processing; updated cluster to store partition IDs and locations
crates/fluss/src/client/write/*.rs Updated write path to use PhysicalTablePath; added partition ID handling in accumulator and sender
crates/fluss/src/client/table/upsert.rs Added partition extraction using PartitionGetter; updated to create correct PhysicalTablePath
crates/fluss/src/client/table/lookup.rs Added partition-aware lookup; handles non-existent partitions gracefully
crates/fluss/src/client/table/partition_getter.rs New module for extracting partition values from rows
crates/fluss/tests/integration/kv_table.rs Added comprehensive integration test for partitioned tables
crates/examples/src/example_partitioned_kv_table.rs Added example demonstrating partitioned table operations

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

@leekeiabstraction
Copy link
Contributor Author

Rebased and all 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 Thanks for the PR! Left comments. PTAL

// TODO: we shouldn't add unready partitions to unknownLeaderTables,
// because it cases PartitionNotExistException later
unknown_leader_tables.insert(physical_table_path);
return Ok(ReadyCheckResult::new(
Copy link
Contributor

Choose a reason for hiding this comment

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

why return? shouldn't we continue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is similar to Java flow: https://github.com/apache/fluss/blob/96faf08cbd84d1d43a2ef610c189829fa9c34e76/fluss-client/src/main/java/org/apache/fluss/client/write/RecordAccumulator.java#L463-L469

Returning is fine because sender.run_once() resolves the unknown table leader and on subsequent run, goes through this flow again.

@leekeiabstraction
Copy link
Contributor Author

leekeiabstraction commented Jan 29, 2026

Seems like we're running into timeouts on CI runs, this timeout doesn't happen on my machine for some reason. Debugging currently.

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.

Implement partitioning in Upsert / Lookup

2 participants