maswin commented on code in PR #4389:
URL: https://github.com/apache/hive/pull/4389#discussion_r1228632692


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorMapOperator.java:
##########
@@ -821,30 +827,30 @@ private boolean deliverVectorizedRowBatch(Writable value) 
throws HiveException {
    *
    * See {@link #setupPartitionContextVars(Path)}
    */
-  private void resetVectorizedRowBatchForDeserialize() {
+  private void resetVectorizedRowBatch(VectorizedRowBatch rowBatch) {
     /**
      * Reset existing input columns
      */
     for (int c = 0; c < currentDataColumnCount; c++) {
-      resetColumnVector(deserializerBatch.cols[c]);
+      resetColumnVector(rowBatch.cols[c]);
     }
 
     /**
      * Reset output and scratch columns
      */
-    for (int c = dataColumnCount + partitionColumnCount; c < 
deserializerBatch.cols.length; c++) {
+    for (int c = dataColumnCount + partitionColumnCount; c < 
rowBatch.cols.length; c++) {
       if (c == rowIdentifierColumnNum) {
         continue;
       }
-      resetColumnVector(deserializerBatch.cols[c]);
+      resetColumnVector(rowBatch.cols[c]);
     }
-    deserializerBatch.selectedInUse = false;
-    deserializerBatch.size = 0;
-    deserializerBatch.endOfFile = false;
+    rowBatch.selectedInUse = false;
+    rowBatch.size = 0;
+    rowBatch.endOfFile = false;
   }
 
   private void resetColumnVector(ColumnVector columnVector) {
-    if (columnVector != null) {
+    if (columnVector != null && columnVector.getRef() == 0) {

Review Comment:
   LLAP might cache some column vectors and reuse. refCount was added to 
ColumnVector to track how many references are there to the column vector - 
https://issues.apache.org/jira/browse/HIVE-21509
   
   EncodedDataConsumer also does a similar check 
-https://github.com/apache/hive/blob/f78ca5df80c0bcb566f0915cda65112268df492c/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/EncodedDataConsumer.java#L161
   
   So before resetting had to check if there are no references to 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to