Skip to content

Conversation

@fivetran-MichaelLee
Copy link
Collaborator

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

The ARRAY_APPEND function handles NULL input arrays differently across the dialects that support it:

Database Behavior Result
Snowflake Returns NULL NULL
DuckDB Creates new array [element]
PostgreSQL Creates new array {element}
Databricks Returns NULL NULL
Spark Returns NULL NULL

This PR introduces a new arg_types parameter null_propagation to preserve NULL handling semantics when transpiling between these dialects.

@fivetran-MichaelLee fivetran-MichaelLee self-assigned this Jan 15, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

SQLGlot Integration Test Results

Comparing:

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

⚠️ Limited to dialects: bigquery, duckdb, snowflake

By Dialect

dialect main sqlglot:mlee/transpile-array_append 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%) 1845/2623 passed (70.3%) 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.dev44

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

Difference: No change

@fivetran-MichaelLee fivetran-MichaelLee marked this pull request as ready for review January 16, 2026 00:24
Copy link
Collaborator

@VaggelisD VaggelisD left a comment

Choose a reason for hiding this comment

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

Copy link
Collaborator

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

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

@georgesittas georgesittas merged commit 8cda928 into main Jan 19, 2026
17 of 18 checks passed
@georgesittas georgesittas deleted the mlee/transpile-array_append branch January 19, 2026 11: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.

4 participants