Skip to content

Commit aacc981

Browse files
chore(duckdb): tests for MAX_BY and MIN_BY (#6489)
1 parent e891397 commit aacc981

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/dialects/test_snowflake.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3530,6 +3530,21 @@ def test_max_by_min_by(self):
35303530
with self.subTest(f"Checking count arg of {node.sql('snowflake')}"):
35313531
self.assertIsNotNone(node.args.get("count"))
35323532

3533+
self.validate_all(
3534+
"SELECT MAX_BY(a, b) FROM t",
3535+
write={
3536+
"snowflake": "SELECT MAX_BY(a, b) FROM t",
3537+
"duckdb": "SELECT ARG_MAX(a, b) FROM t",
3538+
},
3539+
)
3540+
self.validate_all(
3541+
"SELECT MIN_BY(a, b) FROM t",
3542+
write={
3543+
"snowflake": "SELECT MIN_BY(a, b) FROM t",
3544+
"duckdb": "SELECT ARG_MIN(a, b) FROM t",
3545+
},
3546+
)
3547+
35333548
def test_create_view_copy_grants(self):
35343549
# for normal views, 'COPY GRANTS' goes *after* the column list. ref: https://docs.snowflake.com/en/sql-reference/sql/create-view#syntax
35353550
self.validate_identity(

0 commit comments

Comments
 (0)