ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r478227589 ########## File path: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java ########## @@ -260,4 +265,65 @@ protected String debugInfo() { return this.toString(); } + public static VectorUtil checkAndUpdateToChildVector(ColumnVectorInfo vectorInfo, int pageSize, + CarbonColumnVector vector, DataType vectorDataType) { + VectorUtil vectorUtil = new VectorUtil(pageSize, vector, vectorDataType); + Stack<CarbonColumnVector> vectorStack = vectorInfo.getVectorStack(); + // check and update to child vector info + if (vectorStack != null && vectorStack.peek() != null && vectorDataType.isComplexType()) { + if (DataTypes.isArrayType(vectorDataType)) { + List<Integer> childElementsCountForEachRow = + ((CarbonColumnVectorImpl) vector.getColumnVector()) + .getNumberOfChildrenElementsInEachRow(); + int newPageSize = 0; + for (int childElementsCount : childElementsCountForEachRow) { + newPageSize += childElementsCount; + } + vectorUtil.setPageSize(newPageSize); + } + // child vector flow, so fill the child vector + CarbonColumnVector childVector = vectorStack.pop(); + vectorUtil.setVector(childVector); + vectorUtil.setVectorDataType(childVector.getType()); + } + return vectorUtil; + } + + // Utility class to update current vector to child vector in case of complex type handling + public static class VectorUtil { + private int pageSize; + private CarbonColumnVector vector; + private DataType vectorDataType; + + private VectorUtil(int pageSize, CarbonColumnVector vector, DataType vectorDataType) { + this.pageSize = pageSize; + this.vector = vector; + this.vectorDataType = vectorDataType; + } + + public int getPageSize() { Review comment: removed this whole class itself and updating vector inside **ColumnarVectorWrapperDirectFactory .getDirectVectorWrapperFactory** ########## File path: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java ########## @@ -260,4 +265,52 @@ protected String debugInfo() { return this.toString(); } + // Utility class to update current vector to child vector in case of complex type handling + public static class VectorUtil { Review comment: removed this whole class itself and updating vector inside **ColumnarVectorWrapperDirectFactory .getDirectVectorWrapperFactory** ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r478227936 ########## File path: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java ########## @@ -260,4 +265,52 @@ protected String debugInfo() { return this.toString(); } + // Utility class to update current vector to child vector in case of complex type handling + public static class VectorUtil { + private ColumnVectorInfo vectorInfo; + private int pageSize; + private CarbonColumnVector vector; + private DataType vectorDataType; + + public VectorUtil(ColumnVectorInfo vectorInfo, int pageSize, CarbonColumnVector vector, + DataType vectorDataType) { + this.vectorInfo = vectorInfo; + this.pageSize = pageSize; + this.vector = vector; + this.vectorDataType = vectorDataType; + } + + public int getPageSize() { + return pageSize; + } + + public CarbonColumnVector getVector() { + return vector; + } + + public DataType getVectorDataType() { + return vectorDataType; + } + + public VectorUtil checkAndUpdateToChildVector() { Review comment: removed this whole class itself and updating vector inside **ColumnarVectorWrapperDirectFactory .getDirectVectorWrapperFactory** ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-681843843 Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3886/ ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-681845433 Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/2145/ ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-681891693 Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/2148/ ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-681894212 Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3889/ ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r478367442 ########## File path: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/compress/DirectCompressCodec.java ########## @@ -376,6 +456,56 @@ private void fillVector(byte[] pageData, CarbonColumnVector vector, DataType vec DecimalConverterFactory.DecimalConverter decimalConverter = vectorInfo.decimalConverter; decimalConverter.fillVector(pageData, pageSize, vectorInfo, nullBits, pageDataType); } + } else if (pageDataType == DataTypes.BYTE_ARRAY) { + if (vectorDataType == DataTypes.STRING || vectorDataType == DataTypes.BINARY + || vectorDataType == DataTypes.VARCHAR) { + // for complex primitive string, binary, varchar type + int offset = 0; + for (int i = 0; i < pageSize; i++) { + byte[] stringLen = new byte[DataTypes.INT.getSizeInBytes()]; Review comment: done ########## File path: core/src/main/java/org/apache/carbondata/core/scan/executor/impl/AbstractQueryExecutor.java ########## @@ -98,6 +98,9 @@ */ protected CarbonIterator queryIterator; + // Size of the ReusableDataBuffer based on the number of dimension projection columns + protected int reusableDimensionBufferSize = 0; Review comment: done ########## File path: core/src/main/java/org/apache/carbondata/core/scan/result/BlockletScannedResult.java ########## @@ -153,6 +154,9 @@ private ReusableDataBuffer[] measureReusableBuffer; + // index used by dimensionReusableBuffer + int dimensionReusableBufferIndex = 0; Review comment: done ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r478374714 ########## File path: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java ########## @@ -260,4 +265,65 @@ protected String debugInfo() { return this.toString(); } + public static VectorUtil checkAndUpdateToChildVector(ColumnVectorInfo vectorInfo, int pageSize, + CarbonColumnVector vector, DataType vectorDataType) { + VectorUtil vectorUtil = new VectorUtil(pageSize, vector, vectorDataType); + Stack<CarbonColumnVector> vectorStack = vectorInfo.getVectorStack(); + // check and update to child vector info + if (vectorStack != null && vectorStack.peek() != null && vectorDataType.isComplexType()) { Review comment: Objects.isnull and Objects.nonNull is internally just doing the same. For just "if check" it is not much useful (We have not used in our code for if checks also anywhere) **I will use it in the future if I use streams.** ![Screenshot from 2020-08-27 17-43-51](https://user-images.githubusercontent.com/5889404/91441253-7d649d00-e88d-11ea-8d30-aa73af1cd7d6.png) ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
ajantha-bhat commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-681914750 > So for complex type user must configure table page size to get the better query performance while creating the table. @kumarvishal09: I too strongly agree that if user using complex type with huge data in one row, page size is mandatory to use. If I make it default now, some testcase validation will fail (example CLI test case which are checking page size), I will handle in another PR. ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-681965099 Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3892/ ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-681969792 Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/2151/ ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r478855152 ########## File path: core/src/main/java/org/apache/carbondata/core/scan/result/vector/impl/CarbonColumnVectorImpl.java ########## @@ -102,6 +109,57 @@ public CarbonColumnVectorImpl(int batchSize, DataType dataType) { } + @Override + public List<CarbonColumnVector> getChildrenVector() { + return childrenVector; + } + + public void setChildrenVector(ArrayList<CarbonColumnVector> childrenVector) { + this.childrenVector = childrenVector; + } + + public ArrayList<Integer> getNumberOfChildrenElementsInEachRow() { + return childElementsForEachRow; + } + + public void setNumberOfChildrenElementsInEachRow(ArrayList<Integer> childrenElements) { + this.childElementsForEachRow = childrenElements; + } + + public void setNumberOfChildrenElementsForArray(byte[] childPageData, int pageSize) { + // for complex array type, go through parent page to get the child information + ByteBuffer childInfoBuffer = ByteBuffer.wrap(childPageData); + ArrayList<Integer> childElementsForEachRow = new ArrayList<>(); + // osset will be an INT size and value will be another INT size, hence 2 * INT size Review comment: added ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r478855676 ########## File path: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java ########## @@ -255,6 +255,12 @@ public void decodeAndFillVector(byte[] pageData, ColumnVectorInfo vectorInfo, Bi CarbonColumnVector vector = vectorInfo.vector; BitSet deletedRows = vectorInfo.deletedRows; DataType vectorDataType = vector.getType(); + VectorUtil vectorUtil = new VectorUtil(vectorInfo, pageSize, vector, vectorDataType) Review comment: removed this whole class itself and updating vector inside ColumnarVectorWrapperDirectFactory .getDirectVectorWrapperFactory ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r478856181 ########## File path: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveCodec.java ########## @@ -260,4 +265,65 @@ protected String debugInfo() { return this.toString(); } + public static VectorUtil checkAndUpdateToChildVector(ColumnVectorInfo vectorInfo, int pageSize, + CarbonColumnVector vector, DataType vectorDataType) { + VectorUtil vectorUtil = new VectorUtil(pageSize, vector, vectorDataType); + Stack<CarbonColumnVector> vectorStack = vectorInfo.getVectorStack(); + // check and update to child vector info + if (vectorStack != null && vectorStack.peek() != null && vectorDataType.isComplexType()) { Review comment: **Also initialized the stack always, checking for empty now. no null check is present** ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
ajantha-bhat commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-682351651 @kumarvishal09 : PR is ready. Please check and merge once build passed. Also I have prepared the commit message with co-authored by @akkio-97 . Please use the same commit message. Thanks ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-682393514 Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/3903/ ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
CarbonDataQA1 commented on pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#issuecomment-682412709 Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/2162/ ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
kumarvishal09 commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r479656097 ########## File path: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java ########## @@ -282,6 +288,12 @@ public void decodeAndFillVector(byte[] pageData, ColumnVectorInfo vectorInfo, Bi for (int i = 0; i < size; i += DataTypes.INT.getSizeInBytes()) { vector.putFloat(rowId++, (max - ByteUtil.toIntLittleEndian(pageData, i)) / floatFactor); } + } else if (pageDataType == DataTypes.LONG) { Review comment: Can u pls raise a jira for above issue ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
ajantha-bhat commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r479656578 ########## File path: core/src/main/java/org/apache/carbondata/core/datastore/page/encoding/adaptive/AdaptiveDeltaFloatingCodec.java ########## @@ -282,6 +288,12 @@ public void decodeAndFillVector(byte[] pageData, ColumnVectorInfo vectorInfo, Bi for (int i = 0; i < size; i += DataTypes.INT.getSizeInBytes()) { vector.putFloat(rowId++, (max - ByteUtil.toIntLittleEndian(pageData, i)) / floatFactor); } + } else if (pageDataType == DataTypes.LONG) { Review comment: jira is created https://issues.apache.org/jira/browse/CARBONDATA-3965 ---------------------------------------------------------------- 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: [hidden email] |
In reply to this post by GitBox
kumarvishal09 commented on a change in pull request #3887: URL: https://github.com/apache/carbondata/pull/3887#discussion_r479656884 ########## File path: core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java ########## @@ -187,6 +197,43 @@ public void fillVector(Object valuesToBeConverted, int size, vector.putDecimal(i, value, precision); } } + } else if (pageType == DataTypes.BYTE_ARRAY) { + // complex primitive decimal dimension + int offset = 0; + for (int j = 0; j < size; j++) { + // here decimal data will be Length[4 byte], scale[1 byte], value[Length byte] + int len = ByteBuffer.wrap(data, offset, DataTypes.INT.getSizeInBytes()).getInt(); + offset += DataTypes.INT.getSizeInBytes(); Review comment: DataTypes.INT.getSizeInBytes), It’s better to assign to some variable and use it inside loop, instead calling method every time ---------------------------------------------------------------- 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: [hidden email] |
Free forum by Nabble | Edit this page |