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


##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -1714,6 +1631,15 @@ impl ScalarValue {
             Some(sv) => sv.data_type(),
         };
 
+        Self::iter_to_array_of_type(scalars.collect(), &data_type)
+    }
+
+    fn iter_to_array_of_type(

Review Comment:
   This was introduced because of aggregations that use ScalarValue as state 
and so they could lose type information when emitting state.



##########
datafusion/sqllogictest/test_files/string_view.slt:
##########
@@ -261,7 +261,7 @@ explain SELECT column1_utf8 from test where 
column1_utf8view = 'Andrew';
 ----
 logical_plan
 01)Projection: test.column1_utf8
-02)--Filter: test.column1_utf8view = Utf8View("Andrew")
+02)--Filter: test.column1_utf8view = CAST(Utf8("Andrew") AS Utf8View)

Review Comment:
   Casts are not simplified to retain the type information to fix the 
`optimize_projection` issue above.



-- 
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