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

Ashutosh Chauhan commented on CALCITE-545:
------------------------------------------

yup, these two covers those. Your second example I think will address this 
another form as well, which I am putting here only for completeness:
{code}
SELECT src.key, src.key + 1, src2.value
       FROM src  join src2 ON src.key = src2.key AND src.key = 100;
{code}
will become
{code}
SELECT 100, 101, src2.value
       FROM src  join src2 ON src.key = src2.key AND src.key = 100;
{code}

> When a projected expression can only have one value, replace with that 
> constant
> -------------------------------------------------------------------------------
>
>                 Key: CALCITE-545
>                 URL: https://issues.apache.org/jira/browse/CALCITE-545
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>
> When we have deduced that an expression can only have one value, replace the 
> expression with that value. This is beneficial because it will allow us to do 
> more column trimming.
> Example 1
> {{select deptno from emp where deptno = 10}}
> can become
> {{select 10 from emp where deptno = 10}}
> Example 2 (using inference, as in CALCITE-360)
> {{select emp.deptno
> from emp join dept using (deptno)
> where dept.deptno = 10}}
> can become
> {{select 10
> from emp join dept using (deptno)
> where dept.deptno = 10}}



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

Reply via email to