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

   ### Describe the bug
   
   `coalesce(REE_column, literal)` fails to plan when one argument is a 
`RunEndEncoded` column and another is a non-REE literal. The same failure 
occurs for any expression routed through `type_union_resolution` (`UNION`, 
`NULLIF`, `CASE`, etc.).
   
   ```
   Function 'coalesce' user-defined coercion failed with: Execution error:
   Fail to find the coerced type, errors: Execution error:
   Expect to get struct but got RunEndEncoded("run_ends": non-null Int32, 
"values": Utf8).
   No function matches the given name and argument types
   'coalesce(RunEndEncoded("run_ends": non-null Int32, "values": Utf8), Utf8)'.
   ```
   
   ### To Reproduce
   
   ```sql
   CREATE TABLE ree_t AS
   SELECT arrow_cast(c, 'RunEndEncoded("run_ends": non-null Int32, "values": 
Utf8)') AS ree_col
   FROM (VALUES ('hello'), (NULL), ('world')) AS t(c);
   
   SELECT coalesce(ree_col, '__null__') FROM ree_t;
   ```
   
   ### Expected behavior
   
   ```
   hello
   __null__
   world
   ```


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