comphead commented on code in PR #15603:
URL: https://github.com/apache/datafusion/pull/15603#discussion_r2033557454
##########
datafusion/physical-plan/src/stream.rs:
##########
@@ -408,7 +422,18 @@ where
type Item = Result<RecordBatch>;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) ->
Poll<Option<Self::Item>> {
- self.project().stream.poll_next(cx)
+ let this = self.project();
+ let transform_schema = *this.transform_schema;
+ let schema = Arc::clone(this.schema);
+ let ret = this.stream.poll_next(cx);
+ if transform_schema {
+ if let Poll::Ready(Some(Ok(batch))) = ret {
+ return Poll::Ready(Some(batch.with_schema(schema).map_err(|e| {
Review Comment:
I think this is one of the notorious problems when logical schema doesn't
match the physical one on nullability/metadata. But this change might bring a
performance impact, although the schema change is just reassigning the value
but it also calls `schema_contains` which may be expensive
--
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]