You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafodion.apache.org by Eric Owhadi <er...@esgyn.com> on 2015/12/16 22:31:17 UTC

question for predicate push down problem

Running regression (very powerful set of test BTW), I discovered the
following issue:

Given the following query:



SELECT T1.a FROM t002t1 AS t1

WHERE EXISTS (

    SELECT -74 FROM t002t1   where t1.c = 30

    UNION all

    SELECT -84 FROM t002t2

    WHERE NOT (( EXISTS (SELECT 1 FROM t002t2

    ) ) )

);



The scan node for evaluating    SELECT -74 FROM t002t1   where t1.c = 30

Is incorrectly pushing down t1.c=30, as if it was simply c=30.



I was naively thinking that checking if NATable pointer of
getTabledesc()->getNATable and NAColumn->getNATable() would be different
for the case that I am facing, but, no, the same naTable pointer reference
the t002t1 in memory, regardless if it is for the outer scan or inner scan.



So anyone know what I should be checking to make sure I recognize this
situation and avoid pushing down non legitime expression like these?



Thanks in advance for the help,
Eric

RE: question for predicate push down problem

Posted by Eric Owhadi <er...@esgyn.com>.
Great thanks Anoop. This trick works perfect.
Eric

-----Original Message-----
From: Anoop Sharma [mailto:anoop.sharma@esgyn.com]
Sent: Wednesday, December 16, 2015 3:36 PM
To: dev@trafodion.incubator.apache.org
Subject: RE: question for predicate push down problem

you can check to see if a non-const column value is an input value (part of
characteristic input) to that scan operator.
If it is, then that column is not part of that operator and cannot be part
of a 'col op val' hbase pred.
It can be part of a 'non-col op val' predicate though.

anoop

-----Original Message-----
From: Eric Owhadi [mailto:eric.owhadi@esgyn.com]
Sent: Wednesday, December 16, 2015 1:31 PM
To: dev@trafodion.incubator.apache.org
Subject: question for predicate push down problem

Running regression (very powerful set of test BTW), I discovered the
following issue:

Given the following query:



SELECT T1.a FROM t002t1 AS t1

WHERE EXISTS (

    SELECT -74 FROM t002t1   where t1.c = 30

    UNION all

    SELECT -84 FROM t002t2

    WHERE NOT (( EXISTS (SELECT 1 FROM t002t2

    ) ) )

);



The scan node for evaluating    SELECT -74 FROM t002t1   where t1.c = 30

Is incorrectly pushing down t1.c=30, as if it was simply c=30.



I was naively thinking that checking if NATable pointer of
getTabledesc()->getNATable and NAColumn->getNATable() would be different for
the case that I am facing, but, no, the same naTable pointer reference the
t002t1 in memory, regardless if it is for the outer scan or inner scan.



So anyone know what I should be checking to make sure I recognize this
situation and avoid pushing down non legitime expression like these?



Thanks in advance for the help,
Eric

RE: question for predicate push down problem

Posted by Anoop Sharma <an...@esgyn.com>.
you can check to see if a non-const column value is an input value
(part of characteristic input) to that scan operator.
If it is, then that column is not part of that operator and cannot
be part of a 'col op val' hbase pred.
It can be part of a 'non-col op val' predicate though.

anoop

-----Original Message-----
From: Eric Owhadi [mailto:eric.owhadi@esgyn.com]
Sent: Wednesday, December 16, 2015 1:31 PM
To: dev@trafodion.incubator.apache.org
Subject: question for predicate push down problem

Running regression (very powerful set of test BTW), I discovered the
following issue:

Given the following query:



SELECT T1.a FROM t002t1 AS t1

WHERE EXISTS (

    SELECT -74 FROM t002t1   where t1.c = 30

    UNION all

    SELECT -84 FROM t002t2

    WHERE NOT (( EXISTS (SELECT 1 FROM t002t2

    ) ) )

);



The scan node for evaluating    SELECT -74 FROM t002t1   where t1.c = 30

Is incorrectly pushing down t1.c=30, as if it was simply c=30.



I was naively thinking that checking if NATable pointer of
getTabledesc()->getNATable and NAColumn->getNATable() would be different for
the case that I am facing, but, no, the same naTable pointer reference the
t002t1 in memory, regardless if it is for the outer scan or inner scan.



So anyone know what I should be checking to make sure I recognize this
situation and avoid pushing down non legitime expression like these?



Thanks in advance for the help,
Eric