dongjoon-hyun commented on code in PR #1244:
URL: https://github.com/apache/orc/pull/1244#discussion_r972710768
##########
java/core/src/java/org/apache/orc/impl/TreeReaderFactory.java:
##########
@@ -1708,6 +1724,32 @@ private void nextVector(Decimal64ColumnVector result,
result.scale = (short) scale;
}
+ private void setIsRepeatingIfNeeded(Decimal64ColumnVector result, int
index) {
+ if (result.isRepeating
+ && index > 0
+ && (result.vector[0] != result.vector[index] ||
+ result.isNull[0] != result.isNull[index])) {
+ result.isRepeating = false;
+ }
+ }
+
+ private void setIsRepeatingIfNeeded(DecimalColumnVector result, int index)
{
+ if (result.isRepeating
+ && index > 0
+ && (!eq(result.vector[0], result.vector[index]) ||
+ result.isNull[0] != result.isNull[index])) {
+ result.isRepeating = false;
+ }
+ }
+
+ private boolean eq(HiveDecimalWritable first, HiveDecimalWritable other) {
Review Comment:
Is there a reason why we cannot use `HiveDecimalWritable.equals` here?
-
https://github.com/apache/hive/blob/293a448296933b7498a91e7eeb91edc88dfaa07e/storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java#L1003-L1019
```java
public boolean equals(Object other) {
if (!isSet) {
return false;
}
if (this == other) {
return true;
}
if (other == null || getClass() != other.getClass()) {
return false;
}
HiveDecimalWritable otherHiveDecWritable = (HiveDecimalWritable) other;
if (!otherHiveDecWritable.isSet()) {
return false;
}
return fastEquals((FastHiveDecimal) otherHiveDecWritable);
}
```
--
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]