carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [2/5] incubator-carbondata git commit: [CARBONDATA-607] Cleanup ValueCompressionHolder class and all sub-classes
Date Wed, 11 Jan 2017 07:34:17 GMT
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneDefault.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneDefault.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneDefault.java
new file mode 100644
index 0000000..63fce48
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneDefault.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.none;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureChunkStoreFactory;
+import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureDataChunkStore;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.CompressorFactory;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressionHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class CompressionNoneDefault extends ValueCompressionHolder<double[]> {
+  /**
+   * Attribute for Carbon LOGGER
+   */
+  private static final LogService LOGGER =
+      LogServiceFactory.getLogService(CompressionNoneDefault.class.getName());
+  /**
+   * doubleCompressor.
+   */
+  private static Compressor compressor = CompressorFactory.getInstance().getCompressor();
+  /**
+   * value.
+   */
+  private double[] value;
+
+  private DataType actualDataType;
+
+  private MeasureDataChunkStore<double[]> measureChunkStore;
+
+  public CompressionNoneDefault(DataType actualDataType) {
+    this.actualDataType = actualDataType;
+  }
+
+  @Override public void setValue(double[] value) {this.value = value; }
+
+  @Override
+  public void uncompress(DataType dataType, byte[] data, int offset, int length,
+      int decimalPlaces, Object maxValueObject) {
+    super.unCompress(compressor, dataType, data, offset, length);
+    setUncompressedValues(value);
+  }
+
+  @Override public double[] getValue() { return this.value; }
+
+  @Override public void compress() {
+    compressedValue = super.compress(compressor, DataType.DATA_DOUBLE, value);
+  }
+
+  @Override public void setValueInBytes(byte[] value) {
+    ByteBuffer buffer = ByteBuffer.wrap(value);
+    this.value = ValueCompressionUtil.convertToDoubleArray(buffer, value.length);
+  }
+
+  @Override public long getLongValue(int index) {
+    throw new UnsupportedOperationException(
+      "Long value is not defined for CompressionNonDefault");
+  }
+
+  @Override public double getDoubleValue(int index) {
+    return measureChunkStore.getDouble(index);
+  }
+
+  @Override public BigDecimal getBigDecimalValue(int index) {
+    throw new UnsupportedOperationException(
+      "Big decimal is not defined for CompressionNoneDefault");
+  }
+
+  private void setUncompressedValues(double[] data) {
+    this.measureChunkStore = MeasureChunkStoreFactory.INSTANCE
+        .getMeasureDataChunkStore(DataType.DATA_DOUBLE, data.length);
+    this.measureChunkStore.putData(data);
+
+  }
+
+  @Override public void freeMemory() {
+    this.measureChunkStore.freeMemory();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneInt.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneInt.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneInt.java
new file mode 100644
index 0000000..b45deda
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneInt.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.none;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureChunkStoreFactory;
+import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureDataChunkStore;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.CompressorFactory;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressionHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class CompressionNoneInt extends ValueCompressionHolder<int[]> {
+  /**
+   * Attribute for Carbon LOGGER
+   */
+  private static final LogService LOGGER =
+      LogServiceFactory.getLogService(CompressionNoneInt.class.getName());
+  /**
+   * intCompressor.
+   */
+  private static Compressor compressor = CompressorFactory.getInstance().getCompressor();
+  /**
+   * value.
+   */
+  private int[] value;
+
+  private DataType actualDataType;
+
+  private MeasureDataChunkStore<int[]> measureChunkStore;
+
+  public CompressionNoneInt(DataType actualDataType) {
+    this.actualDataType = actualDataType;
+  }
+
+  @Override public void setValue(int[] value) {
+    this.value = value;
+  }
+
+  @Override public int[] getValue() { return this.value; }
+
+  @Override public void compress() {
+    compressedValue = super.compress(compressor, DataType.DATA_INT, value);
+  }
+
+  @Override
+  public void uncompress(DataType dataType, byte[] data, int offset, int length,
+      int decimalPlaces, Object maxValueObject) {
+    super.unCompress(compressor, dataType, data, offset, length);
+    setUncompressedValues(value);
+  }
+
+  @Override public void setValueInBytes(byte[] value) {
+    ByteBuffer buffer = ByteBuffer.wrap(value);
+    this.value = ValueCompressionUtil.convertToIntArray(buffer, value.length);
+  }
+
+  @Override public long getLongValue(int index) {
+    return measureChunkStore.getInt(index);
+  }
+
+  @Override public double getDoubleValue(int index) {
+    return measureChunkStore.getInt(index);
+  }
+
+  @Override public BigDecimal getBigDecimalValue(int index) {
+    throw new UnsupportedOperationException(
+      "Big decimal is not defined for CompressionNoneLong");
+  }
+
+  private void setUncompressedValues(int[] data) {
+    this.measureChunkStore =
+      MeasureChunkStoreFactory.INSTANCE.getMeasureDataChunkStore(DataType.DATA_INT, data.length);
+    this.measureChunkStore.putData(data);
+  }
+
+  @Override public void freeMemory() {
+    this.measureChunkStore.freeMemory();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneLong.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneLong.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneLong.java
new file mode 100644
index 0000000..5639c7a
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneLong.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.none;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureChunkStoreFactory;
+import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureDataChunkStore;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.CompressorFactory;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressionHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class CompressionNoneLong extends ValueCompressionHolder<long[]> {
+  /**
+   * Attribute for Carbon LOGGER
+   */
+  private static final LogService LOGGER =
+      LogServiceFactory.getLogService(CompressionNoneLong.class.getName());
+  /**
+   * longCompressor.
+   */
+  private static Compressor compressor = CompressorFactory.getInstance().getCompressor();
+  /**
+   * value.
+   */
+  protected long[] value;
+
+  private DataType actualDataType;
+
+  private MeasureDataChunkStore<long[]> measureChunkStore;
+
+  public CompressionNoneLong(DataType actualDataType) {
+    this.actualDataType = actualDataType;
+  }
+
+  @Override public void setValue(long[] value) { this.value = value;  }
+
+  @Override public long[] getValue() { return this.value; }
+
+  @Override public void compress() {
+    compressedValue = super.compress(compressor, DataType.DATA_LONG, value);
+  }
+
+  @Override
+  public void uncompress(DataType dataType, byte[] data, int offset, int length,
+      int decimalPlaces, Object maxValueObject) {
+    super.unCompress(compressor, dataType, data, offset, length);
+    setUncompressedValues(value);
+  }
+
+  @Override public void setValueInBytes(byte[] byteValue) {
+    ByteBuffer buffer = ByteBuffer.wrap(byteValue);
+    this.value = ValueCompressionUtil.convertToLongArray(buffer, byteValue.length);
+  }
+
+  @Override public long getLongValue(int index) {
+    return measureChunkStore.getLong(index);
+  }
+
+  @Override public double getDoubleValue(int index) {
+    return measureChunkStore.getLong(index);
+  }
+
+  @Override public BigDecimal getBigDecimalValue(int index) {
+    throw new UnsupportedOperationException("Get big decimal is not supported");
+  }
+
+  private void setUncompressedValues(long[] data) {
+    this.measureChunkStore =
+      MeasureChunkStoreFactory.INSTANCE.getMeasureDataChunkStore(DataType.DATA_LONG, data.length);
+    this.measureChunkStore.putData(data);
+  }
+
+  @Override public void freeMemory() {
+    this.measureChunkStore.freeMemory();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneShort.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneShort.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneShort.java
new file mode 100644
index 0000000..5118dc5
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/CompressionNoneShort.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.carbondata.core.datastorage.store.compression.none;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureChunkStoreFactory;
+import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureDataChunkStore;
+import org.apache.carbondata.core.datastorage.store.compression.Compressor;
+import org.apache.carbondata.core.datastorage.store.compression.CompressorFactory;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressionHolder;
+import org.apache.carbondata.core.util.ValueCompressionUtil;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+public class CompressionNoneShort extends ValueCompressionHolder<short[]> {
+  /**
+   * Attribute for Carbon LOGGER
+   */
+  private static final LogService LOGGER =
+      LogServiceFactory.getLogService(CompressionNoneShort.class.getName());
+
+  /**
+   * shortCompressor.
+   */
+  private static Compressor compressor = CompressorFactory.getInstance().getCompressor();
+
+  /**
+   * value.
+   */
+  private short[] shortValue;
+
+  private MeasureDataChunkStore<short[]> measureChunkStore;
+
+  private DataType actualDataType;
+
+  public CompressionNoneShort(DataType actualDataType) {
+    this.actualDataType = actualDataType;
+  }
+
+  @Override public void setValue(short[] shortValue) {
+    this.shortValue = shortValue;
+  }
+
+  @Override public short[] getValue() { return this.shortValue; }
+
+  @Override
+  public void uncompress(DataType dataType, byte[] data, int offset, int length,
+      int decimalPlaces, Object maxValueObject) {
+    super.unCompress(compressor, dataType, data, offset, length);
+    setUncompressedValues(shortValue);
+  }
+
+  @Override public void compress() {
+    compressedValue = super.compress(compressor, DataType.DATA_SHORT, shortValue);
+  }
+
+  @Override public void setValueInBytes(byte[] value) {
+    ByteBuffer buffer = ByteBuffer.wrap(value);
+    shortValue = ValueCompressionUtil.convertToShortArray(buffer, value.length);
+  }
+
+  @Override public long getLongValue(int index) {
+    return measureChunkStore.getShort(index);
+  }
+
+  @Override public double getDoubleValue(int index) {
+    return measureChunkStore.getShort(index);
+  }
+
+  @Override public BigDecimal getBigDecimalValue(int index) {
+    throw new UnsupportedOperationException(
+      "Big decimal is not defined for CompressionNonShort");
+  }
+
+  private void setUncompressedValues(short[] data) {
+    this.measureChunkStore = MeasureChunkStoreFactory.INSTANCE
+        .getMeasureDataChunkStore(DataType.DATA_SHORT, data.length);
+    this.measureChunkStore.putData(data);
+  }
+
+  @Override public void freeMemory() {
+    this.measureChunkStore.freeMemory();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneByte.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneByte.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneByte.java
deleted file mode 100644
index 4449241..0000000
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneByte.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.carbondata.core.datastorage.store.compression.none;
-
-import java.math.BigDecimal;
-
-import org.apache.carbondata.common.logging.LogService;
-import org.apache.carbondata.common.logging.LogServiceFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureChunkStoreFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureDataChunkStore;
-import org.apache.carbondata.core.datastorage.store.compression.Compressor;
-import org.apache.carbondata.core.datastorage.store.compression.CompressorFactory;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.apache.carbondata.core.util.ValueCompressionUtil;
-import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
-
-public class UnCompressNoneByte implements UnCompressValue<byte[]> {
-  /**
-   * Attribute for Carbon LOGGER
-   */
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(UnCompressNoneByte.class.getName());
-
-  /**
-   * byteCompressor.
-   */
-  private static Compressor compressor = CompressorFactory.getInstance().getCompressor();
-
-  /**
-   * value.
-   */
-  private byte[] value;
-
-  /**
-   * actual data type
-   */
-  private DataType actualDataType;
-
-  private MeasureDataChunkStore<byte[]> measureChunkStore;
-
-  public UnCompressNoneByte(DataType actualDataType) {
-    this.actualDataType = actualDataType;
-  }
-
-  @Override public UnCompressValue getNew() {
-    try {
-      return (UnCompressValue) clone();
-    } catch (CloneNotSupportedException e) {
-      LOGGER.error(e, e.getMessage());
-    }
-    return null;
-  }
-
-  @Override public void setValue(byte[] value) {
-    this.value = value;
-  }
-
-  @Override
-  public UnCompressValue uncompress(DataType dataType, byte[] data, int offset, int length,
-      int mantissa, Object maxValueObject) {
-    UnCompressValue byte1 = ValueCompressionUtil.getUnCompressNone(dataType, actualDataType);
-    ValueCompressonHolder
-        .unCompress(dataType, byte1, data, offset, length, mantissa, maxValueObject);
-    return byte1;
-  }
-
-  @Override public UnCompressValue compress() {
-    UnCompressNoneByte byte1 = new UnCompressNoneByte(actualDataType);
-    byte1.setValue(compressor.compressByte(value));
-    return byte1;
-  }
-
-  @Override public byte[] getBackArrayData() {
-    return value;
-  }
-
-  @Override public void setValueInBytes(byte[] value) {
-    this.value = value;
-  }
-
-  /**
-   * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
-   */
-  @Override public UnCompressValue getCompressorObject() {
-    return new UnCompressNoneByte(actualDataType);
-  }
-
-  @Override public long getLongValue(int index) {
-    return measureChunkStore.getByte(index);
-  }
-
-  @Override public double getDoubleValue(int index) {
-    return measureChunkStore.getByte(index);
-  }
-
-  @Override public BigDecimal getBigDecimalValue(int index) {
-    throw new UnsupportedOperationException("Get big decimal is not supported");
-  }
-
-  @Override public void setUncompressValues(byte[] data, int decimalPlaces, Object maxValueObject) {
-    this.measureChunkStore =
-        MeasureChunkStoreFactory.INSTANCE.getMeasureDataChunkStore(DataType.DATA_BYTE, data.length);
-    this.measureChunkStore.putData(data);
-  }
-
-  @Override public void freeMemory() {
-    this.measureChunkStore.freeMemory();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneDefault.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneDefault.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneDefault.java
deleted file mode 100644
index 8789ecf..0000000
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneDefault.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.carbondata.core.datastorage.store.compression.none;
-
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.apache.carbondata.common.logging.LogService;
-import org.apache.carbondata.common.logging.LogServiceFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureChunkStoreFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureDataChunkStore;
-import org.apache.carbondata.core.datastorage.store.compression.Compressor;
-import org.apache.carbondata.core.datastorage.store.compression.CompressorFactory;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.apache.carbondata.core.util.ValueCompressionUtil;
-import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
-
-public class UnCompressNoneDefault implements UnCompressValue<double[]> {
-  /**
-   * Attribute for Carbon LOGGER
-   */
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(UnCompressNoneDefault.class.getName());
-  /**
-   * doubleCompressor.
-   */
-  private static Compressor compressor = CompressorFactory.getInstance().getCompressor();
-  /**
-   * value.
-   */
-  private double[] value;
-
-  private DataType actualDataType;
-
-  private MeasureDataChunkStore<double[]> measureChunkStore;
-
-  public UnCompressNoneDefault(DataType actualDataType) {
-    this.actualDataType = actualDataType;
-  }
-
-  @Override public void setValue(double[] value) {
-    this.value = value;
-
-  }
-
-  @Override public UnCompressValue getNew() {
-    try {
-      return (UnCompressValue) clone();
-    } catch (CloneNotSupportedException exception1) {
-      LOGGER.error(exception1, exception1.getMessage());
-    }
-    return null;
-  }
-
-  @Override public UnCompressValue compress() {
-    UnCompressNoneByte byte1 = new UnCompressNoneByte(actualDataType);
-    byte1.setValue(compressor.compressDouble(value));
-    return byte1;
-  }
-
-  @Override
-  public UnCompressValue uncompress(DataType dataType, byte[] data, int offset, int length,
-      int decimalPlaces, Object maxValueObject) {
-    return null;
-  }
-
-  @Override public UnCompressValue getCompressorObject() {
-    return new UnCompressNoneByte(actualDataType);
-  }
-
-  @Override public byte[] getBackArrayData() {
-    return ValueCompressionUtil.convertToBytes(value);
-  }
-
-  @Override public void setValueInBytes(byte[] value) {
-    ByteBuffer buffer = ByteBuffer.wrap(value);
-    this.value = ValueCompressionUtil.convertToDoubleArray(buffer, value.length);
-  }
-
-  @Override public long getLongValue(int index) {
-    throw new UnsupportedOperationException("Get long value is not supported");
-  }
-
-  @Override public double getDoubleValue(int index) {
-    return measureChunkStore.getDouble(index);
-  }
-
-  @Override public BigDecimal getBigDecimalValue(int index) {
-    throw new UnsupportedOperationException("Get big decimal is not supported");
-  }
-
-  @Override
-  public void setUncompressValues(double[] data, int decimalPlaces, Object maxValueObject) {
-    this.measureChunkStore = MeasureChunkStoreFactory.INSTANCE
-        .getMeasureDataChunkStore(DataType.DATA_DOUBLE, data.length);
-    this.measureChunkStore.putData(data);
-
-  }
-
-  @Override public void freeMemory() {
-    this.measureChunkStore.freeMemory();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneInt.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneInt.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneInt.java
deleted file mode 100644
index c4b7205..0000000
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneInt.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.carbondata.core.datastorage.store.compression.none;
-
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.apache.carbondata.common.logging.LogService;
-import org.apache.carbondata.common.logging.LogServiceFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureChunkStoreFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureDataChunkStore;
-import org.apache.carbondata.core.datastorage.store.compression.Compressor;
-import org.apache.carbondata.core.datastorage.store.compression.CompressorFactory;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.apache.carbondata.core.util.ValueCompressionUtil;
-import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
-
-public class UnCompressNoneInt implements ValueCompressonHolder.UnCompressValue<int[]> {
-  /**
-   * Attribute for Carbon LOGGER
-   */
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(UnCompressNoneInt.class.getName());
-  /**
-   * intCompressor.
-   */
-  private static Compressor compressor = CompressorFactory.getInstance().getCompressor();
-  /**
-   * value.
-   */
-  private int[] value;
-
-  private DataType actualDataType;
-
-  private MeasureDataChunkStore<int[]> measureChunkStore;
-
-  public UnCompressNoneInt(DataType actualDataType) {
-    this.actualDataType = actualDataType;
-  }
-
-  @Override public void setValue(int[] value) {
-    this.value = value;
-  }
-
-  @Override public byte[] getBackArrayData() {
-    return ValueCompressionUtil.convertToBytes(value);
-  }
-
-  @Override public ValueCompressonHolder.UnCompressValue getNew() {
-    try {
-      return (ValueCompressonHolder.UnCompressValue) clone();
-    } catch (CloneNotSupportedException exc) {
-      LOGGER.error(exc, exc.getMessage());
-    }
-    return null;
-  }
-
-  @Override public ValueCompressonHolder.UnCompressValue compress() {
-    UnCompressNoneByte byte1 = new UnCompressNoneByte(actualDataType);
-    byte1.setValue(compressor.compressInt(value));
-    return byte1;
-  }
-
-  @Override
-  public UnCompressValue uncompress(DataType dataType, byte[] data, int offset, int length,
-      int decimalPlaces, Object maxValueObject) {
-    return null;
-  }
-
-  @Override public void setValueInBytes(byte[] value) {
-    ByteBuffer buffer = ByteBuffer.wrap(value);
-    this.value = ValueCompressionUtil.convertToIntArray(buffer, value.length);
-  }
-
-  /**
-   * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
-   */
-  @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
-    return new UnCompressNoneByte(this.actualDataType);
-  }
-
-  @Override public long getLongValue(int index) {
-    return measureChunkStore.getInt(index);
-  }
-
-  @Override public double getDoubleValue(int index) {
-    return measureChunkStore.getInt(index);
-  }
-
-  @Override public BigDecimal getBigDecimalValue(int index) {
-    throw new UnsupportedOperationException("Get big decimal is not supported");
-  }
-
-  @Override public void setUncompressValues(int[] data, int decimalPlaces, Object maxValueObject) {
-    this.measureChunkStore =
-        MeasureChunkStoreFactory.INSTANCE.getMeasureDataChunkStore(DataType.DATA_INT, data.length);
-    this.measureChunkStore.putData(data);
-
-  }
-
-  @Override public void freeMemory() {
-    this.measureChunkStore.freeMemory();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneLong.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneLong.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneLong.java
deleted file mode 100644
index 4b45b13..0000000
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneLong.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.carbondata.core.datastorage.store.compression.none;
-
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.apache.carbondata.common.logging.LogService;
-import org.apache.carbondata.common.logging.LogServiceFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureChunkStoreFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureDataChunkStore;
-import org.apache.carbondata.core.datastorage.store.compression.Compressor;
-import org.apache.carbondata.core.datastorage.store.compression.CompressorFactory;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.apache.carbondata.core.util.ValueCompressionUtil;
-import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
-
-public class UnCompressNoneLong implements ValueCompressonHolder.UnCompressValue<long[]> {
-  /**
-   * Attribute for Carbon LOGGER
-   */
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(UnCompressNoneLong.class.getName());
-  /**
-   * longCompressor.
-   */
-  private static Compressor compressor = CompressorFactory.getInstance().getCompressor();
-  /**
-   * value.
-   */
-  protected long[] value;
-
-  private DataType actualDataType;
-
-  private MeasureDataChunkStore<long[]> measureChunkStore;
-
-  public UnCompressNoneLong(DataType actualDataType) {
-    this.actualDataType = actualDataType;
-  }
-
-  @Override public void setValue(long[] value) {
-    this.value = value;
-
-  }
-
-  @Override public ValueCompressonHolder.UnCompressValue getNew() {
-    try {
-      return (ValueCompressonHolder.UnCompressValue) clone();
-    } catch (CloneNotSupportedException clnNotSupportedExc) {
-      LOGGER.error(clnNotSupportedExc, clnNotSupportedExc.getMessage());
-    }
-    return null;
-  }
-
-  @Override public ValueCompressonHolder.UnCompressValue compress() {
-    UnCompressNoneByte byte1 = new UnCompressNoneByte(actualDataType);
-    byte1.setValue(compressor.compressLong(value));
-    return byte1;
-
-  }
-
-  @Override
-  public UnCompressValue uncompress(DataType dataType, byte[] data, int offset, int length,
-      int decimalPlaces, Object maxValueObject) {
-    return null;
-  }
-
-  @Override public byte[] getBackArrayData() {
-    return ValueCompressionUtil.convertToBytes(value);
-  }
-
-  @Override public void setValueInBytes(byte[] byteValue) {
-    ByteBuffer buffer = ByteBuffer.wrap(byteValue);
-    this.value = ValueCompressionUtil.convertToLongArray(buffer, byteValue.length);
-  }
-
-  /**
-   * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
-   */
-  @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
-    return new UnCompressNoneByte(this.actualDataType);
-  }
-
-  @Override public long getLongValue(int index) {
-    return measureChunkStore.getLong(index);
-  }
-
-  @Override public double getDoubleValue(int index) {
-    return measureChunkStore.getLong(index);
-  }
-
-  @Override public BigDecimal getBigDecimalValue(int index) {
-    throw new UnsupportedOperationException("Get big decimal is not supported");
-  }
-
-  @Override public void setUncompressValues(long[] data, int decimalPlaces, Object maxValueObject) {
-    this.measureChunkStore =
-        MeasureChunkStoreFactory.INSTANCE.getMeasureDataChunkStore(DataType.DATA_LONG, data.length);
-    this.measureChunkStore.putData(data);
-
-  }
-
-  @Override public void freeMemory() {
-    this.measureChunkStore.freeMemory();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneShort.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneShort.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneShort.java
deleted file mode 100644
index 8eb4ee9..0000000
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/none/UnCompressNoneShort.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.carbondata.core.datastorage.store.compression.none;
-
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.apache.carbondata.common.logging.LogService;
-import org.apache.carbondata.common.logging.LogServiceFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureChunkStoreFactory;
-import org.apache.carbondata.core.carbon.datastore.chunk.store.MeasureDataChunkStore;
-import org.apache.carbondata.core.datastorage.store.compression.Compressor;
-import org.apache.carbondata.core.datastorage.store.compression.CompressorFactory;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.apache.carbondata.core.util.ValueCompressionUtil;
-import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
-
-public class UnCompressNoneShort implements ValueCompressonHolder.UnCompressValue<short[]> {
-  /**
-   * Attribute for Carbon LOGGER
-   */
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(UnCompressNoneShort.class.getName());
-
-  /**
-   * shortCompressor.
-   */
-  private static Compressor compressor = CompressorFactory.getInstance().getCompressor();
-
-  /**
-   * value.
-   */
-  private short[] shortValue;
-
-  private MeasureDataChunkStore<short[]> measureChunkStore;
-
-  private DataType actualDataType;
-
-  public UnCompressNoneShort(DataType actualDataType) {
-    this.actualDataType = actualDataType;
-  }
-
-  @Override public void setValue(short[] shortValue) {
-    this.shortValue = shortValue;
-  }
-
-  @Override public ValueCompressonHolder.UnCompressValue getNew() {
-    try {
-      return (ValueCompressonHolder.UnCompressValue) clone();
-    } catch (CloneNotSupportedException cns1) {
-      LOGGER.error(cns1, cns1.getMessage());
-    }
-    return null;
-  }
-
-  @Override public ValueCompressonHolder.UnCompressValue compress() {
-    UnCompressNoneByte byte1 = new UnCompressNoneByte(actualDataType);
-    byte1.setValue(compressor.compressShort(shortValue));
-    return byte1;
-  }
-
-  @Override
-  public UnCompressValue uncompress(DataType dataType, byte[] data, int offset, int length,
-      int decimalPlaces, Object maxValueObject) {
-    return null;
-  }
-
-  @Override public byte[] getBackArrayData() {
-    return ValueCompressionUtil.convertToBytes(shortValue);
-  }
-
-  @Override public void setValueInBytes(byte[] value) {
-    ByteBuffer buffer = ByteBuffer.wrap(value);
-    shortValue = ValueCompressionUtil.convertToShortArray(buffer, value.length);
-  }
-
-  /**
-   * @see ValueCompressonHolder.UnCompressValue#getCompressorObject()
-   */
-  @Override public ValueCompressonHolder.UnCompressValue getCompressorObject() {
-    return new UnCompressNoneByte(this.actualDataType);
-  }
-
-  @Override public long getLongValue(int index) {
-    return measureChunkStore.getShort(index);
-  }
-
-  @Override public double getDoubleValue(int index) {
-    return measureChunkStore.getShort(index);
-  }
-
-  @Override public BigDecimal getBigDecimalValue(int index) {
-    throw new UnsupportedOperationException("Get big decimal is not supported");
-  }
-
-  @Override
-  public void setUncompressValues(short[] data, int decimalPlaces, Object maxValueObject) {
-    this.measureChunkStore = MeasureChunkStoreFactory.INSTANCE
-        .getMeasureDataChunkStore(DataType.DATA_SHORT, data.length);
-    this.measureChunkStore.putData(data);
-
-  }
-
-  @Override public void freeMemory() {
-    this.measureChunkStore.freeMemory();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/CompressionBigDecimal.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/CompressionBigDecimal.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/CompressionBigDecimal.java
new file mode 100644
index 0000000..db766ac
--- /dev/null
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/CompressionBigDecimal.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.carbondata.core.datastorage.store.compression.type;
+
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
+import org.apache.carbondata.core.constants.CarbonCommonConstants;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressionHolder;
+import org.apache.carbondata.core.util.BigDecimalCompressionFinder;
+import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
+
+/**
+ * Big decimal compression
+ */
+public class CompressionBigDecimal<T> extends ValueCompressionHolder<T> {
+
+  private static final LogService LOGGER =
+          LogServiceFactory.getLogService(CompressionBigDecimal.class.getName());
+
+  private BigDecimalCompressionFinder compressionFinder;
+
+  /**
+   * leftPart before decimal
+   */
+  private ValueCompressionHolder leftPart;
+
+  /**
+   * rightPart after decimal
+   */
+  private ValueCompressionHolder rightPart;
+
+  private double divisionFactor;
+
+  private boolean isDecimalPlacesNotZero;
+
+  public CompressionBigDecimal(BigDecimalCompressionFinder compressionFinder,
+      ValueCompressionHolder leftPart, ValueCompressionHolder rightPart) {
+    this.compressionFinder = compressionFinder;
+    this.leftPart = leftPart;
+    this.rightPart = rightPart;
+  }
+
+  @Override public void setValue(T value) {
+    Object[] values = (Object[]) value;
+    leftPart.setValue(values[0]);
+    rightPart.setValue(values[1]);
+  }
+
+  @Override
+  public void uncompress(DataType dataType, byte[] data, int offset, int length,
+      int decimalPlaces, Object maxValueObject) {
+    if (decimalPlaces > 0) {
+      this.isDecimalPlacesNotZero = true;
+    }
+    this.divisionFactor = Math.pow(10, decimalPlaces);
+
+    ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
+    int leftPathLength = buffer.getInt();
+    int rightPartLength = length - leftPathLength - CarbonCommonConstants.INT_SIZE_IN_BYTE;
+    Long[] maxValue = (Long[]) maxValueObject;
+    leftPart.uncompress(compressionFinder.getLeftConvertedDataType(), data,
+        offset + CarbonCommonConstants.INT_SIZE_IN_BYTE, leftPathLength, decimalPlaces,
+        maxValue[0]);
+    rightPart.uncompress(compressionFinder.getRightConvertedDataType(), data,
+        offset + CarbonCommonConstants.INT_SIZE_IN_BYTE + leftPathLength, rightPartLength,
+        decimalPlaces, maxValue[1]);
+  }
+
+  @Override public long getLongValue(int index) {
+    throw new UnsupportedOperationException(
+      "Long is not defined for CompressionBigDecimal");
+  }
+
+  @Override public double getDoubleValue(int index) {
+    throw new UnsupportedOperationException(
+      "Double is not defined for CompressionBigDecimal");
+  }
+
+  @Override public BigDecimal getBigDecimalValue(int index) {
+    long leftValue = leftPart.getLongValue(index);
+    long rightValue = 0;
+    if (isDecimalPlacesNotZero) {
+      rightValue = rightPart.getLongValue(index);
+    }
+    String decimalPart = Double.toString(rightValue / this.divisionFactor);
+    String bigdStr = Long.toString(leftValue) + CarbonCommonConstants.POINT + decimalPart
+            .substring(decimalPart.indexOf(".") + 1, decimalPart.length());
+    return new BigDecimal(bigdStr);
+  }
+
+  @Override public T getValue() {
+    Object[] values = new Object[2];
+    values[0] = leftPart;
+    values[1] = rightPart;
+    return (T) values;
+  }
+
+  @Override public void setValueInBytes(byte[] value) {
+    LOGGER.error("setValueInBytes() is not defined for CompressionBigDecimal");
+  }
+
+  @Override public void compress() {
+    leftPart.compress();
+    rightPart.compress();
+  }
+
+  @Override
+  public byte[] getCompressedData() {
+    byte[] leftdata = leftPart.getCompressedData();
+    byte[] rightdata = rightPart.getCompressedData();
+    ByteBuffer byteBuffer = ByteBuffer
+        .allocate(CarbonCommonConstants.INT_SIZE_IN_BYTE + leftdata.length
+            + rightdata.length);
+    byteBuffer.putInt(leftdata.length);
+    byteBuffer.put(leftdata);
+    byteBuffer.put(rightdata);
+    byteBuffer.flip();
+    return byteBuffer.array();
+  }
+
+  @Override public void freeMemory() {
+    leftPart.freeMemory();
+    rightPart.freeMemory();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressBigDecimal.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressBigDecimal.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressBigDecimal.java
deleted file mode 100644
index e33f8a4..0000000
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressBigDecimal.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.carbondata.core.datastorage.store.compression.type;
-
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.apache.carbondata.core.constants.CarbonCommonConstants;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.apache.carbondata.core.util.BigDecimalCompressionFinder;
-import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
-
-/**
- * Big decimal compression/uncompression
- */
-public class UnCompressBigDecimal<T> implements UnCompressValue<T> {
-
-  private BigDecimalCompressionFinder compressionFinder;
-
-  /**
-   * leftPart before decimal
-   */
-  private UnCompressValue leftPart;
-
-  /**
-   * rightPart after decimal
-   */
-  private UnCompressValue rightPart;
-
-  public UnCompressBigDecimal(BigDecimalCompressionFinder compressionFinder,
-      UnCompressValue leftPart, UnCompressValue rightPart) {
-    this.compressionFinder = compressionFinder;
-    this.leftPart = leftPart;
-    this.rightPart = rightPart;
-  }
-
-  @Override public void setValue(T value) {
-    Object[] values = (Object[]) value;
-    leftPart.setValue(values[0]);
-    rightPart.setValue(values[1]);
-  }
-
-  @Override public void setValueInBytes(byte[] value) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override public UnCompressValue<T> getNew() {
-    UnCompressValue leftUnCompressClone = leftPart.getNew();
-    UnCompressValue rightUnCompressClone = rightPart.getNew();
-    return new UnCompressBigDecimal(compressionFinder, leftUnCompressClone, rightUnCompressClone);
-  }
-
-  @Override public UnCompressValue compress() {
-    UnCompressBigDecimal byt =
-        new UnCompressBigDecimal<>(compressionFinder, leftPart.compress(), rightPart.compress());
-    return byt;
-  }
-
-  @Override
-  public UnCompressValue uncompress(DataType dataType, byte[] data, int offset, int length,
-      int decimalPlaces, Object maxValueObject) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override public byte[] getBackArrayData() {
-    byte[] leftdata = leftPart.getBackArrayData();
-    byte[] rightdata = rightPart.getBackArrayData();
-    ByteBuffer byteBuffer = ByteBuffer
-        .allocate(CarbonCommonConstants.INT_SIZE_IN_BYTE + leftdata.length + rightdata.length);
-    byteBuffer.putInt(leftdata.length);
-    byteBuffer.put(leftdata);
-    byteBuffer.put(rightdata);
-    byteBuffer.flip();
-    return byteBuffer.array();
-  }
-
-  @Override public UnCompressValue getCompressorObject() {
-    return new UnCompressBigDecimalByte<>(compressionFinder, leftPart.getCompressorObject(),
-        rightPart.getCompressorObject(), 0, null);
-  }
-
-  @Override public void setUncompressValues(T data, int decimalPlaces, Object maxValueObject) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override public long getLongValue(int index) {
-    throw new UnsupportedOperationException("Get long is not supported");
-  }
-
-  @Override public double getDoubleValue(int index) {
-    throw new UnsupportedOperationException("Get double is not supported");
-  }
-
-  @Override public BigDecimal getBigDecimalValue(int index) {
-    throw new UnsupportedOperationException("Get big decimal is not supported");
-  }
-
-  @Override public void freeMemory() {
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressBigDecimalByte.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressBigDecimalByte.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressBigDecimalByte.java
deleted file mode 100644
index 32203c5..0000000
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/compression/type/UnCompressBigDecimalByte.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.carbondata.core.datastorage.store.compression.type;
-
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.apache.carbondata.core.constants.CarbonCommonConstants;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
-import org.apache.carbondata.core.util.BigDecimalCompressionFinder;
-import org.apache.carbondata.core.util.ValueCompressionUtil.DataType;
-
-/**
- * Big decimal compression/uncompression
- */
-public class UnCompressBigDecimalByte<T> implements UnCompressValue<T> {
-
-  private BigDecimalCompressionFinder compressionFinder;
-
-  private UnCompressValue leftPart;
-
-  private UnCompressValue rightPart;
-
-  private double divisionFactor;
-
-  private boolean isDecimalPlacesNotZero;
-
-  public UnCompressBigDecimalByte(BigDecimalCompressionFinder compressionFinder,
-      UnCompressValue leftPart, UnCompressValue rightPart, int decimalPalacs,
-      Object maxValueObject) {
-    this.compressionFinder = compressionFinder;
-    this.leftPart = leftPart;
-    this.rightPart = rightPart;
-    if (decimalPalacs > 0) {
-      this.isDecimalPlacesNotZero = true;
-    }
-    this.divisionFactor = Math.pow(10, decimalPalacs);
-  }
-
-  @Override public void setValue(T value) {
-    byte[] values = (byte[]) value;
-    ByteBuffer buffer = ByteBuffer.wrap(values);
-    buffer.rewind();
-    int leftPartLen = buffer.getInt();
-    int rightPartLen = values.length - leftPartLen - CarbonCommonConstants.INT_SIZE_IN_BYTE;
-    byte[] leftValue = new byte[leftPartLen];
-    byte[] rightValue = new byte[rightPartLen];
-    buffer.get(leftValue);
-    buffer.get(rightValue);
-    leftPart.setValue(leftValue);
-    rightPart.setValue(rightValue);
-  }
-
-  @Override public void setValueInBytes(byte[] value) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override public UnCompressValue<T> getNew() {
-    UnCompressValue leftUnCompressClone = leftPart.getNew();
-    UnCompressValue rightUnCompressClone = rightPart.getNew();
-    return new UnCompressBigDecimal(compressionFinder, leftUnCompressClone, rightUnCompressClone);
-  }
-
-  @Override public UnCompressValue compress() {
-    UnCompressBigDecimal byt =
-        new UnCompressBigDecimal<>(compressionFinder, leftPart.compress(), rightPart.compress());
-    return byt;
-  }
-
-  @Override
-  public UnCompressValue uncompress(DataType dataType, byte[] data, int offset, int length,
-      int decimalPlaces, Object maxValueObject) {
-    ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);
-    int leftPathLength = buffer.getInt();
-    int rightPartLength = length - leftPathLength - CarbonCommonConstants.INT_SIZE_IN_BYTE;
-    Long[] maxValue = (Long[]) maxValueObject;
-    ValueCompressonHolder.UnCompressValue left = leftPart
-        .uncompress(compressionFinder.getLeftConvertedDataType(), data,
-            offset + CarbonCommonConstants.INT_SIZE_IN_BYTE, leftPathLength, decimalPlaces,
-            maxValue[0]);
-    ValueCompressonHolder.UnCompressValue right = rightPart
-        .uncompress(compressionFinder.getRightConvertedDataType(), data,
-            offset + CarbonCommonConstants.INT_SIZE_IN_BYTE + leftPathLength, rightPartLength,
-            decimalPlaces, maxValue[1]);
-    return new UnCompressBigDecimalByte<>(compressionFinder, left, right, decimalPlaces,
-        maxValueObject);
-  }
-
-  @Override public byte[] getBackArrayData() {
-    return null;
-  }
-
-  @Override public UnCompressValue getCompressorObject() {
-    return new UnCompressBigDecimal<>(compressionFinder, leftPart.getCompressorObject(),
-        rightPart.getCompressorObject());
-  }
-
-  @Override public void setUncompressValues(T data, int decimalPlaces, Object maxValueObject) {
-    //. do nothing
-  }
-
-  @Override public long getLongValue(int index) {
-    throw new UnsupportedOperationException("Get long is not supported");
-  }
-
-  @Override public double getDoubleValue(int index) {
-    throw new UnsupportedOperationException("Get double is not supported");
-  }
-
-  @Override public BigDecimal getBigDecimalValue(int index) {
-    long leftValue = leftPart.getLongValue(index);
-    long rightValue = 0;
-    if (isDecimalPlacesNotZero) {
-      rightValue = rightPart.getLongValue(index);
-    }
-    String decimalPart = Double.toString(rightValue / this.divisionFactor);
-    String bigdStr = Long.toString(leftValue) + CarbonCommonConstants.POINT + decimalPart
-        .substring(decimalPart.indexOf(".") + 1, decimalPart.length());
-    return new BigDecimal(bigdStr);
-  }
-
-  @Override public void freeMemory() {
-    leftPart.freeMemory();
-    rightPart.freeMemory();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonReadDataHolder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonReadDataHolder.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonReadDataHolder.java
index 8dd6724..ff3df15 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonReadDataHolder.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/dataholder/CarbonReadDataHolder.java
@@ -21,14 +21,14 @@ package org.apache.carbondata.core.datastorage.store.dataholder;
 
 import java.math.BigDecimal;
 
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressionHolder;
 
 // This class is used with Uncompressor to hold the decompressed column chunk in memory
 public class CarbonReadDataHolder {
 
-  private ValueCompressonHolder.UnCompressValue unCompressValue;
+  private ValueCompressionHolder unCompressValue;
 
-  public CarbonReadDataHolder(ValueCompressonHolder.UnCompressValue unCompressValue) {
+  public CarbonReadDataHolder(ValueCompressionHolder unCompressValue) {
     this.unCompressValue = unCompressValue;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java
index 55ed307..ad1d62f 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java
@@ -19,9 +19,11 @@
 
 package org.apache.carbondata.core.datastorage.store.impl.data.compressed;
 
+import org.apache.carbondata.common.logging.LogService;
+import org.apache.carbondata.common.logging.LogServiceFactory;
 import org.apache.carbondata.core.constants.CarbonCommonConstants;
 import org.apache.carbondata.core.datastorage.store.NodeMeasureDataStore;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressionHolder;
 import org.apache.carbondata.core.datastorage.store.compression.WriterCompressModel;
 import org.apache.carbondata.core.datastorage.store.dataholder.CarbonWriteDataHolder;
 import org.apache.carbondata.core.util.ValueCompressionUtil;
@@ -30,10 +32,13 @@ public abstract class AbstractHeavyCompressedDoubleArrayDataStore
     implements NodeMeasureDataStore //NodeMeasureDataStore<double[]>
 {
 
+  private LogService LOGGER =
+      LogServiceFactory.getLogService(AbstractHeavyCompressedDoubleArrayDataStore.class.getName());
+
   /**
    * values.
    */
-  protected ValueCompressonHolder.UnCompressValue[] values;
+  protected ValueCompressionHolder[] values;
 
   /**
    * compressionModel.
@@ -55,14 +60,18 @@ public abstract class AbstractHeavyCompressedDoubleArrayDataStore
     if (null != compressionModel) {
       this.type = compressionModel.getType();
       values =
-          new ValueCompressonHolder.UnCompressValue[compressionModel.getUnCompressValues().length];
+          new ValueCompressionHolder[compressionModel.getValueCompressionHolder().length];
     }
   }
 
+  // this method first invokes encoding routine to encode the data chunk,
+  // followed by invoking compression routine for preparing the data chunk for writing.
   @Override public byte[][] getWritableMeasureDataArray(CarbonWriteDataHolder[] dataHolder) {
-    for (int i = 0; i < compressionModel.getUnCompressValues().length; i++) {
-      values[i] = compressionModel.getUnCompressValues()[i].getNew();
+    byte[][] returnValue = new byte[values.length][];
+    for (int i = 0; i < compressionModel.getValueCompressionHolder().length; i++) {
+      values[i] = compressionModel.getValueCompressionHolder()[i];
       if (type[i] != CarbonCommonConstants.BYTE_VALUE_MEASURE) {
+        // first perform encoding of the data chunk
         values[i].setValue(
             ValueCompressionUtil.getValueCompressor(compressionModel.getCompressionFinders()[i])
                 .getCompressedValues(compressionModel.getCompressionFinders()[i], dataHolder[i],
@@ -71,12 +80,10 @@ public abstract class AbstractHeavyCompressedDoubleArrayDataStore
       } else {
         values[i].setValue(dataHolder[i].getWritableByteArrayValues());
       }
-      values[i] = values[i].compress();
-    }
-    byte[][] returnValue = new byte[values.length][];
-    for (int i = 0; i < values.length; i++) {
-      returnValue[i] = values[i].getBackArrayData();
+      values[i].compress();
+      returnValue[i] = values[i].getCompressedData();
     }
+
     return returnValue;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java b/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
index 081ed9f..a9be95c 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
@@ -29,30 +29,12 @@ import org.apache.carbondata.core.compression.DoubleCompressor;
 import org.apache.carbondata.core.compression.ValueCompressor;
 import org.apache.carbondata.core.datastorage.store.compression.MeasureMetaDataModel;
 import org.apache.carbondata.core.datastorage.store.compression.ReaderCompressModel;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder.UnCompressValue;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressionHolder;
 import org.apache.carbondata.core.datastorage.store.compression.WriterCompressModel;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinByte;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinDefault;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinInt;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinLong;
-import org.apache.carbondata.core.datastorage.store.compression.decimal.UnCompressMaxMinShort;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalByte;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalDefault;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalInt;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalLong;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinByte;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinDefault;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinInt;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinLong;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalMaxMinShort;
-import org.apache.carbondata.core.datastorage.store.compression.nondecimal.UnCompressNonDecimalShort;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneByte;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneDefault;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneInt;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneLong;
-import org.apache.carbondata.core.datastorage.store.compression.none.UnCompressNoneShort;
-import org.apache.carbondata.core.datastorage.store.compression.type.UnCompressBigDecimal;
+import org.apache.carbondata.core.datastorage.store.compression.decimal.*;
+import org.apache.carbondata.core.datastorage.store.compression.nondecimal.*;
+import org.apache.carbondata.core.datastorage.store.compression.none.*;
+import org.apache.carbondata.core.datastorage.store.compression.type.*;
 import org.apache.carbondata.core.metadata.ValueEncoderMeta;
 
 public final class ValueCompressionUtil {
@@ -282,26 +264,32 @@ public final class ValueCompressionUtil {
    * @param compressionFinders : Compression types for measures
    * @return
    */
-  private static UnCompressValue[] getUncompressedValues(
+  private static ValueCompressionHolder[] getValueCompressionHolder(
       CompressionFinder[] compressionFinders) {
-    UnCompressValue[] unCompressedValues = new UnCompressValue[compressionFinders.length];
+    ValueCompressionHolder[] valueCompressionHolders =
+            new ValueCompressionHolder[compressionFinders.length];
     for (int i=0; i< compressionFinders.length; i++) {
-      unCompressedValues[i] = getUncompressedValue(compressionFinders[i]);
+      valueCompressionHolders[i] =
+              getValueCompressionHolder(compressionFinders[i]);
     }
-    return unCompressedValues;
+    return valueCompressionHolders;
   }
   /**
    *
    * @param compressionFinder bigdecimal compression finder
-   * @return Uncompressed measure object
+   * @return ValueCompressionHolder
    */
-  private static UnCompressValue getUncompressedValue(
+  private static ValueCompressionHolder getValueCompressionHolder(
       BigDecimalCompressionFinder compressionFinder) {
-    UnCompressValue leftPart = getUncompressedValue(compressionFinder.getLeftCompType(),
-        compressionFinder.getLeftActualDataType(), compressionFinder.getLeftConvertedDataType());
-    UnCompressValue rightPart = getUncompressedValue(compressionFinder.getRightCompType(),
-        compressionFinder.getRightActualDataType(), compressionFinder.getRightConvertedDataType());
-    return new UnCompressBigDecimal<>(compressionFinder, leftPart, rightPart);
+    ValueCompressionHolder leftPart = getValueCompressionHolder(
+            compressionFinder.getLeftCompType(), compressionFinder.getLeftActualDataType(),
+            compressionFinder.getLeftConvertedDataType());
+
+    ValueCompressionHolder rightPart = getValueCompressionHolder(
+            compressionFinder.getRightCompType(), compressionFinder.getRightActualDataType(),
+            compressionFinder.getRightConvertedDataType());
+
+    return new CompressionBigDecimal(compressionFinder, leftPart, rightPart);
   }
 
   /**
@@ -309,29 +297,29 @@ public final class ValueCompressionUtil {
    * @param compressionFinder for measure other then bigdecimal
    * @return
    */
-  private static UnCompressValue getUncompressedValue(
+  private static ValueCompressionHolder getValueCompressionHolder(
       CompressionFinder compressionFinder) {
     switch(compressionFinder.getMeasureStoreType()) {
       case 'b':
-        return getUncompressedValue(
+        return getValueCompressionHolder(
               (BigDecimalCompressionFinder) compressionFinder);
       default:
-        return getUncompressedValue(compressionFinder.getCompType(),
+        return getValueCompressionHolder(compressionFinder.getCompType(),
             compressionFinder.getActualDataType(), compressionFinder.getConvertedDataType());
     }
   }
 
-  private static ValueCompressonHolder.UnCompressValue getUncompressedValue(
-      COMPRESSION_TYPE compType, DataType actualDataType, DataType changedDataType) {
+  private static ValueCompressionHolder getValueCompressionHolder(COMPRESSION_TYPE compType,
+      DataType actualDataType, DataType changedDataType) {
     switch (compType) {
       case ADAPTIVE:
-        return getUnCompressNone(changedDataType, actualDataType);
+        return getCompressionNone(changedDataType, actualDataType);
       case DELTA_DOUBLE:
-        return getUnCompressDecimalMaxMin(changedDataType, actualDataType);
+        return getCompressionDecimalMaxMin(changedDataType, actualDataType);
       case DELTA_NON_DECIMAL:
-        return getUnCompressNonDecimalMaxMin(changedDataType);
+        return getCompressionNonDecimalMaxMin(changedDataType);
       case BIGINT:
-        return getUnCompressNonDecimal(changedDataType);
+        return getCompressionNonDecimal(changedDataType);
       default:
         throw new IllegalArgumentException("unsupported compType: " + compType);
     }
@@ -615,76 +603,76 @@ public final class ValueCompressionUtil {
   /**
    * uncompress data for example: int -> double
    */
-  public static ValueCompressonHolder.UnCompressValue getUnCompressNone(DataType compDataType,
+  public static ValueCompressionHolder getCompressionNone(DataType compDataType,
       DataType actualDataType) {
     switch (compDataType) {
       case DATA_BYTE:
-        return new UnCompressNoneByte(actualDataType);
+        return new CompressionNoneByte(actualDataType);
       case DATA_SHORT:
-        return new UnCompressNoneShort(actualDataType);
+        return new CompressionNoneShort(actualDataType);
       case DATA_INT:
-        return new UnCompressNoneInt(actualDataType);
+        return new CompressionNoneInt(actualDataType);
       case DATA_LONG:
-        return new UnCompressNoneLong(actualDataType);
+        return new CompressionNoneLong(actualDataType);
       default:
-        return new UnCompressNoneDefault(actualDataType);
+        return new CompressionNoneDefault(actualDataType);
     }
   }
 
   /**
    * uncompress data 1. value = maxValue - subValue 2. value: int->double
    */
-  public static ValueCompressonHolder.UnCompressValue getUnCompressDecimalMaxMin(
+  public static ValueCompressionHolder getCompressionDecimalMaxMin(
       DataType compDataType, DataType actualDataType) {
     switch (compDataType) {
       case DATA_BYTE:
-        return new UnCompressMaxMinByte(actualDataType);
+        return new CompressionMaxMinByte(actualDataType);
       case DATA_SHORT:
-        return new UnCompressMaxMinShort(actualDataType);
+        return new CompressionMaxMinShort(actualDataType);
       case DATA_INT:
-        return new UnCompressMaxMinInt(actualDataType);
+        return new CompressionMaxMinInt(actualDataType);
       case DATA_LONG:
-        return new UnCompressMaxMinLong(actualDataType);
+        return new CompressionMaxMinLong(actualDataType);
       default:
-        return new UnCompressMaxMinDefault(actualDataType);
+        return new CompressionMaxMinDefault(actualDataType);
     }
   }
 
   /**
    * uncompress data value = value/Math.pow(10, mantissa)
    */
-  public static ValueCompressonHolder.UnCompressValue getUnCompressNonDecimal(
+  public static ValueCompressionHolder getCompressionNonDecimal(
       DataType compDataType) {
     switch (compDataType) {
       case DATA_BYTE:
-        return new UnCompressNonDecimalByte();
+        return new CompressionNonDecimalByte();
       case DATA_SHORT:
-        return new UnCompressNonDecimalShort();
+        return new CompressionNonDecimalShort();
       case DATA_INT:
-        return new UnCompressNonDecimalInt();
+        return new CompressionNonDecimalInt();
       case DATA_LONG:
-        return new UnCompressNonDecimalLong();
+        return new CompressionNonDecimalLong();
       default:
-        return new UnCompressNonDecimalDefault();
+        return new CompressionNonDecimalDefault();
     }
   }
 
   /**
    * uncompress data value = (maxValue - subValue)/Math.pow(10, mantissa)
    */
-  public static ValueCompressonHolder.UnCompressValue getUnCompressNonDecimalMaxMin(
+  public static ValueCompressionHolder getCompressionNonDecimalMaxMin(
       DataType compDataType) {
     switch (compDataType) {
       case DATA_BYTE:
-        return new UnCompressNonDecimalMaxMinByte();
+        return new CompressionNonDecimalMaxMinByte();
       case DATA_SHORT:
-        return new UnCompressNonDecimalMaxMinShort();
+        return new CompressionNonDecimalMaxMinShort();
       case DATA_INT:
-        return new UnCompressNonDecimalMaxMinInt();
+        return new CompressionNonDecimalMaxMinInt();
       case DATA_LONG:
-        return new UnCompressNonDecimalMaxMinLong();
+        return new CompressionNonDecimalMaxMinLong();
       default:
-        return new UnCompressNonDecimalMaxMinDefault();
+        return new CompressionNonDecimalMaxMinDefault();
     }
   }
 
@@ -731,9 +719,9 @@ public final class ValueCompressionUtil {
     compressionModel.setUniqueValue(uniqueValue);
     compressionModel.setType(type);
     compressionModel.setDataTypeSelected(dataTypeSelected);
-    ValueCompressonHolder.UnCompressValue[] values = ValueCompressionUtil
-        .getUncompressedValues(compressionFinders);
-    compressionModel.setUnCompressValues(values);
+    ValueCompressionHolder[] values = ValueCompressionUtil
+        .getValueCompressionHolder(compressionFinders);
+    compressionModel.setValueCompressionHolder(values);
     return compressionModel;
   }
 
@@ -745,8 +733,8 @@ public final class ValueCompressionUtil {
     CompressionFinder compressFinder =
         getCompressionFinder(meta.getMaxValue(), meta.getMinValue(), meta.getMantissa(),
             meta.getType(), meta.getDataTypeSelected());
-    compressModel.setUnCompressValues(
-          ValueCompressionUtil.getUncompressedValue(compressFinder));
+    compressModel.setValueCompressionHolder(
+          ValueCompressionUtil.getValueCompressionHolder(compressFinder));
     compressModel.setConvertedDataType(compressFinder.getConvertedDataType());
     compressModel.setValueEncoderMeta(meta);
     return compressModel;

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/6592cf4d/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java b/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java
index bfcbdb1..6772c9d 100644
--- a/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java
+++ b/core/src/test/java/org/apache/carbondata/core/util/ValueCompressionUtilTest.java
@@ -24,8 +24,8 @@ import static org.junit.Assert.assertTrue;
 import java.nio.ByteBuffer;
 
 import org.apache.carbondata.core.datastorage.store.compression.MeasureMetaDataModel;
-import org.apache.carbondata.core.datastorage.store.compression.ValueCompressonHolder;
 import org.apache.carbondata.core.datastorage.store.compression.WriterCompressModel;
+import org.apache.carbondata.core.datastorage.store.compression.ValueCompressionHolder;
 import org.apache.carbondata.core.datastorage.store.compression.decimal.*;
 import org.apache.carbondata.core.datastorage.store.compression.nondecimal.*;
 import org.apache.carbondata.core.datastorage.store.compression.none.*;
@@ -322,129 +322,129 @@ public class ValueCompressionUtilTest {
   }
 
   @Test public void testToUnCompressNone() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNone(DataType.DATA_BIGINT, DataType.DATA_BIGINT);
-    assertEquals(result.getClass(), UnCompressNoneDefault.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNone(DataType.DATA_BIGINT, DataType.DATA_BIGINT);
+    assertEquals(result.getClass(), CompressionNoneDefault.class);
   }
 
   @Test public void testToUnCompressNoneForByte() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNone(DataType.DATA_BYTE, DataType.DATA_FLOAT);
-    assertEquals(result.getClass(), UnCompressNoneByte.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNone(DataType.DATA_BYTE, DataType.DATA_FLOAT);
+    assertEquals(result.getClass(), CompressionNoneByte.class);
   }
 
   @Test public void testToUnCompressNoneForLong() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNone(DataType.DATA_LONG, DataType.DATA_FLOAT);
-    assertEquals(result.getClass(), UnCompressNoneLong.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNone(DataType.DATA_LONG, DataType.DATA_FLOAT);
+    assertEquals(result.getClass(), CompressionNoneLong.class);
   }
 
   @Test public void testToUnCompressNoneForShort() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNone(DataType.DATA_SHORT, DataType.DATA_FLOAT);
-    assertEquals(result.getClass(), UnCompressNoneShort.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNone(DataType.DATA_SHORT, DataType.DATA_FLOAT);
+    assertEquals(result.getClass(), CompressionNoneShort.class);
   }
 
   @Test public void testToUnCompressNoneForInt() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNone(DataType.DATA_INT, DataType.DATA_FLOAT);
-    assertEquals(result.getClass(), UnCompressNoneInt.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNone(DataType.DATA_INT, DataType.DATA_FLOAT);
+    assertEquals(result.getClass(), CompressionNoneInt.class);
   }
 
   @Test public void testToUnCompressNoneForDouble() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNone(DataType.DATA_DOUBLE, DataType.DATA_FLOAT);
-    assertEquals(result.getClass(), UnCompressNoneDefault.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNone(DataType.DATA_DOUBLE, DataType.DATA_FLOAT);
+    assertEquals(result.getClass(), CompressionNoneDefault.class);
   }
 
   @Test public void testToUnCompressMaxMinForDouble() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressDecimalMaxMin(DataType.DATA_DOUBLE, null);
-    assertEquals(result.getClass(), UnCompressMaxMinDefault.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionDecimalMaxMin(DataType.DATA_DOUBLE, null);
+    assertEquals(result.getClass(), CompressionMaxMinDefault.class);
   }
 
   @Test public void testToUnCompressMaxMinForInt() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressDecimalMaxMin(DataType.DATA_INT, null);
-    assertEquals(result.getClass(), UnCompressMaxMinInt.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionDecimalMaxMin(DataType.DATA_INT, null);
+    assertEquals(result.getClass(), CompressionMaxMinInt.class);
   }
 
   @Test public void testToUnCompressMaxMinForLong() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressDecimalMaxMin(DataType.DATA_LONG, null);
-    assertEquals(result.getClass(), UnCompressMaxMinLong.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionDecimalMaxMin(DataType.DATA_LONG, null);
+    assertEquals(result.getClass(), CompressionMaxMinLong.class);
   }
 
   @Test public void testToUnCompressMaxMinForByte() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressDecimalMaxMin(DataType.DATA_BYTE, null);
-    assertEquals(result.getClass(), UnCompressMaxMinByte.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionDecimalMaxMin(DataType.DATA_BYTE, null);
+    assertEquals(result.getClass(), CompressionMaxMinByte.class);
   }
 
   @Test public void testToUnCompressMaxMinForShort() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressDecimalMaxMin(DataType.DATA_SHORT, null);
-    assertEquals(result.getClass(), UnCompressMaxMinShort.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionDecimalMaxMin(DataType.DATA_SHORT, null);
+    assertEquals(result.getClass(), CompressionMaxMinShort.class);
   }
 
   @Test public void testToUnCompressNonDecimalForDouble() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimal(DataType.DATA_DOUBLE);
-    assertEquals(result.getClass(), UnCompressNonDecimalDefault.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimal(DataType.DATA_DOUBLE);
+    assertEquals(result.getClass(), CompressionNonDecimalDefault.class);
   }
 
   @Test public void testToUnCompressNonDecimalForInt() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimal(DataType.DATA_INT);
-    assertEquals(result.getClass(), UnCompressNonDecimalInt.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimal(DataType.DATA_INT);
+    assertEquals(result.getClass(), CompressionNonDecimalInt.class);
   }
 
   @Test public void testToUnCompressNonDecimalForLong() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimal(DataType.DATA_LONG);
-    assertEquals(result.getClass(), UnCompressNonDecimalLong.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimal(DataType.DATA_LONG);
+    assertEquals(result.getClass(), CompressionNonDecimalLong.class);
   }
 
   @Test public void testToUnCompressNonDecimalForByte() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimal(DataType.DATA_BYTE);
-    assertEquals(result.getClass(), UnCompressNonDecimalByte.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimal(DataType.DATA_BYTE);
+    assertEquals(result.getClass(), CompressionNonDecimalByte.class);
   }
 
   @Test public void testToUnCompressNonDecimalForShort() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimal(DataType.DATA_SHORT);
-    assertEquals(result.getClass(), UnCompressNonDecimalShort.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimal(DataType.DATA_SHORT);
+    assertEquals(result.getClass(), CompressionNonDecimalShort.class);
   }
 
   @Test public void testToUnCompressNonDecimalMaxMinForDouble() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimalMaxMin(DataType.DATA_DOUBLE);
-    assertEquals(result.getClass(), UnCompressNonDecimalMaxMinDefault.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimalMaxMin(DataType.DATA_DOUBLE);
+    assertEquals(result.getClass(), CompressionNonDecimalMaxMinDefault.class);
   }
 
   @Test public void testToUnCompressNonDecimalMaxMinForInt() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimalMaxMin(DataType.DATA_INT);
-    assertEquals(result.getClass(), UnCompressNonDecimalMaxMinInt.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimalMaxMin(DataType.DATA_INT);
+    assertEquals(result.getClass(), CompressionNonDecimalMaxMinInt.class);
   }
 
   @Test public void testToUnCompressNonDecimalMaxMinForLong() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimalMaxMin(DataType.DATA_LONG);
-    assertEquals(result.getClass(), UnCompressNonDecimalMaxMinLong.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimalMaxMin(DataType.DATA_LONG);
+    assertEquals(result.getClass(), CompressionNonDecimalMaxMinLong.class);
   }
 
   @Test public void testToUnCompressNonDecimalMaxMinForByte() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimalMaxMin(DataType.DATA_BYTE);
-    assertEquals(result.getClass(), UnCompressNonDecimalMaxMinByte.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimalMaxMin(DataType.DATA_BYTE);
+    assertEquals(result.getClass(), CompressionNonDecimalMaxMinByte.class);
   }
 
   @Test public void testToUnCompressNonDecimalMaxMinForShort() {
-    ValueCompressonHolder.UnCompressValue result =
-        ValueCompressionUtil.getUnCompressNonDecimalMaxMin(DataType.DATA_SHORT);
-    assertEquals(result.getClass(), UnCompressNonDecimalMaxMinShort.class);
+    ValueCompressionHolder result =
+        ValueCompressionUtil.getCompressionNonDecimalMaxMin(DataType.DATA_SHORT);
+    assertEquals(result.getClass(), CompressionNonDecimalMaxMinShort.class);
   }
 
   @Test public void testToConvertToBytesForInt() {



Mime
View raw message