[
https://issues.apache.org/jira/browse/CALCITE-2260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16440008#comment-16440008
]
Julian Hyde commented on CALCITE-2260:
--------------------------------------
Good catch.
Presumably distinct INTERSECT and EXCEPT also.
If the result is unique on the remaining projected fields, then trimmer could
safely go ahead. For example, in {code}select empno, deptno from emp where
location = 'SF'
union
select empno, deptno from emp where deptno > 30{code} it is safe to trim
{{deptno}} because {{empno}} is unique.
> RelFieldTrimmer incorrectly trims fields when trimming a distinct UNION
> -----------------------------------------------------------------------
>
> Key: CALCITE-2260
> URL: https://issues.apache.org/jira/browse/CALCITE-2260
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.12.0
> Reporter: Jacques Nadeau
> Assignee: Laurent Goujon
> Priority: Major
>
> While working with RelFieldTrimmer, identified that if it will push a project
> field trimming through a distinct union, causing wrong result.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)