Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2819#discussion_r226188701
--- Diff:
core/src/main/java/org/apache/carbondata/core/datastore/chunk/store/impl/safe/SafeFixedLengthDimensionDataChunkStore.java
---
@@ -30,9 +35,52 @@
*/
private int columnValueSize;
- public SafeFixedLengthDimensionDataChunkStore(boolean isInvertedIndex,
int columnValueSize) {
+ private int numOfRows;
+
+ public SafeFixedLengthDimensionDataChunkStore(boolean isInvertedIndex,
int columnValueSize,
+ int numOfRows) {
super(isInvertedIndex);
this.columnValueSize = columnValueSize;
+ this.numOfRows = numOfRows;
+ }
+
+ @Override
+ public void fillVector(int[] invertedIndex, int[] invertedIndexReverse,
byte[] data,
+ ColumnVectorInfo vectorInfo) {
+ CarbonColumnVector vector = vectorInfo.vector;
+ fillVector(data, vectorInfo, vector);
+ }
+
+ private void fillVector(byte[] data, ColumnVectorInfo vectorInfo,
CarbonColumnVector vector) {
+ DataType dataType = vectorInfo.vector.getBlockDataType();
+ if (dataType == DataTypes.DATE) {
+ for (int i = 0; i < numOfRows; i++) {
+ int surrogateInternal =
+ CarbonUtil.getSurrogateInternal(data, i * columnValueSize,
columnValueSize);
+ if (surrogateInternal == 1) {
+ vector.putNull(i);
+ } else {
+ vector.putInt(i, surrogateInternal -
DateDirectDictionaryGenerator.cutOffDate);
+ }
+ }
+ } else if (dataType == DataTypes.TIMESTAMP) {
+ for (int i = 0; i < numOfRows; i++) {
+ int surrogateInternal =
+ CarbonUtil.getSurrogateInternal(data, i * columnValueSize,
columnValueSize);
+ if (surrogateInternal == 1) {
--- End diff --
Replace 1 with `CarbonCommonConstants.MEMBER_DEFAULT_VAL_SURROGATE_KEY`
---