You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
query: preserve SDK error code and message in lancedb_query_result_to_arrow #122
In src/query.rs (lancedb_query_result_to_arrow), when result_box.inner.try_collect().await fails while draining the SendableRecordBatchStream, the error is discarded and replaced with LanceDBError::Unknown and a generic unknown-error message:
By contrast, lancedb_query_result_to_ipc_file in the same file properly forwards stream errors through handle_error(&error, error_message), preserving both the mapped LanceDBError code and the underlying SDK error message.
Proposed Fix
Route the stream collection error in lancedb_query_result_to_arrow through handle_error(&error, error_message) instead of collapsing it to LanceDBError::Unknown.
Clear *error_message on entry (consistent with lancedb_query_result_to_ipc_file) and ensure *batches_out, *schema_out, and *count_out are left in a well-defined empty/null state on error.
Route Arrow schema FFI conversion errors to LanceDBError::Arrow (or keep explicit error detail) rather than LanceDBError::Unknown.
Non-Goals
Changing the signature or ownership contract of lancedb_query_result_to_arrow (the result handle remains consumed on all non-null paths).
Adding streaming Arrow C Data Stream (ArrowArrayStream) support (tracked separately).
Acceptance Criteria
Failing stream execution in lancedb_query_result_to_arrow returns the SDK-mapped LanceDBError code and detailed error message via handle_error.
Catch2 C++ test verifies that a query failing during stream execution returns the expected non-LANCEDB_UNKNOWN error code and a descriptive error message, with no memory leaks under valgrind.
lancedb_query_result_to_arrow now forwards the SDK-mapped error code and diagnostic, clears outputs, and reports Arrow schema conversion failures as LANCEDB_ARROW. A C++ regression test exercises a cast failure while draining a query stream and verifies LANCEDB_LANCE, the cast diagnostic, and cleared outputs.
Activity
query: preserve SDK errors in lancedb_query_result_to_arrow (#136)
Xuanwo commentedon Dec 1, 2026
Fixed on
mainvia #136 (f28249c9).lancedb_query_result_to_arrownow forwards the SDK-mapped error code and diagnostic, clears outputs, and reports Arrow schema conversion failures asLANCEDB_ARROW. A C++ regression test exercises a cast failure while draining a query stream and verifiesLANCEDB_LANCE, the cast diagnostic, and cleared outputs.Verified on
mainby the passing Valgrind-enabled Ubuntu query suite. Closing as fixed.