You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/01/26 20:48:15 UTC

[GitHub] [hive] soumyakanti3578 commented on a change in pull request #2970: HIVE-25893: NPE when reading Parquet data because ColumnVector isNull[] is not updated

soumyakanti3578 commented on a change in pull request #2970:
URL: https://github.com/apache/hive/pull/2970#discussion_r793035137



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/io/parquet/vector/VectorizedListColumnReader.java
##########
@@ -500,22 +501,37 @@ private boolean compareDecimalColumnVector(DecimalColumnVector cv1, DecimalColum
   private boolean compareBytesColumnVector(BytesColumnVector cv1, BytesColumnVector cv2) {
     int length1 = cv1.vector.length;
     int length2 = cv2.vector.length;
-    if (length1 == length2) {
-      for (int i = 0; i < length1; i++) {
-        int innerLen1 = cv1.vector[i].length;
-        int innerLen2 = cv2.vector[i].length;
-        if (innerLen1 == innerLen2) {
-          for (int j = 0; j < innerLen1; j++) {
-            if (cv1.vector[i][j] != cv2.vector[i][j]) {
-              return false;
-            }
-          }
-        } else {
+    if (length1 != length2) {
+      return false;
+    }
+
+    for (int i = 0; i < length1; i++) {
+      // check for different nulls
+      if (columnVectorsDifferNullForSameIndex(cv1, cv2, i)) {
+        return false;
+      }
+
+      // if they are both null, continue
+      // else if one of them is null, return false
+      if (cv1.isNull[i] && cv2.isNull[i]) {
+        continue;
+      } else if (cv1.isNull[i] || cv2.isNull[i]) {

Review comment:
       Thanks @kasakrisz! Removed it.




-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org