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

Constant folding involving CASE and NULL

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      There are a few Hive issues relating to constant reduction of NULL and CASE. Calcite should do the same.

      HIVE-9645:

      select count(1) from store_sales where null=1;
      # should simplify to
      select count(1) from store_sales where false;
      

      HIVE-9644:

      select count(1) from store_sales where (case ss_sold_date when '1998-01-01' then 1 else null end)=1;
      # should simplify to
      select count(1) from store_sales where ss_sold_date= '1998-01-01' ;
      

        Issue Links

          Activity

          Hide
          jnadeau Jacques Nadeau added a comment -

          Resolved in release 1.4.0-incubating (2015-08-23)

          Show
          jnadeau Jacques Nadeau added a comment - Resolved in release 1.4.0-incubating (2015-08-23)
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/21cf1259 . Ashutosh Chauhan , FYI.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development