AndreaBozzo commented on code in PR #159:
URL: https://github.com/apache/fluss-rust/pull/159#discussion_r2690994028


##########
crates/fluss/src/client/table/mod.rs:
##########
@@ -85,6 +86,88 @@ impl<'a> FlussTable<'a> {
     pub fn has_primary_key(&self) -> bool {
         self.has_primary_key
     }
+
+    /// Lookup values by primary key in a key-value table.
+    ///
+    /// This method performs a direct lookup to retrieve the value associated 
with the given key
+    /// in the specified bucket. The table must have a primary key (be a 
primary key table).
+    ///
+    /// # Arguments
+    /// * `bucket_id` - The bucket ID to look up the key in
+    /// * `key` - The encoded primary key bytes to look up
+    ///
+    /// # Returns
+    /// * `Ok(Some(Vec<u8>))` - The value bytes if the key exists
+    /// * `Ok(None)` - If the key does not exist
+    /// * `Err(Error)` - If the lookup fails or the table doesn't have a 
primary key
+    ///
+    /// # Example
+    /// ```ignore
+    /// let table = conn.get_table(&table_path).await?;
+    /// let key = /* encoded key bytes */;
+    /// if let Some(value) = table.lookup(0, key).await? {
+    ///     println!("Found value: {:?}", value);
+    /// }
+    /// ```
+    pub async fn lookup(&self, bucket_id: i32, key: Vec<u8>) -> 
Result<Option<Vec<u8>>> {

Review Comment:
   As they will be needed in the near future anyway, i'm ok with implementing 
them in this PR, i just wasnt sure if it could be out of scope/already worked 
on and kept it basic.
   
   I'm waiting on his call also on tests ( currently not added ) just to be 
sure we are all on the same page!
   
   Thanks for the review @leekeiabstraction 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to