JingsongLi opened a new pull request, #1187: URL: https://github.com/apache/paimon-rust/pull/1187
### Purpose Support independent copies of streaming scan progress and configuration, including the standard Python `copy.copy(scan)` protocol. The PyPaimon Native bridge decodes a Rust plan into its public split objects. When that conversion fails, restoring only the next snapshot ID leaves the Rust watermark and other scan state advanced. A later empty poll can then expose the failed frame's watermark. Copying the complete state before conversion allows the bridge to restore the original scan without changing Java-compatible `restore(next_snapshot_id)` semantics, filtering watermark values, or performing additional metadata reads. ### Changes * Implement `Clone` for Core `StreamTableScan`, preserving independent cursor, watermark, consumer configuration, restored state and missing-snapshot polling counters. * Implement Python `StreamTableScan.__copy__` and update the stub. The copy owns separate bucket-filter callback state and Python references, with a rebuilt Core callback closure. Each wrapper traverses exactly its own references for GC. * Reuse the existing filter installation logic. Callback replacement and clearing release Python references outside the state lock, and callbacks run without holding that lock. * Add behavior tests for independent progress, configuration, consumer acknowledgements, callback ownership, exception identity and GC cycles. No new runtime dependencies or changes to checkpoint/restore/consumer acknowledgement semantics. This supports the Native execution alignment in apache/paimon#10712. ### Verification * Core clone regression: **1 passed**, using a real memory table and independent checkpoint/watermark/filter/consumer operations. * Rust 1.98.0 `cargo check --locked -p pypaimon_rust --tests` passed. * Rust 1.98.0 Clippy with `-D warnings` passed for Python bindings/tests and the Core stream test target; workspace formatting and diff checks passed. * The companion Python changes passed **358 tests, 11 skipped**, including exact rollback cases for waiting polls, irrelevant snapshots and valid empty snapshots with the same watermark. * Independent review checked callback reference ownership, GC traversal, reentry and full scan-state restoration. * No Python extension was rebuilt or installed locally. The six new binding integration tests require the PR's extension in CI; the existing local extension predates this API. -- 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]
