use of org.apache.carbondata.core.datastore.compression.MeasureMetaDataModel in project carbondata by apache.
the class ValueCompressionUtilTest method testToGetValueCompressionModelForDefaultAggregatorType.
@Test
public void testToGetValueCompressionModelForDefaultAggregatorType() {
Object[] maxValues = { 10.0 };
Object[] minValues = { 1.0 };
int[] decimalLength = { 0 };
Object[] uniqueValues = { 5 };
DataType[] types = { DataType.DOUBLE };
byte[] dataTypeSelected = { 1 };
MeasureMetaDataModel measureMetaDataModel = new MeasureMetaDataModel(maxValues, minValues, decimalLength, 1, uniqueValues, types, dataTypeSelected);
WriterCompressModel writerCompressModel = ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.ADAPTIVE, writerCompressModel.getCompType(0));
}
use of org.apache.carbondata.core.datastore.compression.MeasureMetaDataModel in project carbondata by apache.
the class ValueCompressionUtilTest method testToGetValueCompressionModelForFloatAndDataTypeSelected1.
@Test
public void testToGetValueCompressionModelForFloatAndDataTypeSelected1() {
Object[] maxValues = { 32725566.00 };
Object[] minValues = { 32744.0 };
int[] decimalLength = { 1 };
Object[] uniqueValues = { 5 };
DataType[] types = { DataType.DOUBLE };
byte[] dataTypeSelected = { 1 };
MeasureMetaDataModel measureMetaDataModel = new MeasureMetaDataModel(maxValues, minValues, decimalLength, 1, uniqueValues, types, dataTypeSelected);
WriterCompressModel writerCompressModel = ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.ADAPTIVE, writerCompressModel.getCompType(0));
}
use of org.apache.carbondata.core.datastore.compression.MeasureMetaDataModel in project carbondata by apache.
the class ValueCompressionUtilTest method testToGetValueCompressionModelForShortAndByte.
@Test
public void testToGetValueCompressionModelForShortAndByte() {
Object[] maxValues = { 32600.00 };
Object[] minValues = { 32500.00 };
int[] decimalLength = { 0 };
Object[] uniqueValues = { 5 };
DataType[] types = { DataType.DOUBLE };
byte[] dataTypeSelected = { 1 };
MeasureMetaDataModel measureMetaDataModel = new MeasureMetaDataModel(maxValues, minValues, decimalLength, 1, uniqueValues, types, dataTypeSelected);
WriterCompressModel writerCompressModel = ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.DELTA_DOUBLE, writerCompressModel.getCompType(0));
}
use of org.apache.carbondata.core.datastore.compression.MeasureMetaDataModel in project carbondata by apache.
the class ValueCompressionUtilTest method testToGetValueCompressionModelForByteAndIntAndDecimal1.
@Test
public void testToGetValueCompressionModelForByteAndIntAndDecimal1() {
Object[] maxValues = { -32766.00 };
Object[] minValues = { 32744.0 };
int[] decimalLength = { 1 };
Object[] uniqueValues = { 5 };
DataType[] types = { DataType.DOUBLE };
byte[] dataTypeSelected = { 1 };
MeasureMetaDataModel measureMetaDataModel = new MeasureMetaDataModel(maxValues, minValues, decimalLength, 1, uniqueValues, types, dataTypeSelected);
WriterCompressModel writerCompressModel = ValueCompressionUtil.getWriterCompressModel(measureMetaDataModel);
assertEquals(ValueCompressionUtil.COMPRESSION_TYPE.DELTA_DOUBLE, writerCompressModel.getCompType(0));
}
Aggregations