You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Derive ScalarUDFImpl equality, hash from Eq, Hash traits (#17164)
* Remove redundant JsonGetStr::aliases field
* Derive `ScalarUDFImpl` equality, hash from `Eq`, `Hash` traits
Follows similar change for `WindowUDFImpl` and `AggregateUDFImpl`, i.e.
the 8494a39 and
b8bf7c5 commits.
Previously, the `ScalarUDFImpl` trait contained `equals` and
`hash_value` methods with contracts following the `Eq` and `Hash`
traits. However, the existence of default implementations of these
methods made it error-prone, with many functions (scalar, aggregate,
window) missing to customize the equals even though they ought to.
There is no fix to this that's not an API breaking change, so a breaking
change is warranted.
Removing the default implementations would be enough of a solution, but
at the cost of a lot of boilerplate needed in implementations.
Instead, this removes the methods from the trait, and reuses `DynEq`,
`DynHash` traits used previously only for physical expressions. This
allows for functions to provide their implementations using no more than
`#[derive(PartialEq, Eq, Hash)]` in a typical case.
0 commit comments