[rust] support paimon key encoder.#579
Conversation
55a190f to
c9f2df8
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds Paimon (BinaryRow-based) key encoding support to the Rust client and wires it into KV upsert/lookup/prefix-lookup paths, enabling the client to interoperate with Paimon-backed KV tables and newer key-encoding expectations.
Changes:
- Implement Paimon BinaryRow writer + Paimon key encoder and integrate into
KeyEncoderFactory. - Update KV upsert/lookup/prefix-lookup to select primary/bucket key encoders based on
kv_format_versionand bucket-key layout. - Extend supported RPC API versions for PutKv/Lookup/PrefixLookup and adjust integration tests to exercise Paimon encoding.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/fluss/tests/integration/kv_table.rs | Updates/extends KV integration tests to cover Paimon key encoding and prefix lookup. |
| crates/fluss/src/rpc/api_key.rs | Advertises v1 support for PutKv/Lookup/PrefixLookup API keys. |
| crates/fluss/src/row/paimon/paimon_binary_row_writer.rs | New Paimon BinaryRow writer implementation with unit tests. |
| crates/fluss/src/row/paimon/mod.rs | New module wiring for Paimon row utilities. |
| crates/fluss/src/row/mod.rs | Exposes the new row::paimon module. |
| crates/fluss/src/row/encode/paimon_key_encoder.rs | New Paimon key encoder implementation with unit tests. |
| crates/fluss/src/row/encode/mod.rs | Integrates PaimonKeyEncoder; adds primary/bucket key encoder selection helpers. |
| crates/fluss/src/metadata/table.rs | Adds TableConfig::get_kv_format_version() with defaulting behavior. |
| crates/fluss/src/client/table/upsert.rs | Uses kv_format_version + bucket-key layout to choose key encoders for writes. |
| crates/fluss/src/client/table/lookup.rs | Uses kv_format_version + bucket-key layout to choose key encoders for lookups and prefix lookups. |
| .run/Test.run.xml | Adds an IDE run configuration for integration tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e76e2fd to
4afae5e
Compare
4afae5e to
a760933
Compare
fresh-borzoni
left a comment
There was a problem hiding this comment.
@loserwang1024 Ty for the PR, LGTM 👍
| if Decimal::is_compact_precision(precision) { | ||
| // Compact: store unscaled long in the field slot (use write_long | ||
| // semantics but consume `current_pos` exactly once). | ||
| let unscaled = value.to_unscaled_long().unwrap_or(0); |
There was a problem hiding this comment.
nit: unwrap_or(0) silently writes 0 if the conversion ever fails.
In practice it can't for a valid compact decimal, so it's basically dead code, still it's usually better to fail loudly
Purpose
Linked issue: close #314
Brief change log
Tests
API and Format
Documentation