alamb commented on code in PR #21403:
URL: https://github.com/apache/datafusion/pull/21403#discussion_r3039932011
##########
datafusion/physical-plan/src/spill/in_progress_spill_file.rs:
##########
@@ -62,8 +62,12 @@ impl InProgressSpillFile {
));
}
if self.writer.is_none() {
- let schema = batch.schema();
- if let Some(ref in_progress_file) = self.in_progress_file {
+ // Use the SpillManager's declared schema rather than the batch's
schema.
+ // Individual batches may have different schemas (e.g., different
nullability)
+ // when they come from different branches of a UnionExec. The
SpillManager's
+ // schema represents the canonical schema that all batches should
conform to.
+ let schema = self.spill_writer.schema();
Review Comment:
this is the code change. The rest are test changes
--
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]