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
{{ message }}
Repository navigation
Commit d1ff850
Browse filesBrowse the repository at this point in the historyBrowse files
# Errors rather than returning wrong rows. Expected `(1, NULL), (2, NULL)`.
1369
+
query error Physical plan does not support logical expression ScalarSubquery
1370
+
SELECT x.a, (SELECT sum(y.b) FROM (VALUES (1, 10)) AS y(a, b) WHERE y.a = x.a HAVING sum(y.b) IS NULL) AS v FROM (VALUES (1), (2)) AS x(a) ORDER BY x.a;
1371
+
1372
+
# Errors rather than returning wrong rows. Expected `(1, NULL), (2, NULL)`.
1373
+
query error Physical plan does not support logical expression ScalarSubquery
1374
+
SELECT x.a, (SELECT max(y.b) FROM (VALUES (1, 10)) AS y(a, b) WHERE y.a = x.a HAVING max(y.b) IS NULL) AS v FROM (VALUES (1), (2)) AS x(a) ORDER BY x.a;
1375
+
1376
+
# Errors rather than returning wrong rows. Expected `(1, NULL), (2, NULL)`.
1377
+
query error Physical plan does not support logical expression ScalarSubquery
1378
+
SELECT x.a, (SELECT sum(y.b) FROM (VALUES (1, 10)) AS y(a, b) WHERE y.a = x.a HAVING count(*) = 0) AS v FROM (VALUES (1), (2)) AS x(a) ORDER BY x.a;
1379
+
1380
+
# Still decorrelated: the HAVING is applied to `count(*)`.
1381
+
query II
1382
+
SELECT x.a, (SELECT count(*) FROM (VALUES (1, 10)) AS y(a, b) WHERE y.a = x.a HAVING count(*) = 0) AS v FROM (VALUES (1), (2)) AS x(a) ORDER BY x.a;
1383
+
----
1384
+
1 NULL
1385
+
2 0
1386
+
1387
+
# Still decorrelated: the HAVING reads an aggregate that is NULL on empty input,
1388
+
# but the subquery returns `count(*)`, which the HAVING is applied to.
1389
+
query II
1390
+
SELECT x.a, (SELECT count(*) FROM (VALUES (1, 10)) AS y(a, b) WHERE y.a = x.a HAVING sum(y.b) IS NULL) AS v FROM (VALUES (1), (2)) AS x(a) ORDER BY x.a;
1391
+
----
1392
+
1 NULL
1393
+
2 0
1394
+
1395
+
# Still decorrelated: a HAVING that is false on empty input is not pulled up.
1396
+
query II
1397
+
SELECT x.a, (SELECT sum(y.b) FROM (VALUES (1, 10)) AS y(a, b) WHERE y.a = x.a HAVING sum(y.b) > 5) AS v FROM (VALUES (1), (2)) AS x(a) ORDER BY x.a;
0 commit comments