Skip to content

Fix ScalarUDFImpl::propagate_constraints doc#10810

Merged
alamb merged 2 commits intoapache:mainfrom
lewiszlw:fix-udf-propagate_constraints-doc
Jun 6, 2024
Merged

Fix ScalarUDFImpl::propagate_constraints doc#10810
alamb merged 2 commits intoapache:mainfrom
lewiszlw:fix-udf-propagate_constraints-doc

Conversation

@lewiszlw
Copy link
Copy Markdown
Member

@lewiszlw lewiszlw commented Jun 6, 2024

Which issue does this PR close?

Closes #.

Rationale for this change

I'm reading somd udf code, and found the example in ScalarUDFImpl::propagate_constraints doc is confused. I checked PhysicalExpr::propagate_constraints doc example

    /// If the expression is `a + b`, the current `interval` is `[4, 5]` and the
    /// inputs `a` and `b` are respectively given as `[0, 2]` and `[-∞, 4]`, then
    /// propagation would would return `[0, 2]` and `[2, 4]` as `b` must be at
    /// least `2` to make the output at least `4`.

If I understand correctly, the updated bounds of child expressions should be subinterval of their original intervals.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the logical-expr Logical plan and expressions label Jun 6, 2024
@alamb
Copy link
Copy Markdown
Contributor

alamb commented Jun 6, 2024

cc @berkaysynnada and @ozankabak

Copy link
Copy Markdown
Contributor

@ozankabak ozankabak left a comment

Choose a reason for hiding this comment

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

LGTM thank you for catching the typo

@alamb alamb merged commit d97ac8d into apache:main Jun 6, 2024
@alamb
Copy link
Copy Markdown
Contributor

alamb commented Jun 6, 2024

Thank you @lewiszlw and @ozankabak for the quick review

@lewiszlw lewiszlw deleted the fix-udf-propagate_constraints-doc branch June 6, 2024 13:05
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
* Fix ScalarUDFImpl::propagate_constraints doc

* Improve PhysicalExpr::propagate_constraints doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants