Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-3812

optimize the child CompareTupleFilter in a CompareTupleFilter

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v3.0.0-alpha2
    • Component/s: Query Engine
    • Labels:
      None

      Description

      Currently it's not well supported for CompareTupleFilter to have a child of CompareTupleFilter. However, in some cases, it's better to support it.

      where (colA = (1=1))
      

      The (1=1) can be transformed to "true". And then this filter can be pushed down to hbase. Otherwise, the filter (colA = (1=1)) does not work in hbase.

      And it may return incorrect results for the following SQL:

      select colA
             case
                 when colB = (1 = 1) then 'B'
                 when colC = (1 = 1) then 'C'
                 when colD = (1 = 1) then 'D'
                 else 'n/a'
             end as phase,
             count(*)
      from T
      where session_date between '2018-08-01' and '2018-08-31'
      group by colA
             case
                 when colB = (1 = 1) then 'B'
                 when colC = (1 = 1) then 'C'
                 when colD = (1 = 1) then 'D'
                 else 'n/a'
             end;
      

      In the final result, all of the keys will become 'B'.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yaho Zhong Yanghong
                Reporter:
                yaho Zhong Yanghong
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: