Hyoungjun Kim created TAJO-870:
----------------------------------
Summary: FilterPushDown ignores a partitioned column in CASE
expression within WHERE clause
Key: TAJO-870
URL: https://issues.apache.org/jira/browse/TAJO-870
Project: Tajo
Issue Type: Bug
Reporter: Hyoungjun Kim
Assignee: Hyoungjun Kim
Priority: Minor
The following test query ignores CASE WHEN condition.
{code:sql}
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);
{code}
The following plan is a above query's plan. There is no filter condition.
{noformat}
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
{noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)