Felerius/hyrise

Incorrect reformulation with multiple aggregates

Closed this issue · 1 comments

Example:

SELECT *
FROM customer
WHERE c_acctbal > (
  SELECT SUM(a.x)
  FROM (
    SELECT AVG(o_totalprice) AS x
    FROM orders
    WHERE o_custkey = c_custkey
    GROUP BY o_orderpriority
  ) AS a
)

(copy-paste for hyriseConsole: SELECT * FROM customer WHERE c_acctbal > (SELECT SUM(a.x) FROM (SELECT AVG(o_totalprice) AS x FROM orders WHERE o_custkey = c_custkey GROUP BY o_orderpriority) AS a))

Caused by eed7088, fixed in ff49df9