JingsongLi commented on code in PR #1518:
URL: https://github.com/apache/paimon-rust/pull/1518#discussion_r4678534612
##########
bindings/c/src/table.rs:
##########
@@ -1082,8 +1085,12 @@ pub unsafe extern "C" fn paimon_table_read_to_arrow(
table_read = table_read.with_resources(resources.clone());
}
+ let read_type = state.read_type.clone();
match table_read.to_arrow(selected) {
Ok(stream) => {
+ let stream = stream
+ .map(move |batch| variant::canonicalize_batch(batch?,
&read_type))
Review Comment:
**[P2] Preserve VARIANT nulls when materializing vector results**
Canonicalization runs only in `paimon_table_read_to_arrow`. The C vector
APIs materialize projected table columns through `materialize_search_result`
and export the resulting stream directly. I wrote a Parquet table with a legacy
empty-payload SQL NULL and a valid encoded variant null, then read both rows
through the two C entry points. The ordinary read returned validity flags
`[false, true]`; `paimon_vector_search_builder_execute_read` returned `[true,
true]` for the same rows. Apply the schema-driven normalization in vector
result materialization as well, using the projected Paimon fields and
preserving the score column.
--
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]