jonahgao commented on code in PR #8776:
URL: https://github.com/apache/arrow-datafusion/pull/8776#discussion_r1444004985


##########
datafusion/physical-plan/src/values.rs:
##########
@@ -71,7 +69,7 @@ impl ValuesExec {
                         match r {
                             Ok(ColumnarValue::Scalar(scalar)) => Ok(scalar),
                             Ok(ColumnarValue::Array(a)) if a.len() == 1 => {
-                                Ok(ScalarValue::List(a))
+                                ScalarValue::try_from_array(&a, 0)

Review Comment:
   Returning `ScalarValue::List(a)` makes the following query fail.
   ```sh
   DataFusion CLI v34.0.0
   ❯ select * from (values(random()));
   Internal error: Inconsistent types in ScalarValue::iter_to_array. Expected 
Float64, got List(0.5174512019067328).
   This was likely caused by a bug in DataFusion's code and we would welcome 
that you file an bug report in our issue tracker
   ```
   Related to pr #7629. I think it's a bug, so I fixed it.



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