Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-545

When a projected expression can only have one value, replace with that constant

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0-incubating
    • None
    • None

    Description

      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

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            julianhyde Julian Hyde
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: