Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-1800

WHERE clause is ignored with UNION

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: Planner/Optimizer
    • Labels:
      None

      Description

      You can reproduce as follows:

      tpch> select c_custkey, ret
      > from (select c_custkey, ROUND(sum(c_acctbal*15000000)/sum(15000000),4) as ret from customer group by c_custkey
      > union
      > select c_custkey, ROUND(sum(c_acctbal*15000000)/sum(15000000),4) as ret from customer group by c_custkey) a
      > where ret > 0.02;
      c_custkey,  ret
      -------------------------------
      64568,  3631.24
      26627,  9070.85
      105296,  2863.05
      51704,  7404.84
      111424,  -977.6
      32824,  3718.26
      138521,  -510.01
      ...
      

        Attachments

          Activity

            People

            • Assignee:
              hyunsik Hyunsik Choi
              Reporter:
              jihoonson Jihoon Son
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: