Adam-Alani opened a new issue, #27611:
URL: https://github.com/apache/datafusion/issues/27611

   `propagate_empty_relation` removes an empty union input and keeps the union 
schema, whose field names come from the first input.
   
   When exactly one input survives, #26557 maps that input's columns to the 
union schema by position. When two or more survive, the union is rebuilt with 
the original schema and the remaining inputs keep their own names. Creating a 
physical plan then fails:
   
   ```
   Assertion failed: col.name() == matching_name: Input field name b does not 
match with the projection expression a
   ```
   
   ```sql
   SELECT a FROM (VALUES (1)) t(a) WHERE false
   UNION ALL
   SELECT b FROM (VALUES (2)) s(b)
   UNION ALL
   SELECT c FROM (VALUES (3)) u(c);
   ```
   
   The same query with one remaining input succeeds. Inputs whose names already 
match the union schema are unaffected.


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