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

   ### Describe the bug
   
   `unnest` in a piped `SELECT` or `EXTEND` fails during type coercion. The 
same expression works in a normal `SELECT`.
   
   ### To Reproduce
   
   ```sql
   SELECT [1, 2, 3] AS xs
   |> SELECT unnest(xs) AS x
   ```
   
   ```
   type_coercion
   caused by
   This feature is not implemented: Unnest should be rewritten to 
LogicalPlan::Unnest before type coercion
   ```
   
   `|> EXTEND unnest(xs) AS x` fails the same way. Without pipes, this works:
   
   ```sql
   SELECT unnest(xs) AS x FROM (SELECT [1, 2, 3] AS xs)
   ```
   
   Seen on DataFusion 55.3.0 and in the 55.0.0 Python bindings.
   
   ### Expected behavior
   
   ```
   +---+
   | x |
   +---+
   | 1 |
   | 2 |
   | 3 |
   +---+
   ```
   
   ### Additional context
   
   The pipe operators seem to skip the rewrite of `unnest` into 
`LogicalPlan::Unnest` that a normal `SELECT` gets. Part of #14660.
   


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