You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "Arnav-panjla (via GitHub)" <gi...@apache.org> on 2025/12/23 20:00:19 UTC

[PR] [client] Return exception for partitioned tables in Rust client [fluss-rust]

Arnav-panjla opened a new pull request, #115:
URL: https://github.com/apache/fluss-rust/pull/115

   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   Linked issue: close #99 
   
   <!-- What is the purpose of the change -->
   The current Rust client does not handle partitioned tables. To prevent incorrect usage,
   this PR adds validation to return an `UnsupportedOperation` error when
   `new_append()` or `new_scan()` is called on a partitioned table.
   
   ### Brief change log
   
   <!-- Please describe the changes made in this pull request and explain how they address the issue -->
   
   - Added new `UnsupportedOperation` error variant in `crates/fluss/src/error.rs` to handle unsupported operations
   - Added partitioned table validation in `FlussTable::new_append()` - returns `UnsupportedOperation` error if the table is partitioned
   - Changed `FlussTable::new_scan()` return type from `TableScan` to `Result<TableScan>` and added partitioned table validation
   - Updated all call sites to handle the new `Result` return type:
     - `crates/examples/src/example_table.rs`
     - `crates/fluss/tests/integration/table.rs`
     - `crates/fluss/tests/integration/table_remote_scan.rs`
     - `bindings/python/src/table.rs`
     - `bindings/cpp/src/lib.rs`
   - Updated doc examples in `crates/fluss/src/client/table/scanner.rs`
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   - All existing unit tests pass (`cargo test --lib`)
   - Integration tests updated to handle the new return type
   - Verified with `cargo check`, `cargo clippy`, and `cargo fmt`
   
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   **API Change:** Yes
   - `FlussTable::new_scan()` return type changed from `TableScan<'_>` to `Result<TableScan<'_>>`
   - This is a breaking change for callers of `new_scan()`, but necessary to properly communicate the error condition
   
   **Storage Format:** No
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   
   No.


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [client] Return exception for partitioned tables in Rust client [fluss-rust]

Posted by "Arnav-panjla (via GitHub)" <gi...@apache.org>.
Arnav-panjla commented on code in PR #115:
URL: https://github.com/apache/fluss-rust/pull/115#discussion_r2646260945


##########
bindings/cpp/src/lib.rs:
##########
@@ -538,7 +542,10 @@ impl Table {
             self.table_info.clone(),
         );
 
-        let scan = fluss_table.new_scan();
+        let scan = match fluss_table.new_scan() {

Review Comment:
   Thanks for the suggestion! Updated the code



-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [client] Return exception for partitioned tables in Rust client [fluss-rust]

Posted by "Arnav-panjla (via GitHub)" <gi...@apache.org>.
Arnav-panjla commented on PR #115:
URL: https://github.com/apache/fluss-rust/pull/115#issuecomment-3706168524

   Thanks for the suggestion! 
   I’ll move the partitioned table validation to FlussConnection::get_table and simplify the downstream APIs accordingly.


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [client] Return exception for partitioned tables in Rust client [fluss-rust]

Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia merged PR #115:
URL: https://github.com/apache/fluss-rust/pull/115


-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [client] Return exception for partitioned tables in Rust client [fluss-rust]

Posted by "leekeiabstraction (via GitHub)" <gi...@apache.org>.
leekeiabstraction commented on code in PR #115:
URL: https://github.com/apache/fluss-rust/pull/115#discussion_r2645376656


##########
bindings/cpp/src/lib.rs:
##########
@@ -520,7 +520,11 @@ impl Table {
             self.table_info.clone(),
         );
 
-        let scanner = match fluss_table.new_scan().create_log_scanner() {
+        let scan = match fluss_table.new_scan() {
+            Ok(s) => s,
+            Err(e) => return Err(format!("Failed to create table scan: {e}")),
+        };
+        let scanner = match scan.create_log_scanner() {
             Ok(a) => a,
             Err(e) => return Err(format!("Failed to create log scanner: {e}")),
         };

Review Comment:
   nit: slightly less verbose approach
   ```
   let scan = fluss_table.new_scan()
       .map_err(|e| format!("Failed to create table scan: {e}"))?;
   
   let scanner = scan.create_log_scanner()
       .map_err(|e| format!("Failed to create log scanner: {e}"))?;
   ```



##########
bindings/cpp/src/lib.rs:
##########
@@ -538,7 +542,10 @@ impl Table {
             self.table_info.clone(),
         );
 
-        let scan = fluss_table.new_scan();
+        let scan = match fluss_table.new_scan() {

Review Comment:
   Similarly here.



-- 
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: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org