[ https://issues.apache.org/jira/browse/BEAM-7049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16932032#comment-16932032 ]
sridhar Reddy edited comment on BEAM-7049 at 9/18/19 4:11 AM: -------------------------------------------------------------- I noticed there is a change in behavior between union vs union all. The following query works as expected with the code in the pull request {{SELECT 1 }} UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 {{but the query}} {{SELECT 1 }}UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 {{doesn't work as expected. It only uses 3 operands to give the result[1,2,3] and skips 4 and 5. This behavior is observed with UnionMergeRule in the right place. }} {{I will do a couple of more tests with a fresh clone to see if there is any difference and update this Jira. }} was (Author: sridharg): I noticed there is a change in behavior between union vs union all. The following query works as expected with the code in the pull request {{SELECT 1 }} UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5}} {{}} {{but the query}} {{}}{{SELECT 1 }}{{UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5}} {{}} {{doesn't work as expected. It only uses 3 operands to give the result }}{{[1,2,3] and skps 4 and 5. This behavior is observed with UnionMergeRule in the right place. }} {{I will do a couple of more tests with fresh clone to see if there is any difference and update this Jira. }}{{}} > Merge multiple input to one BeamUnionRel > ---------------------------------------- > > Key: BEAM-7049 > URL: https://issues.apache.org/jira/browse/BEAM-7049 > Project: Beam > Issue Type: Improvement > Components: dsl-sql > Reporter: Rui Wang > Assignee: sridhar Reddy > Priority: Major > Time Spent: 1h > Remaining Estimate: 0h > > BeamUnionRel assumes inputs are two and rejects more. So `a UNION b UNION c` > will have to be created as UNION(a, UNION(b, c)) and have two shuffles. If > BeamUnionRel can handle multiple shuffles, we will have only one shuffle -- This message was sent by Atlassian Jira (v8.3.4#803005)