Repository navigation
Align Rust Arrow lifecycle with chdb-core rc.3 contract - #68
Merged
Merged
Conversation
Add an owned scoped registration for Arrow readers, preserve empty-result schemas and stream errors, and verify the loaded engine matches the fetched release. Cover cancellation, cleanup, and existing input/output paths.
Contributor
Author
|
@wudidapaopao, please review this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Compatibility
No existing Rust Arrow method signatures change. The scoped registration is additive; raw-pointer registration keeps its existing caller-managed lifetime preconditions. The default downloaded engine changes to rc.3 on new builds. This does not publish a new crate release.
Testing
libchdb.soexplicitly selected at runtime: 60 library tests, 6 Arrow insert, 11 Arrow query, 4 scoped registration, 3 Arrow stream roundtrip, and 5 version tests passed (89 total).cargo test --no-default-features --lib --offline -- --test-threads=1: 43 passed with the same runtime library.cargo fmt --check,sh .github/scripts/check-engine-pin.sh, andgit diff --check origin/main...HEADpassed.Linux and the other platform architectures were not run locally; CI should validate them. A first local run without an explicit macOS runtime library path loaded an older
26.7.3library despite linking against rc.3, which motivated the new version mismatch error. The results above used the rc.3 library and passed the version equality test.Note
Add scoped
ArrowRegistrationand align engine pin with chdb-core rc.3ArrowRegistration, a scoped handle that owns a boxedRecordBatchReaderand its FFI stream for the lifetime of a registration. It offersquery,query_arrow,query_stream_arrow,query_stream,sql_expr, and an explicitclose;Dropunregisters and leaks the stream if unregistration fails. Created via the newConnection::register_arrow_readerand re-exported at the crate root under thearrowfeatureArrowQueryStreamnow stores the fetched schema (exposed by a newschema()accessor), cancels the query on fetch or read errors, and treats a failed schema callback as EOF only when the next batch is empty with no stream errorfinish_registered_insert, so a failing insert reports the query error while also reporting a cleanup failure when both occurConnection::opennow callsverify_loaded_enginebefore connecting, erroring when the loaded library version differs fromEXPECTED_ENGINE_VERSION; the engine pin moves to v26.11.0-rc.3 across Cargo.toml, build.rs, and update_libchdb.shConnection::openwithInvalidData(see version.rs); streams that fail schema retrieval but still have data may now be classified as EOF only per the probe inis_eos_without_schema(arrow_query_stream.rs)Macroscope summarized 207f213.