jayzhan211 commented on code in PR #11978:
URL: https://github.com/apache/datafusion/pull/11978#discussion_r1717686665


##########
datafusion/physical-plan/src/projection.rs:
##########
@@ -306,9 +306,10 @@ impl ProjectionStream {
         let arrays = self
             .expr
             .iter()
-            .map(|expr| {
+            .zip(&self.schema.fields)
+            .map(|(expr, field)| {
                 expr.evaluate(batch)
-                    .and_then(|v| v.into_array(batch.num_rows()))
+                    .and_then(|v| v.into_array_of_type(batch.num_rows(), 
field.data_type()))

Review Comment:
   It looks incorrect to me 🤔 I think we should get the corresponding physical 
type (DataType) either building physical expression or the rule in physical 
optimizer. We could do it as follow up PR



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to