Posted by
GitBox on
Jun 03, 2021; 5:45am
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-ShreelekhyaG-opened-a-new-pull-request-4142-WIP-Fix-compaction-failure-after-alter-tp108434p108551.html
ShreelekhyaG commented on a change in pull request #4142:
URL:
https://github.com/apache/carbondata/pull/4142#discussion_r644500710##########
File path: integration/spark/src/main/java/org/apache/spark/sql/secondaryindex/query/SecondaryIndexQueryResultProcessor.java
##########
@@ -293,26 +300,32 @@ private void processResult(List<CarbonIterator<RowBatch>> detailQueryResultItera
// dictionary
preparedRow[i] = wrapper.getDictionaryKeyByIndex(dictionaryIndex++);
} else {
- if (isComplexColumn) {
- // get the flattened data of complex column
- byte[] complexKeyByIndex = wrapper.getComplexKeyByIndex(complexIndex);
- ByteBuffer byteArrayInput = ByteBuffer.wrap(complexKeyByIndex);
- GenericQueryType genericQueryType =
- complexDimensionInfoMap.get(complexColumnParentBlockIndexes[complexIndex++]);
- int complexDataLength = byteArrayInput.getShort(2);
- // In case, if array is empty
- if (complexDataLength == 0) {
- complexDataLength = complexDataLength + 1;
- }
- // get flattened array data
- Object[] complexFlattenedData = new Object[complexDataLength];
- Object[] data = genericQueryType.getObjectArrayDataBasedOnDataType(byteArrayInput);
- for (int index = 0; index < complexDataLength; index++) {
- complexFlattenedData[index] =
- getData(data, index, dims.getColumnSchema().getDataType());
+ if (isComplexColumn || isComplexColumnAdded) {
+ if (complexColumnParentBlockIndexes.length > 0) {
+ // get the flattened data of complex column
+ byte[] complexKeyByIndex = wrapper.getComplexKeyByIndex(complexIndex);
+ ByteBuffer byteArrayInput = ByteBuffer.wrap(complexKeyByIndex);
+ GenericQueryType genericQueryType =
+ complexDimensionInfoMap.get(complexColumnParentBlockIndexes[complexIndex++]);
+ int complexDataLength = byteArrayInput.getShort(2);
+ // In case, if array is empty
+ if (complexDataLength == 0) {
+ complexDataLength = complexDataLength + 1;
+ }
+ // get flattened array data
+ Object[] complexFlattenedData = new Object[complexDataLength];
+ Object[] data = genericQueryType.getObjectArrayDataBasedOnDataType(byteArrayInput);
+ for (int index = 0; index < complexDataLength; index++) {
+ complexFlattenedData[index] =
+ getData(data, index, dims.getColumnSchema().getDataType());
+ }
+ // store the dimesnion column index and the complex column flattened data to a map
+ complexDataMap.put(i, complexFlattenedData);
+ } else {
+ // when complex column is added after restructuring and
+ // column not present in parent block, let the SI row value be empty.
Review comment:
ok, edited comment.
--
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]