Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-870

FilterPushDown ignores a partitioned column in CASE expression within WHERE clause

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      None

      Description

      The following test query ignores CASE WHEN condition.

      default> create tabletestQueryCasesOnColumnPartitionedTable (col1 int4, col2 int4) partition by column(key float8);
      
      default> select a.col1, a.col2, a.key
      from testQueryCasesOnColumnPartitionedTable a
      inner join lineitem b
      on a.col1 = b.l_orderkey
      where a.col1 = (case when a.key < 39 and a.col2 < 2 then 1 else 2 end);
      

      The following plan is a above query's plan. There is no filter condition.

      JOIN(6)(INNER)
        => Join Cond: default.a.col1 (INT4) = default.b.l_orderkey (INT4)
        => target list: default.a.col1 (INT4), default.a.col2 (INT4), default.a.key (FLOAT8)
        => out schema: {(3) default.a.col1 (INT4),default.a.col2 (INT4),default.a.key (FLOAT8)}
        => in schema: {(4) default.a.col1 (INT4),default.a.col2 (INT4),default.a.key (FLOAT8),default.b.l_orderkey (INT4)}
         SCAN(1) on default.lineitem as b
           => target list: default.b.l_orderkey (INT4)
           => out schema: {(1) default.b.l_orderkey (INT4)}
           => in schema: {(16) default.b.l_orderkey (INT4),default.b.l_partkey (INT4),default.b.l_suppkey (INT4),default.b.l_linenumber (INT4),default.b.l_quantity (FLOAT8),default.b.l_extendedprice (FLOAT8),default.b.l_discount (FLOAT8),default.b.l_tax (FLOAT8),default.b.l_returnflag (TEXT),default.b.l_linestatus (TEXT),default.b.l_shipdate (TEXT),default.b.l_commitdate (TEXT),default.b.l_receiptdate (TEXT),default.b.l_shipinstruct (TEXT),default.b.l_shipmode (TEXT),default.b.l_comment (TEXT)}
         PARTITIONS_SCAN(7) on default.testquerycasesoncolumnpartitionedtable
           => target list: default.a.col1 (INT4), default.a.col2 (INT4), default.a.key (FLOAT8)
           => num of filtered paths: 5
           => out schema: {(3) default.a.col1 (INT4),default.a.col2 (INT4),default.a.key (FLOAT8)}
           => in schema: {(3) default.a.col1 (INT4),default.a.col2 (INT4),default.a.null_col (INT4)}
           => 0: hdfs://localhost:61197/tajo/warehouse/default/testquerycasesoncolumnpartitionedtable/key=17.0
           => 1: hdfs://localhost:61197/tajo/warehouse/default/testquerycasesoncolumnpartitionedtable/key=36.0
           => 2: hdfs://localhost:61197/tajo/warehouse/default/testquerycasesoncolumnpartitionedtable/key=38.0
           => 3: hdfs://localhost:61197/tajo/warehouse/default/testquerycasesoncolumnpartitionedtable/key=45.0
           => 4: hdfs://localhost:61197/tajo/warehouse/default/testquerycasesoncolumnpartitionedtable/key=49.0
      

        Activity

        Hide
        hjkim Hyoungjun Kim added a comment -

        This issue resolved by TAJO-853.
        If Catalog uses the HCatalog, Catalog returns partitioned column name with a qualified name.

        Show
        hjkim Hyoungjun Kim added a comment - This issue resolved by TAJO-853 . If Catalog uses the HCatalog, Catalog returns partitioned column name with a qualified name.

          People

          • Assignee:
            hjkim Hyoungjun Kim
            Reporter:
            hjkim Hyoungjun Kim
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development