Skip to content

fix(snowflake): transpile REDUCE to DuckDB LIST_REDUCE#7505

Merged
georgesittas merged 5 commits intomainfrom
RD-1147682-transpile-REDUCE
Apr 16, 2026
Merged

fix(snowflake): transpile REDUCE to DuckDB LIST_REDUCE#7505
georgesittas merged 5 commits intomainfrom
RD-1147682-transpile-REDUCE

Conversation

@fivetran-ashashankar
Copy link
Copy Markdown
Collaborator

Adds support for transpiling Snowflake's REDUCE function to DuckDB's LIST_REDUCE.

Comment thread sqlglot/generators/duckdb.py Outdated
def reduce_sql(self, expression: exp.Reduce) -> str:
# DuckDB's LIST_REDUCE doesn't support a finish function, so preserve REDUCE as-is
if expression.args.get("finish"):
return self.function_fallback_sql(expression)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just decorate the function with @unsupported("finish") instead of falling back here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@georgesittas
Copy link
Copy Markdown
Collaborator

@fivetran-ashashankar when conflicts are resolved feel free to merge.

@fivetran-ashashankar fivetran-ashashankar force-pushed the RD-1147682-transpile-REDUCE branch from aa668ae to e6c0711 Compare April 16, 2026 16:12
@georgesittas georgesittas force-pushed the RD-1147682-transpile-REDUCE branch from e6c0711 to fa7b226 Compare April 16, 2026 17:05
@georgesittas georgesittas merged commit 0b46b39 into main Apr 16, 2026
7 checks passed
@georgesittas georgesittas deleted the RD-1147682-transpile-REDUCE branch April 16, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants