Repository navigation
query: preserve SDK errors in lancedb_query_result_to_arrow - #136
Merged
Merged
Conversation
Route stream collection failures through handle_error so the SDK error code and message reach C callers instead of LANCEDB_UNKNOWN. Report schema C ABI conversion failures as LANCEDB_ARROW with the conversion detail. Clear non-NULL output slots and the error message on entry. With all required output pointers valid, the result is consumed on every path; when a required output pointer is NULL, reject the call without consuming it so the caller can retry or free it. Publish batches, schema and count only after the complete result is ready. Add a Catch2 regression that drains a valid query whose cast fails during execution and checks the mapped error, detail and cleared outputs. Refs #122
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.
Problem
lancedb_query_result_to_arrowreplaced any error from draining the SDK stream withLANCEDB_UNKNOWN, losing the mapped code and the SDK diagnostic. It also published count and schema before the complete result was ready and left stale output slots or an error message in place.Behavior
handle_error, preserving the SDK error code and text.LANCEDB_ARROWwith the conversion detail.LANCEDB_INVALID_ARGUMENTwithout consuming a non-NULL result, so the caller can still retry it or free it. Empty successful results keep their legacy NULL batches/schema and zero count.Verification
cmake --build build --target lancedb_query_tests(Debug)./lancedb_query_tests— all 9 test cases and 20503 assertions passCAST(key AS INT)query and checksLANCEDB_LANCE, the cast diagnostic, and cleared outputs. Before this change the same query returnedLANCEDB_UNKNOWN.Refs #122