mbutrovich commented on code in PR #14:
URL: https://github.com/apache/datafusion-iceberg/pull/14#discussion_r4087567604
##########
crates/datafusion/src/physical_plan/project.rs:
##########
@@ -181,9 +223,11 @@ impl std::fmt::Display for PartitionExpr {
impl std::hash::Hash for PartitionExpr {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
- // Two PartitionExpr are equal if they share the same calculator and
partition_spec Arcs
- Arc::as_ptr(&self.calculator).hash(state);
- Arc::as_ptr(&self.partition_spec).hash(state);
Review Comment:
I checked that the new `Hash` is consistent with `PartialEq` at the pinned
iceberg-rust rev. `Schema::eq` compares `schema_id`
([schema/mod.rs](https://github.com/apache/iceberg-rust/blob/665c64e48e8d33797ecb1a421f327edd9b024879/crates/iceberg/src/spec/schema/mod.rs#L80-L86))
and `PartitionSpec` derives `PartialEq` over `spec_id` and `fields`
([partition.rs](https://github.com/apache/iceberg-rust/blob/665c64e48e8d33797ecb1a421f327edd9b024879/crates/iceberg/src/spec/partition.rs#L65-L72)).
So two equal `PartitionExpr`s always have the same ids, and hashing only the
ids is sound. The value-based version looks right to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]