Skip to content

Mark null-propagating math functions as strict#23527

Open
lyne7-sc wants to merge 3 commits into
apache:mainfrom
lyne7-sc:mark-math-functions-strict
Open

Mark null-propagating math functions as strict#23527
lyne7-sc wants to merge 3 commits into
apache:mainfrom
lyne7-sc:mark-math-functions-strict

Conversation

@lyne7-sc

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • Closes #.

Rationale for this change

This PR follows up on #23148, which introduced strictness metadata for scalar UDF NULL propagation and used it during outer join elimination. It marks built-in math functions that propagate NULL inputs as strict, allowing the optimizer to recognize more null-rejecting predicates and simplify the corresponding outer joins.

What changes are included in this PR?

  • Extend the math UDF helper macros to support the is_strict property.
  • Mark null-propagating math scalar functions as strict.
  • Add unit tests covering:
    • supported math functions;
    • unary and binary variants;
    • every combination of NULL arguments;
    • non-NULL inputs.
  • Add SQL logic tests showing that strict math predicates enable outer join elimination for:
    • LEFT, RIGHT, and FULL joins;
    • unary and binary functions;
    • nullable arguments in either position;
    • binary function arguments coming from both sides of a join.

Are these changes tested?

Yes. Unit tests cover NULL propagation for the affected math functions, and SLTs verify the resulting outer join simplifications.

Are there any user-facing changes?

Yes. Queries containing null-rejecting predicates over math functions may now produce more efficient plans by simplifying eligible outer joins.

There are no public API changes.

@github-actions github-actions Bot added sqllogictest SQL Logic Tests (.slt) functions Changes to functions implementation labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant