[jira] [Updated] (CALCITE-3399) RelFieldTrimmer trim fields for UNION, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL

2019-10-10 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-3399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated CALCITE-3399:

Labels: pull-request-available  (was: )

> RelFieldTrimmer trim fields for UNION, INTERSECT, INTERSECT ALL, EXCEPT, 
> EXCEPT ALL
> ---
>
> Key: CALCITE-3399
> URL: https://issues.apache.org/jira/browse/CALCITE-3399
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: jin xing
>Assignee: jin xing
>Priority: Major
>  Labels: pull-request-available
>
> *RelFieldTrimmer#trimFields* provides functionality to trim fields for  
> *UNION, UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL;*
> But *UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL* works by 
> checking duplication. Column pruning on inputs of *SetOp* might lead to 
> different semantics.
>  
> Take below example for illustration
> {code:java}
> emp0:
> name, deptno
>  "A",   0
>  "B",   1
> emp1:
> name, deptno
>  "C",   0
>  "D",   2
> select deptno from
> (select name, deptno from emp0
> intersect
> select name, deptno from emp1)
> {code}
> Run above Sql on emp0 and emp1, result is not empty if trim fields on inputs 
> of INTERSECT, but result is empty if DO NOT trim fields on inputs of INTERSECT



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CALCITE-3399) RelFieldTrimmer trim fields for UNION, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL

2019-10-10 Thread jin xing (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-3399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jin xing updated CALCITE-3399:
--
Description: 
*RelFieldTrimmer#trimFields* provides functionality to trim fields for  *UNION, 
UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL;*

But *UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL* works by checking 
duplication. Column pruning on inputs of *SetOp* might lead to different 
semantics.

 

Take below example for illustration
{code:java}
emp0:
name, deptno
 "A",   0
 "B",   1

emp1:
name, deptno
 "C",   0
 "D",   2

select deptno from
(select name, deptno from emp0
intersect
select name, deptno from emp1)

{code}
Run above Sql on emp0 and emp1, result is not empty if trim fields on inputs of 
INTERSECT, but result is empty if DO NOT trim fields on inputs of INTERSECT

  was:
RelFieldTrimmer#trimFields provides functionality to trim fields for  UNION, 
UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL;

But UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL works by checking 
duplication. Column pruning on inputs of SetOp might lead to different 
semantics.


> RelFieldTrimmer trim fields for UNION, INTERSECT, INTERSECT ALL, EXCEPT, 
> EXCEPT ALL
> ---
>
> Key: CALCITE-3399
> URL: https://issues.apache.org/jira/browse/CALCITE-3399
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: jin xing
>Assignee: jin xing
>Priority: Major
>
> *RelFieldTrimmer#trimFields* provides functionality to trim fields for  
> *UNION, UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL;*
> But *UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, EXCEPT ALL* works by 
> checking duplication. Column pruning on inputs of *SetOp* might lead to 
> different semantics.
>  
> Take below example for illustration
> {code:java}
> emp0:
> name, deptno
>  "A",   0
>  "B",   1
> emp1:
> name, deptno
>  "C",   0
>  "D",   2
> select deptno from
> (select name, deptno from emp0
> intersect
> select name, deptno from emp1)
> {code}
> Run above Sql on emp0 and emp1, result is not empty if trim fields on inputs 
> of INTERSECT, but result is empty if DO NOT trim fields on inputs of INTERSECT



--
This message was sent by Atlassian Jira
(v8.3.4#803005)