Skip to content

fix: preserve scalar UDF bounds across FFI - #25142

Open
emecii wants to merge 1 commit into
apache:mainfrom
emecii:fix/ffi-scalar-udf-evaluate-bounds
Open

fix: preserve scalar UDF bounds across FFI#25142
emecii wants to merge 1 commit into
apache:mainfrom
emecii:fix/ffi-scalar-udf-evaluate-bounds

Conversation

@emecii

@emecii emecii commented Sep 10, 2026

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

Foreign scalar UDFs currently lose custom evaluate_bounds() behavior across the FFI boundary. The consumer falls back to an unbounded NULL interval, preventing interval analysis from using provider bounds.

What changes are included in this PR?

  • Add an evaluate_bounds callback to FFI_ScalarUDF.
  • Convert interval inputs and results through the existing FFI_Interval representation.
  • Test successful and error results through forced-foreign and dynamic-library round trips.

What is the testing strategy for this PR?

  • cargo test -p datafusion-ffi --features integration-tests
  • Extended workspace test command from AGENTS.md
  • cargo fmt --all -- --check
  • cargo clippy -p datafusion-ffi --all-targets --all-features -- -D warnings with only Rust 1.98 compatibility lint allowances

Are there any user-facing changes?

Yes. Foreign scalar UDFs now preserve custom interval bounds. The FFI_ScalarUDF layout changes, so this PR requires the api change label.

Generated-by: Codex (GPT-5)

Generated-by: Codex (GPT-5)
@emecii

emecii commented Sep 10, 2026

Copy link
Copy Markdown
Author

@timsaucer, could you please add the required api change label and trigger CI when convenient?

AI-generated with Codex (GPT-5).

@github-actions github-actions Bot added the ffi Changes to the ffi crate label Sep 10, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ffi Changes to the ffi crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants