andygrove opened a new issue, #14277:
URL: https://github.com/apache/datafusion/issues/14277

   ### Describe the bug
   
   I am trying to upgrade Comet to the latest DataFusion and see some queries 
fail.
   
   The regression seems to have been introduced in 
https://github.com/apache/datafusion/pull/13953.
   
   Example Query:
   
   ```sql
   SELECT array_remove(array(_2, _3,_4), _2) from t1 where _2 is null
   ```
   
   Query plan:
   
   ```
   ProjectionExec: expr=[CASE WHEN Cast [data_type: Int32, timezone: 
America/Los_Angeles, child: col_0@0, eval_mode: Legacy] IS NULL THEN NULL ELSE 
array_remove(make_array(Cast [data_type: Int32, timezone: America/Los_Angeles, 
child: col_0@0, eval_mode: Legacy], Cast [data_type: Int32, timezone: 
America/Los_Angeles, child: col_1@1, eval_mode: Legacy], col_2@2), Cast 
[data_type: Int32, timezone: America/Los_Angeles, child: col_0@0, eval_mode: 
Legacy]) END as col_0]
     CometFilterExec: col_0@0 IS NULL
       ScanExec: source=[CometScan parquet  (unknown)], schema=[col_0: Int8, 
col_1: Int16, col_2: Int32]
   ```
   
   Failure:
   
   ```
   Invalid argument error: arguments need to have the same data type
   ```
   
   Cause:
   
   In the new `expr_or_expr` function, the following line is causing the 
failure:
   
   ```rust
   Ok(ColumnarValue::Array(zip(&remainder, &else_, &then_value)?))
   ```
   
   The type of `else_` is `ListArray` and the type of `then_value` is 
`NullArray`
   
   Solution:
   
   Perhaps we just need to add a cast in here? I am going to add a repro to 
DataFusion and work on a fix.
   
   
   
   
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


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

Reply via email to