zhouqingqing/qpmodel

Incorrect handling of NOT is producing wrong results

pkommoju opened this issue · 0 comments

Given the standard table a

select * from a where not (a1 = 1 or a3 = 4)

is producing wrong results,
0,1,2,3
1,2,3,4
2,3,4,5

instead of the correct output
0,1,2,3

It looks like NOT is disappearing because
select * from a where a1 not in (2)
produces
2,3,4,5

filter is null in the parsed statement itself if NOT is used in this manner.

select * from a where not a1 in (1)
Produces ERROR[Optimizer]: not on .a1 is not supported.