Skip to content

Commit

Permalink
[CARBONDATA-2940]Fix BufferUnderFlowException for ComplexPushDown
Browse files Browse the repository at this point in the history
Problem:
BufferUnderFlow Exception was thrown, as buffer data was filled with wrong values.
Solution:
Check for if column is of Primitive Dimension column with ComplexParentOrdinal = -1 and not Complex and increment Buffer index for NoDictionaryKeys.

This closes #2727
  • Loading branch information
Indhumathi27 authored and kunal642 committed Sep 18, 2018
1 parent 02a89a9 commit 61fcdf2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Expand Up @@ -213,7 +213,7 @@ private void initiateFallBack(EncodedColumnPage encodedColumnPage, int pageIndex
new DecoderBasedFallbackEncoder(encodedColumnPage, pageIndex, localDictionaryGenerator)));
} else {
fallbackFutureQueue.add(fallbackExecutorService.submit(
new ActualDataBasedFallbackEncoder(encodedColumnPage, encodedColumnPageList.size())));
new ActualDataBasedFallbackEncoder(encodedColumnPage, pageIndex)));
}
}
}
Expand Up @@ -231,6 +231,9 @@ private void fillComplexColumnDataBufferForThisRow() {
childColumnByteBuffer
.put(queryDimensions[i].getDimension(), buffer);
mergedComplexDimensionDataMap.put(complexParentOrdinal, childColumnByteBuffer);
} else if (!queryDimensions[i].getDimension().isComplex()) {
// If Dimension is not a Complex Column, then increment index for noDictionaryComplexColumn
noDictionaryComplexColumnIndex++;
}
}
}
Expand Down
Expand Up @@ -1015,6 +1015,9 @@ class TestComplexDataType extends QueryTest with BeforeAndAfterAll {
"create table table1 (id int, name string, structField struct<intval:int, stringval:string>) stored by 'carbondata'")
sql("insert into table1 values(null,'aaa','23$bb')")
checkAnswer(sql("select * from table1"),Seq(Row(null,"aaa", Row(23,"bb"))))
checkAnswer(sql("select id,name,structField.intval,structField.stringval from table1"),Seq(Row(null,"aaa",23,"bb")))
checkAnswer(sql("select id,name,structField.intval,structField.stringval,name from table1"),Seq(Row(null,"aaa",23,"bb","aaa")))
checkAnswer(sql("select id,name,structField.intval,name,structField.stringval from table1"),Seq(Row(null,"aaa",23,"aaa","bb")))
}

}

0 comments on commit 61fcdf2

Please sign in to comment.