Skip to content

Commit d32c901

Browse files
fix some comments
1 parent a7642db commit d32c901

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

fluss-common/src/main/java/org/apache/fluss/row/BinaryArray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ public static BinaryArray fromPrimitiveArray(double[] arr) {
606606
private static BinaryArray fromPrimitiveArray(
607607
Object arr, int offset, int length, int elementSize) {
608608
final long headerInBytes = calculateHeaderInBytes(length);
609-
final long valueRegionInBytes = (long) elementSize * length;
609+
final long valueRegionInBytes = ((long) elementSize) * length;
610610

611611
// must align by 8 bytes
612612
long totalSizeInLongs = (headerInBytes + valueRegionInBytes + 7) / 8;

fluss-common/src/main/java/org/apache/fluss/row/BinaryMap.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,20 @@ public BinaryMap copy(BinaryMap reuse) {
133133
return reuse;
134134
}
135135

136+
@Override
137+
public boolean equals(Object o) {
138+
if (this == o) {
139+
return true;
140+
}
141+
if (!(o instanceof BinaryMap)) {
142+
return false;
143+
}
144+
final BinarySection that = (BinarySection) o;
145+
return sizeInBytes == that.sizeInBytes
146+
&& BinarySegmentUtils.equals(
147+
segments, offset, that.segments, that.offset, sizeInBytes);
148+
}
149+
136150
@Override
137151
public int hashCode() {
138152
return BinarySegmentUtils.hash(segments, offset, sizeInBytes);

fluss-common/src/main/java/org/apache/fluss/row/GenericMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public static GenericMap of(Object... values) {
139139

140140
java.util.Map<Object, Object> javaMap = new java.util.LinkedHashMap<>();
141141
for (int i = 0; i < values.length; i += 2) {
142-
javaMap.put(values[i], (i + 1 < values.length) ? values[i + 1] : null);
142+
javaMap.put(values[i], values[i + 1]);
143143
}
144144
return new GenericMap(javaMap);
145145
}

0 commit comments

Comments
 (0)