andygrove commented on code in PR #3930:
URL: https://github.com/apache/datafusion-comet/pull/3930#discussion_r3075019394
##########
native/core/src/execution/operators/scan.rs:
##########
@@ -532,6 +574,21 @@ impl Stream for ScanStream<'_> {
let maybe_batch = self.build_record_batch(columns, *num_rows);
Poll::Ready(Some(maybe_batch))
}
+ InputBatch::Complete(batch) => {
+ self.baseline_metrics.record_output(batch.num_rows());
+ let columns = batch.columns();
+ let num_rows = batch.num_rows();
+ if columns.len() == self.schema.fields().len() {
+ // Column counts match. Use build_record_batch to handle
any
+ // type differences (e.g., timestamp timezone casting).
+ let maybe_batch = self.build_record_batch(columns,
num_rows);
+ Poll::Ready(Some(maybe_batch))
+ } else {
+ // Column count mismatch (e.g., empty schema scan).
+ // Return the stashed batch as-is since it's already valid.
+ Poll::Ready(Some(Ok(batch.clone())))
Review Comment:
Updated. Thanks.
--
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]