Skip to content

Commit 0026882

Browse files
committed
use MinorType and check isSet
1 parent e58c158 commit 0026882

File tree

7 files changed

+15
-7
lines changed

7 files changed

+15
-7
lines changed

java/vector/src/main/codegen/templates/UnionVector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ public boolean equals(int index, ValueVector to, int toIndex) {
665665
if (to == null) {
666666
return false;
667667
}
668-
if (this.getClass() != to.getClass()) {
668+
if (this.getMinorType() != to.getMinorType()) {
669669
return false;
670670
}
671671
UnionVector that = (UnionVector) to;

java/vector/src/main/java/org/apache/arrow/vector/BaseFixedWidthVector.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,12 +870,16 @@ public boolean equals(int index, ValueVector to, int toIndex) {
870870
if (to == null) {
871871
return false;
872872
}
873-
if (this.getClass() != to.getClass()) {
873+
if (this.getMinorType() != to.getMinorType()) {
874874
return false;
875875
}
876876

877877
BaseFixedWidthVector that = (BaseFixedWidthVector) to;
878878

879+
if (this.isSet(index) != that.isSet(index)) {
880+
return false;
881+
}
882+
879883
int leftStart = typeWidth * index;
880884
int leftEnd = typeWidth * (index + 1);
881885

java/vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthVector.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,12 +1369,16 @@ public boolean equals(int index, ValueVector to, int toIndex) {
13691369
if (to == null) {
13701370
return false;
13711371
}
1372-
if (this.getClass() != to.getClass()) {
1372+
if (this.getMinorType() != to.getMinorType()) {
13731373
return false;
13741374
}
13751375

13761376
BaseVariableWidthVector that = (BaseVariableWidthVector) to;
13771377

1378+
if (this.isSet(index) != that.isSet(index)) {
1379+
return false;
1380+
}
1381+
13781382
final int leftStart = getStartOffset(index);
13791383
final int leftEnd = getStartOffset(index + 1);
13801384

java/vector/src/main/java/org/apache/arrow/vector/ValueVector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ default boolean equals(ValueVector target) {
282282
if (this == target) {
283283
return true;
284284
}
285-
if (target == null || this.getClass() != target.getClass()) {
285+
if (target == null || this.getMinorType() != target.getMinorType()) {
286286
return false;
287287
}
288288

java/vector/src/main/java/org/apache/arrow/vector/complex/FixedSizeListVector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ public boolean equals(int index, ValueVector to, int toIndex) {
520520
if (to == null) {
521521
return false;
522522
}
523-
if (this.getClass() != to.getClass()) {
523+
if (this.getMinorType() != to.getMinorType()) {
524524
return false;
525525
}
526526

java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ public boolean equals(int index, ValueVector to, int toIndex) {
430430
if (to == null) {
431431
return false;
432432
}
433-
if (this.getClass() != to.getClass()) {
433+
if (this.getMinorType() != to.getMinorType()) {
434434
return false;
435435
}
436436

java/vector/src/main/java/org/apache/arrow/vector/complex/NonNullableStructVector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public boolean equals(int index, ValueVector to, int toIndex) {
303303
if (to == null) {
304304
return false;
305305
}
306-
if (this.getClass() != to.getClass()) {
306+
if (this.getMinorType() != to.getMinorType()) {
307307
return false;
308308
}
309309
NonNullableStructVector that = (NonNullableStructVector) to;

0 commit comments

Comments
 (0)