LuciferYang opened a new pull request, #13233: URL: https://github.com/apache/gravitino/pull/13233
### What changes were proposed in this pull request? This removes the `default boolean equals(Distribution)` overload from the `Distribution` interface and adds `Distributions.isNone(Distribution)`, a structural NONE check that preserves the cross-representation (DTO/impl) semantics the overload provided at its call sites. All eleven call sites are migrated (common `DTOConverters`, the jdbc-mysql/postgresql/clickhouse/oceanbase/hologres and iceberg/delta/hive converters, the hive IT, and the trino `HiveMetadataAdapter`). The javadoc documents that implementations must override `equals(Object)`/`hashCode`. ### Why are the changes needed? The overload never overrode `Object.equals`, so the same objects compared through an `Object` reference (identity) and as `Distribution` (structural) could disagree, and implementations relying on the default got identity equality in collections. Fix: #13232 ### Does this PR introduce _any_ user-facing change? Yes. The public `default boolean equals(Distribution)` overload is removed from the `Distribution` interface, so implementers must override `equals(Object)`/`hashCode` (all in-repo implementations already do). `Distributions.isNone(Distribution)` is added. Behavior at the migrated call sites is unchanged. ### How was this patch tested? Added `TestDistributions`, which pins `Distributions.isNone` across DTO-NONE, impl-NONE, HASH, EVEN, and null (the cross-representation semantics the removed overload provided). The overload removal is enforced at compile time; because `isNone` is new, this test does not run against the pre-fix tree. -- 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]
