fresh-borzoni opened a new pull request, #239:
URL: https://github.com/apache/fluss-rust/pull/239

    ## Summary                                                                  
                                                                                
                                                                                
       
                                                                                
                                                                                
                                                                                
        
     Add KV table support (lookup/upsert/delete) to Python bindings.            
                                                                                
                                                                                
        
                                                                                
                                                                                
                                                                                
        
     ## Changes                                                                 
                                                                                
                                                                                
        
                                                                                
                                                                                
                                                                                
        
     ### Python Bindings                                                        
                                                                                
                                                                                
        
     - **`Lookuper`**: Point lookups by primary key with cached encoders        
                                                                                
                                                                                
        
     - **`UpsertWriter`**: Batched upsert/delete with explicit `flush()`        
                                                                                
                                                                                
        
       - Supports partial updates via `columns` or `column_indices` parameters  
                                                                                
                                                                                
        
     - **Rust → Python converters**: Date, Time, Timestamp, TimestampLtz, 
Decimal                                                                         
                                                                                
              
                                                                                
                                                                                
                                                                                
        
     ### Rust Core                                                              
                                                                                
                                                                                
        
     - Removed lifetime `'a` from `TableLookup`, `Lookuper`, `LookupResult`     
                                                                                
                                                                                
        
     - Changed `&'a FlussConnection` → `Arc<RpcClient>` (enables Python to 
store Lookuper)                                                                 
                                                                                
             
     - Added `Send + Sync` bounds to `KeyEncoder` and `RowEncoder` traits       
                                                                                
                                                                                
        
     - Fixed broken doctests in `scanner.rs`                                    
                                                                                
                                                                                
        
                                                                                
                                                                                
                                                                                
        
     ## Usage                                                                   
                                                                                
                                                                                
        
                                                                                
                                                                                
                                                                                
        
     ```python                                                                  
                                                                                
                                                                                
        
     # Lookup                                                                   
                                                                                
                                                                                
        
     lookuper = table.new_lookup()                                              
                                                                                
                                                                                
        
     result = lookuper.lookup({"user_id": 1})  # Returns dict or None           
                                                                                
                                                                                
        
                                                                                
                                                                                
                                                                                
        
     # Upsert with batching                                                     
                                                                                
                                                                                
        
     writer = table.new_upsert()                                                
                                                                                
                                                                                
        
     writer.upsert({"user_id": 1, "name": "Alice", ...})                        
                                                                                
                                                                                
        
     writer.upsert({"user_id": 2, "name": "Bob", ...})                          
                                                                                
                                                                                
        
     writer.delete({"user_id": 3})                                              
                                                                                
                                                                                
        
     writer.flush()  # Single batch RPC                                         
                                                                                
                                                                                
        
                                                                                
                                                                                
                                                                                
        
     # Partial update                                                           
                                                                                
                                                                                
        
     writer = table.new_upsert(columns=["user_id", "balance"])                  
                                                                                
                                                                                
        
     writer.upsert({"user_id": 1, "balance": Decimal("100.00")})                
                                                                                
                                                                                
        
     writer.flush()   
     ```         


-- 
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