yashmayya opened a new pull request, #16990:
URL: https://github.com/apache/pinot/pull/16990

   - https://github.com/apache/pinot/pull/16570 refactored the set operators 
and made an assumption that all set operators will always have only two 
children. Prior to the refactor, `UNION` was capable of handling more than two 
children. However, it looks like there are indeed certain scenarios where 
Calcite will generate a `UNION` with more than two children.
   - Consider a query like:
   ```
   with data as (
     select a
     from (
         values(array [1, 2]),
           (array [3, 4]),
           (array [5, 6])
       ) "data" ("a")
   )
   select *
   from data;
   ```
   the explain plan output is:
   ```
   LogicalUnion(all=[true])
     PinotLogicalExchange(distribution=[hash[0]])
       LogicalProject(EXPR$0=[ARRAY(1, 2)])
         LogicalValues(tuples=[[{ 0 }]])
     PinotLogicalExchange(distribution=[hash[0]])
       LogicalProject(EXPR$0=[ARRAY(3, 4)])
         LogicalValues(tuples=[[{ 0 }]])
     PinotLogicalExchange(distribution=[hash[0]])
       LogicalProject(EXPR$0=[ARRAY(5, 6)])
         LogicalValues(tuples=[[{ 0 }]])
   ```
   - This patch refactors the set operators again to support multiple children 
for `UNION` / `UNION ALL`.


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