You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2024/08/13 19:07:15 UTC

(spark) branch master updated: [SPARK-48760][SQL][FOLLOWUP] Override `hashCode` method for `TableChange.ClusterBy`

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new bfddd53d98da [SPARK-48760][SQL][FOLLOWUP] Override `hashCode` method for `TableChange.ClusterBy`
bfddd53d98da is described below

commit bfddd53d98da866b474464321e5b323a3df32e81
Author: yangjie01 <ya...@baidu.com>
AuthorDate: Tue Aug 13 12:07:04 2024 -0700

    [SPARK-48760][SQL][FOLLOWUP] Override `hashCode` method for `TableChange.ClusterBy`
    
    ### What changes were proposed in this pull request?
    This pr just overrides the `hashCode` method for the `TableChange.ClusterBy`
    
    ### Why are the changes needed?
    Conventionally, `hashCode` and `equals` should be overridden in pairs.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    Pass GitHub Actions
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #47738 from LuciferYang/SPARK-48760-FOLLOWUP.
    
    Authored-by: yangjie01 <ya...@baidu.com>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 .../java/org/apache/spark/sql/connector/catalog/TableChange.java     | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/TableChange.java b/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/TableChange.java
index 117f1748e209..d7a51c519e09 100644
--- a/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/TableChange.java
+++ b/sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/TableChange.java
@@ -781,5 +781,10 @@ public interface TableChange {
       ClusterBy that = (ClusterBy) o;
       return Arrays.equals(clusteringColumns, that.clusteringColumns());
     }
+
+    @Override
+    public int hashCode() {
+      return Arrays.hashCode(clusteringColumns);
+    }
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org