diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-13 11:11:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-13 11:11:42 +0000 |
commit | 721d458d4c24741ccbc5519b7ca39234a1a21ff6 (patch) | |
tree | b9f72e1d00aba012f06cdf7b0d75ec5e53640eaf /tests/test_executor.py | |
parent | Adding upstream version 25.1.0. (diff) | |
download | sqlglot-721d458d4c24741ccbc5519b7ca39234a1a21ff6.tar.xz sqlglot-721d458d4c24741ccbc5519b7ca39234a1a21ff6.zip |
Adding upstream version 25.5.1.upstream/25.5.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_executor.py')
-rw-r--r-- | tests/test_executor.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_executor.py b/tests/test_executor.py index 317b930..e80fb1e 100644 --- a/tests/test_executor.py +++ b/tests/test_executor.py @@ -14,6 +14,8 @@ from sqlglot.errors import ExecuteError from sqlglot.executor import execute from sqlglot.executor.python import Python from sqlglot.executor.table import Table, ensure_tables +from sqlglot.optimizer import optimize +from sqlglot.planner import Plan from tests.helpers import ( FIXTURES_DIR, SKIP_INTEGRATION, @@ -862,3 +864,18 @@ class TestExecutor(unittest.TestCase): result = execute("SELECT x FROM t", dialect="duckdb", tables=tables) self.assertEqual(result.columns, ("x",)) self.assertEqual(result.rows, [([1, 2, 3],)]) + + def test_agg_order(self): + plan = Plan( + optimize(""" + SELECT + AVG(bill_length_mm) AS avg_bill_length, + AVG(bill_depth_mm) AS avg_bill_depth + FROM penguins + """) + ) + + assert [agg.alias for agg in plan.root.aggregations] == [ + "avg_bill_length", + "avg_bill_depth", + ] |