guiyanakuang commented on PR #1960:
URL: https://github.com/apache/orc/pull/1960#issuecomment-2208881314
```
private void setIsRepeatingIfNeeded(DecimalColumnVector result, int
index) {
if (result.isRepeating && index > 0 &&
(!result.vector[0].equals(result.vector[index]) ||
result.isNull[0] != result.isNull[index])) {
result.isRepeating = false;
}
}
```
`result.vector[0].equals(result.vector[index])` We cannot directly perform
this check because:
```
public DecimalColumnVector(int size, int precision, int scale) {
super(Type.DECIMAL, size);
this.precision = (short) precision;
this.scale = (short) scale;
vector = new HiveDecimalWritable[size];
for (int i = 0; i < size; i++) {
vector[i] = new HiveDecimalWritable(0); // Initially zero.
}
}
```
The initial value `new HiveDecimalWritable(0)` will be used, and we can only
use `result.vector[0]` for comparison after ensuring `result.isNull[0] ==
false`.
cc @cxzl25
--
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]