jayzhan211 commented on code in PR #7338:
URL: https://github.com/apache/arrow-datafusion/pull/7338#discussion_r1303659919


##########
datafusion/sql/src/expr/value.rs:
##########
@@ -151,16 +151,51 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
         let data_types: HashSet<DataType> =
             values.iter().map(|e| e.get_datatype()).collect();
 
-        if data_types.is_empty() {
-            Ok(lit(ScalarValue::new_list(None, DataType::Utf8)))
-        } else if data_types.len() > 1 {
-            Err(DataFusionError::NotImplemented(format!(
-                "Arrays with different types are not supported: 
{data_types:?}",
-            )))
-        } else {
-            let data_type = values[0].get_datatype();
+        match data_types.len() {
+            0 => Ok(lit(ScalarValue::new_list(None, DataType::Utf8))),
+            1 => {
+                let data_type = values[0].get_datatype();
+
+                Ok(lit(ScalarValue::new_list(Some(values), data_type)))
+            }
+            // Check whether one of them is null
+            2 => {

Review Comment:
   > I didn't sure what is the case for >2. If you have int, float, and null in 
arrays, int, and float should be coerced before null handling, so I think only 
null and one data type are expected.
   
   False statement



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

Reply via email to