Skip to content

fix(duckdb,postgres,redshift,snowflake)!: ARRAY_CAT null propagation #6829

Merged
georgesittas merged 7 commits into
mainfrom
mlee/transpile-array_cat
Jan 23, 2026
Merged

fix(duckdb,postgres,redshift,snowflake)!: ARRAY_CAT null propagation #6829
georgesittas merged 7 commits into
mainfrom
mlee/transpile-array_cat

Conversation

@fivetran-MichaelLee

@fivetran-MichaelLee fivetran-MichaelLee commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Support for ARRAY_CAT null propagation in dialects:

Bug Fix

DuckDB's LIST_CONCAT function accepts variadic arguments but this was not recognized by sqlglot. Removed ARRAY_CONCAT_IS_VAR_LEN = False from the dialect and updated tests accordingly.

Edge Case Not Handled

Postgres ignores NULL arguments to ARRAY_CAT, but when all arguments are NULL it will return NULL. When transpiling to a null propagating dialect, the resulting sql will COALESCE all the arguments to an empty array. Handling this edge case would add to an already complex solution.

@fivetran-MichaelLee fivetran-MichaelLee changed the title feat(databricks,duckdb,postgres,spark,snowflake)!: ARRAY_CAT null propagation feat(duckdb,postgres,redshift,snowflake)!: ARRAY_CAT null propagation Jan 21, 2026
@github-actions

github-actions Bot commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

SQLGlot Integration Test Results

Comparing:

  • this branch (sqlglot:mlee/transpile-array_cat, sqlglot version: mlee/transpile-array_cat)
  • baseline (main, sqlglot version: 28.6.1.dev77)

⚠️ Limited to dialects: snowflake, bigquery, duckdb

By Dialect

dialect main sqlglot:mlee/transpile-array_cat difference links
bigquery -> bigquery 2592/2624 passed (98.8%) 2592/2624 passed (98.8%) No change full result / delta
bigquery -> duckdb 1846/2623 passed (70.4%) 1846/2623 passed (70.4%) No change full result / delta
duckdb -> duckdb 4003/4003 passed (100.0%) 4003/4003 passed (100.0%) No change full result / delta
snowflake -> duckdb 615/847 passed (72.6%) 615/847 passed (72.6%) No change full result / delta
snowflake -> snowflake 847/847 passed (100.0%) 847/847 passed (100.0%) No change full result / delta

Overall

main: 10944 total, 9903 passed (pass rate: 90.5%), sqlglot version: 28.6.1.dev77

sqlglot:mlee/transpile-array_cat: 10944 total, 9903 passed (pass rate: 90.5%), sqlglot version: mlee/transpile-array_cat

Difference: No change

@georgesittas

Copy link
Copy Markdown
Collaborator

FYI @fivetran-MichaelLee CI's failing for formatting-related reasons. Drop a ping when ready.

@fivetran-MichaelLee

Copy link
Copy Markdown
Collaborator Author

@georgesittas This is going to need some more work so I'm keeping in draft for now

@fivetran-MichaelLee fivetran-MichaelLee changed the title feat(duckdb,postgres,redshift,snowflake)!: ARRAY_CAT null propagation fix(duckdb,postgres,redshift,snowflake)!: ARRAY_CAT null propagation Jan 22, 2026
@fivetran-MichaelLee fivetran-MichaelLee marked this pull request as ready for review January 22, 2026 17:06
@fivetran-MichaelLee fivetran-MichaelLee self-assigned this Jan 22, 2026
@georgesittas georgesittas merged commit 6ebe5cc into main Jan 23, 2026
11 checks passed
@georgesittas georgesittas deleted the mlee/transpile-array_cat branch January 23, 2026 14:42
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