chenkovsky commented on code in PR #15603:
URL: https://github.com/apache/datafusion/pull/15603#discussion_r2033572970
##########
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:
yes, there's performance concern now. if this approach is feasible, I can
try to optimize it, maybe use RecordBatch::try_new_with_options
--
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]