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

yiguolei pushed a commit to branch vector-index-dev
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 88ccab73ef96b89e5f39d901157d646517a44980
Author: morrySnow <zhangwen...@selectdb.com>
AuthorDate: Wed Apr 30 09:52:54 2025 +0800

    [fix](vector) equals and hashcode are wrong in olap relation (#50558)
---
 .../nereids/trees/plans/logical/LogicalOlapScan.java    | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java
index f31cc3e6f40..fae2e4bfba6 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalOlapScan.java
@@ -739,6 +739,9 @@ public class LogicalOlapScan extends LogicalCatalogRelation 
implements OlapScan
 
     @Override
     public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
         if (o == null || getClass() != o.getClass()) {
             return false;
         }
@@ -746,11 +749,21 @@ public class LogicalOlapScan extends 
LogicalCatalogRelation implements OlapScan
             return false;
         }
         LogicalOlapScan that = (LogicalOlapScan) o;
-        return Objects.equals(virtualColumns, that.virtualColumns);
+        return selectedIndexId == that.selectedIndexId && indexSelected == 
that.indexSelected
+                && partitionPruned == that.partitionPruned && 
Objects.equals(preAggStatus, that.preAggStatus)
+                && Objects.equals(selectedTabletIds, that.selectedTabletIds)
+                && Objects.equals(manuallySpecifiedPartitions, 
that.manuallySpecifiedPartitions)
+                && Objects.equals(manuallySpecifiedTabletIds, 
that.manuallySpecifiedTabletIds)
+                && Objects.equals(selectedPartitionIds, 
that.selectedPartitionIds)
+                && Objects.equals(hints, that.hints)
+                && Objects.equals(tableSample, that.tableSample)
+                && Objects.equals(virtualColumns, that.virtualColumns);
     }
 
     @Override
     public int hashCode() {
-        return super.hashCode();
+        return Objects.hash(super.hashCode(), selectedIndexId, indexSelected, 
preAggStatus, cacheSlotWithSlotName,
+                selectedTabletIds, partitionPruned, 
manuallySpecifiedTabletIds, manuallySpecifiedPartitions,
+                selectedPartitionIds, hints, tableSample, virtualColumns);
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to