Skip to content

feat(rust/sedona-expr): Pass ConfigOptions into UDFs#557

Merged
Kontinuation merged 2 commits intoapache:mainfrom
Kontinuation:pass-config-options-to-udf
Jan 29, 2026
Merged

feat(rust/sedona-expr): Pass ConfigOptions into UDFs#557
Kontinuation merged 2 commits intoapache:mainfrom
Kontinuation:pass-config-options-to-udf

Conversation

@Kontinuation
Copy link
Member

Closes #248

This will allow altering the behavior of UDFs. For instance, allowing the size of per-thread proj cache used by ST_Transform to be configured before invoking any CRS transformation functions.

@Kontinuation Kontinuation changed the title chore: Pass ConfigOptions into UDFs feat(rust/sedona-expr): Pass ConfigOptions into UDFs Jan 28, 2026
&args,
return_type,
num_rows as usize,
None,
Copy link
Member Author

@Kontinuation Kontinuation Jan 28, 2026

Choose a reason for hiding this comment

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

We do not support passing ConfigOptions to FFI UDFs yet (this also won't be easy). I wonder should we simply pass in a default ConfigOptions here. This will simplify the type of config_options parameter to be &ConfigOptions.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's OK that functions using the FFI extension mechanism don't have access to options. There are probably only a few functions where it makes sense to use this.

Copy link
Member

Choose a reason for hiding this comment

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

I like the Option<> but if there is no cost to constructing default options that is OK too. If a Sedona UDF is specifically making use of options it's probably better for it to error in the unlikely event it is FFIed by accident?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that functions relying on options should fail instead of silently using default options. Let's keep using Option<> then.

@Kontinuation Kontinuation marked this pull request as ready for review January 28, 2026 17:17
Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

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

Thank you!

&args,
return_type,
num_rows as usize,
None,
Copy link
Member

Choose a reason for hiding this comment

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

I think it's OK that functions using the FFI extension mechanism don't have access to options. There are probably only a few functions where it makes sense to use this.

@Kontinuation Kontinuation merged commit 3f91e26 into apache:main Jan 29, 2026
15 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.

Pipe actual ConfigOptions to UDF calls instead of using defaults

2 participants