You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL queries with HAVING clauses can get parsed correctly by the ddlog-sql front-end SQL compiler (i.e. Presto for now), but the translated DDlog program will fail to compile with the following error message:
create view v0 as SELECT COUNT(column2) AS c
FROM t1
JOIN t2 ON (t1.column1 = t2.column1)
GROUP BY t1.column1
HAVING ((COUNT(column2) > 2) NOT IN (t1.column3))
The DDlog compiler error happens because the SQL statement is missing a column reference to t1.column3 in the GROUP BY clause that is subsequently used in the HAVING clause.
In particular, the following SQL statement will translate to and compile successfully in DDlog:
create view v0 as SELECT COUNT(column2) AS c
FROM t1
JOIN t2 ON (t1.column1 = t2.column1)
GROUP BY t1.column1, t1.column3
HAVING ((COUNT(column2) > 2) NOT IN (t1.column3))
This is a request to improve error handling in the ddlog-sql compiler when such SQL statements are encountered.
The text was updated successfully, but these errors were encountered:
amytai
changed the title
ddlog-sql: unknown columns in HAVING clause result in cryptic DDlog compiler errors
SQL to DDlog compiler produces uncompilable DDlog for some illegal SQL program
Aug 26, 2021
SQL queries with
HAVING
clauses can get parsed correctly by the ddlog-sql front-end SQL compiler (i.e. Presto for now), but the translated DDlog program will fail to compile with the following error message:SQL statement:
The DDlog compiler error happens because the SQL statement is missing a column reference to
t1.column3
in theGROUP BY
clause that is subsequently used in theHAVING
clause.In particular, the following SQL statement will translate to and compile successfully in DDlog:
This is a request to improve error handling in the ddlog-sql compiler when such SQL statements are encountered.
The text was updated successfully, but these errors were encountered: