Github user manishgupta88 commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2841#discussion_r227241237 --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/page/VarLengthColumnPageBase.java --- @@ -125,46 +126,48 @@ public void setDoublePage(double[] doubleData) { * Create a new column page for decimal page */ static ColumnPage newDecimalColumnPage(TableSpec.ColumnSpec columnSpec, byte[] lvEncodedBytes, - String compressorName) throws MemoryException { + String compressorName, boolean isUnsafe) throws MemoryException { DecimalConverterFactory.DecimalConverter decimalConverter = DecimalConverterFactory.INSTANCE.getDecimalConverter(columnSpec.getPrecision(), columnSpec.getScale()); int size = decimalConverter.getSize(); if (size < 0) { return getLVBytesColumnPage(columnSpec, lvEncodedBytes, DataTypes.createDecimalType(columnSpec.getPrecision(), columnSpec.getScale()), - CarbonCommonConstants.INT_SIZE_IN_BYTE, compressorName); + CarbonCommonConstants.INT_SIZE_IN_BYTE, compressorName, isUnsafe); } else { // Here the size is always fixed. - return getDecimalColumnPage(columnSpec, lvEncodedBytes, size, compressorName); + return getDecimalColumnPage(columnSpec, lvEncodedBytes, size, compressorName, isUnsafe); } } /** * Create a new column page based on the LV (Length Value) encoded bytes */ static ColumnPage newLVBytesColumnPage(TableSpec.ColumnSpec columnSpec, byte[] lvEncodedBytes, - int lvLength, String compressorName) throws MemoryException { + int lvLength, String compressorName, boolean isUnsafe) throws MemoryException { return getLVBytesColumnPage(columnSpec, lvEncodedBytes, DataTypes.BYTE_ARRAY, - lvLength, compressorName); + lvLength, compressorName, isUnsafe); } /** * Create a new column page based on the LV (Length Value) encoded bytes */ static ColumnPage newComplexLVBytesColumnPage(TableSpec.ColumnSpec columnSpec, - byte[] lvEncodedBytes, int lvLength, String compressorName) throws MemoryException { + byte[] lvEncodedBytes, int lvLength, String compressorName, boolean isUnsafe) + throws MemoryException { return getComplexLVBytesColumnPage(columnSpec, lvEncodedBytes, DataTypes.BYTE_ARRAY, - lvLength, compressorName); + lvLength, compressorName, isUnsafe); } private static ColumnPage getDecimalColumnPage(TableSpec.ColumnSpec columnSpec, - byte[] lvEncodedBytes, int size, String compressorName) throws MemoryException { + byte[] lvEncodedBytes, int size, String compressorName, boolean unsafe) + throws MemoryException { TableSpec.ColumnSpec spec = TableSpec.ColumnSpec .newInstance(columnSpec.getFieldName(), DataTypes.INT, ColumnType.MEASURE); ColumnPage rowOffset = ColumnPage.newPage( new ColumnPageEncoderMeta(spec, DataTypes.INT, compressorName), - CarbonV3DataFormatConstants.NUMBER_OF_ROWS_PER_BLOCKLET_COLUMN_PAGE_DEFAULT); + CarbonV3DataFormatConstants.NUMBER_OF_ROWS_PER_BLOCKLET_COLUMN_PAGE_DEFAULT, unsafe); --- End diff -- change the flag name `unsafe --> isUnsafe`, same as done in the above the changes. Keep the flag name consistent everywhere
---