Skip to content

[SPARK] Add new expressions to AllowedExpressionAllowlist - #7634

Merged
murali-db merged 3 commits into
delta-io:masterfrom
Omar-Saleh:add-allowedExpressionlistshims
Sep 9, 2026
Merged

murali-db merged 3 commits into
delta-io:masterfrom
Omar-Saleh:add-allowedExpressionlistshims

Conversation

@Omar-Saleh

Copy link
Copy Markdown
Collaborator

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

NULLIF is already allowed in Delta generated columns and check constraints. In Spark 4.2, its analyzed replacement contains With, CommonExpressionDef, CommonExpressionRef, and TypedNullLiteral. Delta validates the completely analyzed expression tree, but these internal expressions were missing from its allowlist. Consequently, valid uses of NULLIF could fail validation, including when OPTIMIZE revalidates a table's generated columns.

This PR introduces Spark version specific expression allowlist shims. The Spark 4.0-4.1 shim adds no expressions, while the Spark 4.2 shim adds the internal NULLIF expansion expressions and TimestampAddInterval. A Boolean shim method also lets the existing TimestampAddInterval test cancel on Spark versions where that expression is not allowlisted.

How was this patch tested?

UTs

Does this PR introduce any user-facing changes?

No

@murali-db
murali-db merged commit 0ae17d9 into delta-io:master Sep 9, 2026
43 checks passed
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.

3 participants