Skip to content

Conversation

@findepi
Copy link
Member

@findepi findepi commented Aug 6, 2025

Reduce boilerplate in cases where implementation of {ScalarUDFImpl,AggregateUDFImpl,WindowUDFImpl}::{equals,hash_value} can be derived using standard PartialEq and Hash traits.

This is code complexity reduction. Follows #16842

While valuable on its own, this also prepares for more automatic derivation of UDF equals/hash and/or removal of default implementations (which currently are error-prone) -- #16677

`ForeignWindowUDF` contains `FFI_WindowUDF` struct which was compared by
pointer only. This means that effectively `ForeignWindowUDF` was also
compared by pointer only, with all other equality checks being
redundant. This commit simplifies the implementation to make it more
obvious and more performant.
@github-actions github-actions bot added logical-expr Logical plan and expressions optimizer Optimizer rules core Core DataFusion crate proto Related to proto crate functions Changes to functions implementation ffi Changes to the ffi crate labels Aug 6, 2025
@findepi findepi force-pushed the findepi/derive-udwf-equality-from-partialeq-hash-f01a0c branch from 8bc714d to 5b037a8 Compare August 6, 2025 15:25
@findepi findepi force-pushed the findepi/derive-udwf-equality-from-partialeq-hash-f01a0c branch from 5b037a8 to edfff87 Compare August 6, 2025 15:25
@findepi findepi requested review from alamb and kosiew August 6, 2025 15:52
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- thank you @findepi

@findepi findepi merged commit 84bbce6 into apache:main Aug 7, 2025
27 checks passed
@findepi findepi deleted the findepi/derive-udwf-equality-from-partialeq-hash-f01a0c branch August 7, 2025 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate ffi Changes to the ffi crate functions Changes to functions implementation logical-expr Logical plan and expressions optimizer Optimizer rules proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Derive UDWF (WindowUDFImpl) equality from PartialEq, Hash

2 participants