Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def sqlglotrs_version():
setup(
extras_require={
"dev": [
"duckdb>=0.6",
"duckdb>=0.6,<2",
"mypy==1.14.1",
"pandas",
"pandas-stubs",
Expand Down
2 changes: 1 addition & 1 deletion sqlglot/dialects/e6.py
Original file line number Diff line number Diff line change
Expand Up @@ -3657,7 +3657,7 @@ def create_lpad_component(func_name: str):
if e.args.get("is_index")
else e.args.get("length") + e.args.get("from_index"),
),
exp.ArrayUniqueAgg: rename_func("ARRAY_AGG"),
exp.ArrayUniqueAgg: lambda self, e: f"ARRAY_AGG(DISTINCT {self.sql(e, 'this')})",
exp.ArrayPosition: lambda self, e: self.func("ARRAY_POSITION", e.expression, e.this),
exp.SafeDivide: rename_func("TRY_DIVIDE"),
exp.SortArray: rename_func("ARRAY_SORT"),
Expand Down
9 changes: 8 additions & 1 deletion tests/dialects/test_e6.py
Original file line number Diff line number Diff line change
Expand Up @@ -3075,12 +3075,19 @@ def test_array_agg(self):
)

self.validate_all(
"SELECT ARRAY_AGG(col) FROM (VALUES (1), (2), (NULL), (1)) AS tab(col)",
"SELECT ARRAY_AGG(DISTINCT col) FROM (VALUES (1), (2), (NULL), (1)) AS tab(col)",
read={
"databricks": "SELECT collect_set(col) FROM VALUES (1), (2), (NULL), (1) AS tab(col)",
},
)

self.validate_all(
"SELECT ARRAY_AGG(DISTINCT col1) FROM (SELECT '1' AS col1 UNION ALL SELECT '1' AS col1 UNION ALL SELECT '2' AS col1 UNION ALL SELECT '2' AS col1 UNION ALL SELECT '3' AS col1)",
read={
"databricks": 'select collect_set(col1) from (select "1" as col1 union all select "1" as col1 union all select "2" as col1 union all select "2" as col1 union all select "3" as col1)',
},
)

def test_bitwise(self):
self.validate_all(
"BITWISE_NOT(1)",
Expand Down
Loading