diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 16:12:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 16:12:58 +0000 |
commit | 042432fc9a1f7c3d5d552f12449fe45109fbcd57 (patch) | |
tree | 227afb41878f15dba7350b90ec6cfd52a02aabd6 /tests/dialects/test_prql.py | |
parent | Adding upstream version 23.12.1. (diff) | |
download | sqlglot-042432fc9a1f7c3d5d552f12449fe45109fbcd57.tar.xz sqlglot-042432fc9a1f7c3d5d552f12449fe45109fbcd57.zip |
Adding upstream version 23.13.1.upstream/23.13.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_prql.py')
-rw-r--r-- | tests/dialects/test_prql.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/dialects/test_prql.py b/tests/dialects/test_prql.py index 1a0eec2..5b438f1 100644 --- a/tests/dialects/test_prql.py +++ b/tests/dialects/test_prql.py @@ -66,3 +66,16 @@ class TestPRQL(Validator): "from x filter (a > 1 || null != b || c != null)", "SELECT * FROM x WHERE (a > 1 OR NOT b IS NULL OR NOT c IS NULL)", ) + self.validate_identity("from a aggregate { average x }", "SELECT AVG(x) FROM a") + self.validate_identity( + "from a aggregate { average x, min y, ct = sum z }", + "SELECT AVG(x), MIN(y), COALESCE(SUM(z), 0) AS ct FROM a", + ) + self.validate_identity( + "from a aggregate { average x, min y, sum z }", + "SELECT AVG(x), MIN(y), COALESCE(SUM(z), 0) FROM a", + ) + self.validate_identity( + "from a aggregate { min y, b = stddev x, max z }", + "SELECT MIN(y), STDDEV(x) AS b, MAX(z) FROM a", + ) |