Skip to content

Conversation

@AndreaBozzo
Copy link
Contributor

@AndreaBozzo AndreaBozzo commented Jan 14, 2026

Purpose

Linked issue: close #114

Implements lookup functionality to verify put kv operations. This follows the simple lookup approach as suggested in the issue comments (without complex batching/queuing).

Brief change log

  • Add Lookup API key (1017) to api_key.rs - matching Java Fluss ApiKeys.java
  • Add lookup proto messages (LookupRequest, LookupResponse, PbLookupReqForBucket, PbLookupRespForBucket, PbValue) to fluss_api.proto
  • Create lookup.rs message module with LookupRequest struct implementing RequestBody trait
  • Add async lookup(bucket_id, key) method to FlussTable that returns Option<Vec<u8>>

Reference Java implementation:

Tests

API and Format

Adds new public API:

  • FlussTable::lookup(bucket_id: i32, key: Vec<u8>) -> Result<Option<Vec<u8>>>

Documentation

No documentation changes required at this time.

Implements lookup functionality to verify put kv operations (Issue apache#114).

- Add Lookup API key (1017) to api_key.rs
- Add lookup proto messages (LookupRequest, LookupResponse, etc.)
- Create lookup.rs message module with LookupRequest
- Add async lookup() method to FlussTable
@AndreaBozzo
Copy link
Contributor Author

@luoyuxia good morning, i didn't know if u were already working on this, i'm sorry if its the case

@leekeiabstraction mr.lee as you are proficient in java and i'm not it would be really appreciated if you can check this out too

Have a nice day, open to feedbacks/changes

@AndreaBozzo AndreaBozzo marked this pull request as ready for review January 14, 2026 10:27
@luoyuxia luoyuxia requested a review from Copilot January 14, 2026 11:09
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 adds lookup functionality for primary key tables, enabling clients to retrieve values by key from key-value tables. The implementation follows the simple lookup approach without complex batching/queuing, mirroring the Java client implementation.

Changes:

  • Added Lookup API (key 1017) to support lookup operations
  • Implemented protobuf messages for lookup requests and responses
  • Added lookup() async method to FlussTable for key-value retrieval

Reviewed changes

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

Show a summary per file
File Description
crates/fluss/src/rpc/api_key.rs Added Lookup API key (1017) enum variant and conversions
crates/fluss/src/proto/fluss_api.proto Defined protobuf messages for lookup requests and responses
crates/fluss/src/rpc/message/lookup.rs Implemented LookupRequest struct with RequestBody trait
crates/fluss/src/rpc/message/mod.rs Added lookup module import and export
crates/fluss/src/client/table/mod.rs Added public lookup() method to FlussTable for key retrieval

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

}

message PbValue {
optional bytes values = 1;
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The field name 'values' (plural) is misleading since PbValue represents a single value. Consider renaming to 'value' (singular) for clarity.

Suggested change
optional bytes values = 1;
optional bytes value = 1;

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! I think while we do not need to implement queuing/batching, we should still have the abstraction/interfaces that users use consistent with the rest of the FlussTable function e.g. TableAppend, TableUpsert. These are public contract that would be difficult to change once released without breaking user's code.

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.

@AndreaBozzo Thanks for the pr. Just one comment to keep api align with java side.

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.

Support lookup

3 participants