apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.52k stars 3.24k forks source link

[Bug] 1.1 version Column prune incorrect result #12466

Closed wangbo closed 1 year ago

wangbo commented 2 years ago

Search before asking

Version

1.1

select t1.l_orderkey,
       t2.s_phone
  from (
        select l_suppkey,
               l_orderkey
          from lineitem
       )t1 left join(
        select s_suppkey,
               s_phone
          from supplier
       ) t2
    on t1.l_suppkey=t2.s_suppkey
 group by t1.l_orderkey,
          t2.s_phone

For this sql, when FE generate a HashNode, its output expr could contains TupleIsNullPredicate. image The tupleId is 2, it stands for left table. image

In Doris be, s_suppkey column couldn't be insert value because it's pruned. But s_suppkey could be used to eval TupleIsNullPredicate, then the output value isn't true; Here is my temporary solution, #12404. But we need to solve it in FE finally.

Are you willing to submit PR?

Code of Conduct

wangbo commented 2 years ago

Solution

1 generate a _column_to_check for HashJoinNode, by using HashJoinNode's _row_desc_for_other_join_conjunt or _row_descriptor. 2 We fill column by