[ 
https://issues.apache.org/jira/browse/CALCITE-1268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15335303#comment-15335303
 ] 

Maryann Xue commented on CALCITE-1268:
--------------------------------------

bq. If a CHAR(5) (e.g. 'TABLE') and CHAR(7) will ultimately become a CHAR(7), 
it's OK if the CHAR(5) is converted a bit early.

Maybe this should be approached in a slightly different way than regarding it 
as a conversion at a certain stage. Rather, say, if CHAR(5) and CHAR(7) are 
inputs of a Union and they should ultimately be CHAR(7) as the Union output, a 
FilterSetOpTransposeRule should be seeing CHAR(7) instead of CHAR(5) since the 
filter is pushed through the Union and its original input and new input should 
be consistent. So I think the changes to that test case represent the right 
semantics.

> Union should apply explicit Project over its children if they have different 
> but coercible types
> ------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1268
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1268
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.7.0
>            Reporter: Maryann Xue
>            Assignee: Julian Hyde
>
> Test case in SqlToRelConverterTest:
> {code}
>   @Test public void testUnionExprTypes() {
>     check(
>         "select empno, sal from emp "
>             + "union all "
>             + "select deptno, deptno from dept",
>         "${plan}");
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to