cxzl25 commented on code in PR #1960:
URL: https://github.com/apache/orc/pull/1960#discussion_r1665268089


##########
java/core/src/java/org/apache/orc/impl/TreeReaderFactory.java:
##########
@@ -1562,7 +1563,11 @@ private void nextVector(DecimalColumnVector result,
           }
           setIsRepeatingIfNeeded(result, r);
         }
+        if (!preIsRepeating && result.isRepeating) {

Review Comment:
   This is just a draft PR, it should not be considered a bug.
   
   When we convert the same value of the same batch size into 
`isRepeating=true`, the two should be equivalent.
   
   I'm not sure why this behavior will affect the calculation results of Hiive. 
I repeatedly debugged this in Hive, but I didn't find the root cause.
   
   ```java
       DecimalColumnVector v1 = new DecimalColumnVector(1024, 10, 2);
       v1.isRepeating = true;
       v1.vector[0] = new HiveDecimalWritable("1.234");
   
       DecimalColumnVector v2 = new DecimalColumnVector(1024, 10, 2);
       for (int i = 0; i < 1024; i++) {
         v2.vector[i] = new HiveDecimalWritable("1.234");
       }
   
       StringBuilder sb1 = new StringBuilder();
       for (int i = 0; i < 1024; i++) {
         v1.stringifyValue(sb1, i);
       }
       StringBuilder sb2 = new StringBuilder();
       for (int i = 0; i < 1024; i++) {
         v2.stringifyValue(sb2, i);
       }
       System.out.println(sb1.toString().equals(sb2.toString()));
   ```



-- 
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]

Reply via email to