ajantha-bhat commented on a change in pull request #3773:
URL: https://github.com/apache/carbondata/pull/3773#discussion_r467095038



##########
File path: 
core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java
##########
@@ -246,7 +239,29 @@ public void decodeAndFillVector(byte[] pageData, 
ColumnVectorInfo vectorInfo, Bi
       vector = ColumnarVectorWrapperDirectFactory
           .getDirectVectorWrapperFactory(vector, vectorInfo.invertedIndex, 
nullBits, deletedRows,
               true, false);
-      fillVector(pageData, vector, vectorDataType, pageDataType, pageSize, 
vectorInfo, nullBits);
+      Deque<CarbonColumnVectorImpl> vectorStack = vectorInfo.getVectorStack();
+      // Only if vectorStack is null, it is initialized with the parent vector
+      if (vectorStack == null && vectorInfo.vector.getColumnVector() != null) {
+        vectorStack = new ArrayDeque<>();
+        // pushing the parent vector
+        vectorStack.push((CarbonColumnVectorImpl) 
vectorInfo.vector.getColumnVector());
+        vectorInfo.setVectorStack(vectorStack);
+      }
+      /*
+       * if top of vector stack is a complex vector then
+       * add their children into the stack and load them too.
+       * TODO: If there are multiple children push them into stack and load 
them iteratively
+       */
+      if (vectorStack != null && vectorStack.peek().isComplex()) {
+        vectorStack.peek().setChildrenElements(pageData);
+        vectorStack.push(vectorStack.peek().getChildrenVector().get(0));
+        vectorStack.peek().loadPage();
+        return;
+      }
+
+      FillVector fill = new FillVector(pageData, vectorInfo, nullBits);
+      fill.basedOnType(vector, vectorDataType, pageSize, pageDataType);
+

Review comment:
       pop from the stack as child is processed 




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

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


Reply via email to