Skip to content

Conversation

@Jefffrey
Copy link
Contributor

@Jefffrey Jefffrey commented Oct 2, 2025

Clearing a TODO item I noticed, since we're now MSRV of 1.87.0:

datafusion/Cargo.toml

Lines 78 to 79 in 3ee52f8

# Define Minimum Supported Rust Version (MSRV)
rust-version = "1.87.0"

Utilize dyn_eq and dyn_hash via trait upcasting. There is a slight change in behaviour given the pointers inside the Arcs aren't being compared anymore, see comment.

@github-actions github-actions bot added the logical-expr Logical plan and expressions label Oct 2, 2025
Comment on lines 231 to 237
// Inner is distinct arc -> still equal
let a = AsyncScalarUDF::new(Arc::new(TestAsyncUDFImpl1 { a: 1 }));
let b = AsyncScalarUDF::new(Arc::new(TestAsyncUDFImpl1 { a: 1 }));
assert_eq!(a, b);
let mut set = HashSet::new();
set.insert(a);
assert!(set.contains(&b));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test would have failed before; it succeeding is new behaviour introduced by this change.

@Jefffrey Jefffrey marked this pull request as ready for review October 2, 2025 08:45
@Jefffrey Jefffrey requested a review from findepi October 2, 2025 08:45
Copy link
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

This is really a nice chance!

Couple editorial comments

}

#[test]
fn udf_equality_and_hash() {
Copy link
Member

Choose a reason for hiding this comment

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

it's generally beneficial to test eq, hash and ord together, because their contracts are closely related
see existing test_partial_eq_hash_and_partial_ord for example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I notice we don't have PartialOrd impl for AsyncScalarUDF; should we just copy the implementation from ScalarUDF and implement it in this PR?

Copy link
Member

Choose a reason for hiding this comment

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

No, let's not add it here.

@findepi findepi added this pull request to the merge queue Oct 5, 2025
Merged via the queue into apache:main with commit bcbc632 Oct 5, 2025
28 checks passed
@Jefffrey Jefffrey deleted the async-udf-upcast-todo branch October 6, 2025 03:40
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.

2 participants