peterxcli commented on code in PR #5552:
URL: https://github.com/apache/datafusion-comet/pull/5552#discussion_r3887290749
##########
native/core/src/execution/utils.rs:
##########
@@ -19,28 +19,45 @@
use crate::execution::operators::ExecutionError;
use arrow::{
array::ArrayData,
+ datatypes::Field,
+ error::ArrowError,
ffi::{FFI_ArrowArray, FFI_ArrowSchema},
};
+fn ffi_schema_for_field(field: &Field) -> Result<FFI_ArrowSchema, ArrowError> {
+ if field.name().contains('\0') {
+ // ArrowSchema names are NUL-terminated C strings. Spark owns the
logical output name, so
+ // substitute only the exported name while retaining the Field's type
and metadata.
+ let field = field
+ .clone()
+ .with_name(field.name().replace('\0', "\u{fffd}"));
+ FFI_ArrowSchema::try_from(&field)
+ } else {
+ FFI_ArrowSchema::try_from(field)
Review Comment:
Thanks, fixed in 7ef3bbd15. I kept complete Field export and added a strict
schema-equality guard before VectorSchemaRootAppender.append. If a decoded
broadcast batch has a different schema, including top-level nullability,
coalescing now closes the partial target and returns the original buffers
instead of weakening or rewriting the Field. I also added the exact
AQE-disabled Parquet/UNION/BROADCAST regression; it requires CometUnionExec and
CometBroadcastExchangeExec and asserts zero coalescing metrics. The focused
Spark 4.1 test passed (1 test), along with the Rust FFI test, Spotless, and git
diff --check.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]