carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [4/9] incubator-carbondata git commit: clean up core
Date Wed, 04 Jan 2017 13:34:58 GMT
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/FilterUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/FilterUtil.java b/core/src/main/java/org/apache/carbondata/scan/filter/FilterUtil.java
index 943ea1a..90ef0bb 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/FilterUtil.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/FilterUtil.java
@@ -19,11 +19,23 @@
 
 package org.apache.carbondata.scan.filter;
 
+import java.io.IOException;
 import java.math.BigDecimal;
 import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.TreeSet;
 
 import org.apache.carbondata.common.logging.LogService;
 import org.apache.carbondata.common.logging.LogServiceFactory;
@@ -46,18 +58,25 @@ import org.apache.carbondata.core.keygenerator.KeyGenerator;
 import org.apache.carbondata.core.util.ByteUtil;
 import org.apache.carbondata.core.util.CarbonProperties;
 import org.apache.carbondata.core.util.CarbonUtil;
-import org.apache.carbondata.core.util.CarbonUtilException;
 import org.apache.carbondata.core.util.DataTypeUtil;
-import org.apache.carbondata.scan.executor.exception.QueryExecutionException;
 import org.apache.carbondata.scan.expression.ColumnExpression;
 import org.apache.carbondata.scan.expression.Expression;
 import org.apache.carbondata.scan.expression.ExpressionResult;
 import org.apache.carbondata.scan.expression.LiteralExpression;
-import org.apache.carbondata.scan.expression.UnknownExpression;
 import org.apache.carbondata.scan.expression.conditional.ListExpression;
 import org.apache.carbondata.scan.expression.exception.FilterIllegalMemberException;
 import org.apache.carbondata.scan.expression.exception.FilterUnsupportedException;
-import org.apache.carbondata.scan.filter.executer.*;
+import org.apache.carbondata.scan.filter.executer.AndFilterExecuterImpl;
+import org.apache.carbondata.scan.filter.executer.DimColumnExecuterFilterInfo;
+import org.apache.carbondata.scan.filter.executer.ExcludeColGroupFilterExecuterImpl;
+import org.apache.carbondata.scan.filter.executer.ExcludeFilterExecuterImpl;
+import org.apache.carbondata.scan.filter.executer.FilterExecuter;
+import org.apache.carbondata.scan.filter.executer.IncludeColGroupFilterExecuterImpl;
+import org.apache.carbondata.scan.filter.executer.IncludeFilterExecuterImpl;
+import org.apache.carbondata.scan.filter.executer.OrFilterExecuterImpl;
+import org.apache.carbondata.scan.filter.executer.RestructureFilterExecuterImpl;
+import org.apache.carbondata.scan.filter.executer.RowLevelFilterExecuterImpl;
+import org.apache.carbondata.scan.filter.executer.RowLevelRangeTypeExecuterFacory;
 import org.apache.carbondata.scan.filter.intf.ExpressionType;
 import org.apache.carbondata.scan.filter.intf.FilterExecuterType;
 import org.apache.carbondata.scan.filter.intf.RowImpl;
@@ -287,7 +306,7 @@ public final class FilterUtil {
     int j = 0;
     for (Iterator<Integer> iterator = integers.iterator(); iterator.hasNext(); ) {
       Integer integer = iterator.next();
-      byteIndexs[j++] = integer.intValue();
+      byteIndexs[j++] = integer;
     }
     return byteIndexs;
   }
@@ -296,14 +315,11 @@ public final class FilterUtil {
    * This method will get the no dictionary data based on filters and same
    * will be in DimColumnFilterInfo
    *
-   * @param tableIdentifier
-   * @param columnExpression
    * @param evaluateResultListFinal
    * @param isIncludeFilter
    * @return DimColumnFilterInfo
    */
   public static DimColumnFilterInfo getNoDictionaryValKeyMemberForFilter(
-      AbsoluteTableIdentifier tableIdentifier, ColumnExpression columnExpression,
       List<String> evaluateResultListFinal, boolean isIncludeFilter) {
     List<byte[]> filterValuesList = new ArrayList<byte[]>(20);
     for (String result : evaluateResultListFinal) {
@@ -338,11 +354,11 @@ public final class FilterUtil {
    * @param evaluateResultList
    * @param isIncludeFilter
    * @return
-   * @throws QueryExecutionException
+   * @throws IOException
    */
   public static DimColumnFilterInfo getFilterValues(AbsoluteTableIdentifier tableIdentifier,
       ColumnExpression columnExpression, List<String> evaluateResultList, boolean isIncludeFilter)
-      throws QueryExecutionException {
+      throws IOException {
     Dictionary forwardDictionary = null;
     try {
       // Reading the dictionary value from cache.
@@ -364,11 +380,9 @@ public final class FilterUtil {
    * @param forwardDictionary
    * @param isIncludeFilter
    * @return
-   * @throws QueryExecutionException
    */
   private static DimColumnFilterInfo getFilterValues(ColumnExpression columnExpression,
-      List<String> evaluateResultList, Dictionary forwardDictionary, boolean isIncludeFilter)
-      throws QueryExecutionException {
+      List<String> evaluateResultList, Dictionary forwardDictionary, boolean isIncludeFilter) {
     sortFilterModelMembers(columnExpression, evaluateResultList);
     List<Integer> surrogates =
         new ArrayList<Integer>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
@@ -390,10 +404,9 @@ public final class FilterUtil {
    *
    * @param evaluateResultList filter value
    * @param surrogates
-   * @throws QueryExecutionException
    */
   private static void getDictionaryValue(List<String> evaluateResultList,
-      Dictionary forwardDictionary, List<Integer> surrogates) throws QueryExecutionException {
+      Dictionary forwardDictionary, List<Integer> surrogates) {
     ((ForwardDictionary) forwardDictionary)
         .getSurrogateKeyByIncrementalSearch(evaluateResultList, surrogates);
   }
@@ -408,12 +421,12 @@ public final class FilterUtil {
    * @param isIncludeFilter
    * @return DimColumnFilterInfo
    * @throws FilterUnsupportedException
-   * @throws QueryExecutionException
+   * @throws IOException
    */
   public static DimColumnFilterInfo getFilterListForAllValues(
       AbsoluteTableIdentifier tableIdentifier, Expression expression,
       final ColumnExpression columnExpression, boolean isIncludeFilter)
-      throws FilterUnsupportedException {
+      throws IOException, FilterUnsupportedException {
     Dictionary forwardDictionary = null;
     List<String> evaluateResultListFinal = new ArrayList<String>(20);
     DictionaryChunksWrapper dictionaryWrapper = null;
@@ -433,7 +446,7 @@ public final class FilterUtil {
           row.setValues(new Object[] { DataTypeUtil.getDataBasedOnDataType(stringValue,
               columnExpression.getCarbonColumn().getDataType()) });
           Boolean rslt = expression.evaluate(row).getBoolean();
-          if (null != rslt && !(rslt ^ isIncludeFilter)) {
+          if (null != rslt && rslt == isIncludeFilter) {
             if (null == stringValue) {
               evaluateResultListFinal.add(CarbonCommonConstants.MEMBER_DEFAULT_VAL);
             } else {
@@ -446,8 +459,6 @@ public final class FilterUtil {
       }
       return getFilterValues(columnExpression, evaluateResultListFinal, forwardDictionary,
           isIncludeFilter);
-    } catch (QueryExecutionException e) {
-      throw new FilterUnsupportedException(e.getMessage());
     } finally {
       CarbonUtil.clearDictionaryCache(forwardDictionary);
     }
@@ -467,49 +478,6 @@ public final class FilterUtil {
   }
 
   /**
-   * Metahod will resolve the filter member to its respective surrogates by
-   * scanning the dictionary cache.
-   *
-   * @param tableIdentifier
-   * @param expression
-   * @param columnExpression
-   * @param isIncludeFilter
-   * @return
-   * @throws QueryExecutionException
-   * @throws FilterUnsupportedException
-   */
-  public static DimColumnFilterInfo getFilterList(AbsoluteTableIdentifier tableIdentifier,
-      Expression expression, ColumnExpression columnExpression, boolean isIncludeFilter)
-      throws QueryExecutionException, FilterUnsupportedException {
-    DimColumnFilterInfo resolvedFilterObject = null;
-    List<String> evaluateResultListFinal = new ArrayList<String>(20);
-    try {
-      List<ExpressionResult> evaluateResultList = expression.evaluate(null).getList();
-      for (ExpressionResult result : evaluateResultList) {
-        if (result.getString() == null) {
-          evaluateResultListFinal.add(CarbonCommonConstants.MEMBER_DEFAULT_VAL);
-          continue;
-        }
-        evaluateResultListFinal.add(result.getString());
-      }
-
-      if (null != columnExpression.getCarbonColumn() && !columnExpression.getCarbonColumn()
-          .hasEncoding(Encoding.DICTIONARY)) {
-        resolvedFilterObject =
-            getNoDictionaryValKeyMemberForFilter(tableIdentifier, columnExpression,
-                evaluateResultListFinal, isIncludeFilter);
-      } else {
-        resolvedFilterObject =
-            getFilterValues(tableIdentifier, columnExpression, evaluateResultListFinal,
-                isIncludeFilter);
-      }
-    } catch (FilterIllegalMemberException e) {
-      LOGGER.audit(e.getMessage());
-    }
-    return resolvedFilterObject;
-  }
-
-  /**
    * Method will prepare the  dimfilterinfo instance by resolving the filter
    * expression value to its respective surrogates in the scenario of restructure.
    *
@@ -584,7 +552,7 @@ public final class FilterUtil {
       row.setValues(new Object[] { DataTypeUtil.getDataBasedOnDataType(defaultValues,
           columnExpression.getCarbonColumn().getDataType()) });
       Boolean rslt = expression.evaluate(row).getBoolean();
-      if (null != rslt && !(rslt ^ isIncludeFilter)) {
+      if (null != rslt && rslt == isIncludeFilter) {
         if (null == defaultValues) {
           evaluateResultListFinal.add(CarbonCommonConstants.MEMBER_DEFAULT_VAL);
         } else {
@@ -686,7 +654,7 @@ public final class FilterUtil {
    * @return long[] start key
    */
   public static void getStartKey(Map<CarbonDimension, List<DimColumnFilterInfo>> dimensionFilter,
-      long[] startKey, List<long[]> startKeyList) throws QueryExecutionException {
+      long[] startKey, List<long[]> startKeyList) {
     for(int i = 0; i < startKey.length; i++) {
       // The min surrogate key is 1, set it as the init value for starkey of each column level
       startKey[i] = 1;
@@ -861,13 +829,13 @@ public final class FilterUtil {
   }
 
   public static void getEndKey(Map<CarbonDimension, List<DimColumnFilterInfo>> dimensionFilter,
-      AbsoluteTableIdentifier tableIdentifier, long[] endKey, SegmentProperties segmentProperties,
-      List<long[]> endKeyList) throws QueryExecutionException {
+      long[] endKey, SegmentProperties segmentProperties,
+      List<long[]> endKeyList) {
 
     List<CarbonDimension> updatedDimListBasedOnKeyGenerator =
         getCarbonDimsMappedToKeyGenerator(segmentProperties.getDimensions());
     for (int i = 0; i < endKey.length; i++) {
-      endKey[i] = getMaxValue(tableIdentifier, updatedDimListBasedOnKeyGenerator.get(i),
+      endKey[i] = getMaxValue(updatedDimListBasedOnKeyGenerator.get(i),
           segmentProperties.getDimColumnsCardinality());
     }
     getEndKeyWithFilter(dimensionFilter, endKey, endKeyList);
@@ -925,13 +893,8 @@ public final class FilterUtil {
    * determining the end key of particular btree.
    *
    * @param dimCarinality
-   * @throws QueryExecutionException
    */
-  private static long getMaxValue(AbsoluteTableIdentifier tableIdentifier,
-      CarbonDimension carbonDimension, int[] dimCarinality) throws QueryExecutionException {
-    //    if (DataType.TIMESTAMP == carbonDimension.getDataType()) {
-    //      return Integer.MAX_VALUE;
-    //    }
+  private static long getMaxValue(CarbonDimension carbonDimension, int[] dimCarinality) {
     // Get data from all the available slices of the table
     if (null != dimCarinality) {
       return dimCarinality[carbonDimension.getKeyOrdinal()];
@@ -943,10 +906,9 @@ public final class FilterUtil {
    * @param tableIdentifier
    * @param carbonDimension
    * @return
-   * @throws QueryExecutionException
    */
   public static Dictionary getForwardDictionaryCache(AbsoluteTableIdentifier tableIdentifier,
-      CarbonDimension carbonDimension) throws QueryExecutionException {
+      CarbonDimension carbonDimension) throws IOException {
     DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier =
         new DictionaryColumnUniqueIdentifier(tableIdentifier.getCarbonTableIdentifier(),
             carbonDimension.getColumnIdentifier(), carbonDimension.getDataType());
@@ -954,13 +916,7 @@ public final class FilterUtil {
     Cache<DictionaryColumnUniqueIdentifier, Dictionary> forwardDictionaryCache =
         cacheProvider.createCache(CacheType.FORWARD_DICTIONARY, tableIdentifier.getStorePath());
     // get the forward dictionary object
-    Dictionary forwardDictionary;
-    try {
-      forwardDictionary = forwardDictionaryCache.get(dictionaryColumnUniqueIdentifier);
-    } catch (CarbonUtilException e) {
-      throw new QueryExecutionException(e);
-    }
-    return forwardDictionary;
+    return forwardDictionaryCache.get(dictionaryColumnUniqueIdentifier);
   }
 
   public static IndexKey createIndexKeyFromResolvedFilterVal(long[] startOrEndKey,
@@ -1150,14 +1106,11 @@ public final class FilterUtil {
    * utilized visitor pattern inorder to populate the start and end key population.
    *
    * @param segmentProperties
-   * @param tableIdentifier
    * @param filterResolver
    * @param listOfStartEndKeys
-   * @throws QueryExecutionException
    */
   public static void traverseResolverTreeAndGetStartAndEndKey(SegmentProperties segmentProperties,
-      AbsoluteTableIdentifier tableIdentifier, FilterResolverIntf filterResolver,
-      List<IndexKey> listOfStartEndKeys) throws QueryExecutionException {
+      FilterResolverIntf filterResolver, List<IndexKey> listOfStartEndKeys) {
     IndexKey searchStartKey = null;
     IndexKey searchEndKey = null;
     long[] startKey = new long[segmentProperties.getDimensionKeyGenerator().getDimCount()];
@@ -1172,8 +1125,8 @@ public final class FilterUtil {
     SortedMap<Integer, byte[]> defaultEndValues = new TreeMap<Integer, byte[]>();
     List<long[]> startKeyList = new ArrayList<long[]>();
     List<long[]> endKeyList = new ArrayList<long[]>();
-    traverseResolverTreeAndPopulateStartAndEndKeys(filterResolver, tableIdentifier,
-        segmentProperties, startKey, setOfStartKeyByteArray, endKey, setOfEndKeyByteArray,
+    traverseResolverTreeAndPopulateStartAndEndKeys(filterResolver, segmentProperties, startKey,
+        setOfStartKeyByteArray, endKey, setOfEndKeyByteArray,
         startKeyList, endKeyList);
     if (endKeyList.size() > 0) {
       //get the new end key from list
@@ -1328,22 +1281,21 @@ public final class FilterUtil {
   }
 
   private static void traverseResolverTreeAndPopulateStartAndEndKeys(
-      FilterResolverIntf filterResolverTree, AbsoluteTableIdentifier tableIdentifier,
-      SegmentProperties segmentProperties, long[] startKeys,
+      FilterResolverIntf filterResolverTree, SegmentProperties segmentProperties, long[] startKeys,
       SortedMap<Integer, byte[]> setOfStartKeyByteArray, long[] endKeys,
       SortedMap<Integer, byte[]> setOfEndKeyByteArray, List<long[]> startKeyList,
-      List<long[]> endKeyList) throws QueryExecutionException {
+      List<long[]> endKeyList) {
     if (null == filterResolverTree) {
       return;
     }
-    traverseResolverTreeAndPopulateStartAndEndKeys(filterResolverTree.getLeft(), tableIdentifier,
+    traverseResolverTreeAndPopulateStartAndEndKeys(filterResolverTree.getLeft(),
         segmentProperties, startKeys, setOfStartKeyByteArray, endKeys, setOfEndKeyByteArray,
         startKeyList, endKeyList);
     filterResolverTree.getStartKey(startKeys, setOfStartKeyByteArray, startKeyList);
-    filterResolverTree.getEndKey(segmentProperties, tableIdentifier, endKeys, setOfEndKeyByteArray,
+    filterResolverTree.getEndKey(segmentProperties, endKeys, setOfEndKeyByteArray,
         endKeyList);
 
-    traverseResolverTreeAndPopulateStartAndEndKeys(filterResolverTree.getRight(), tableIdentifier,
+    traverseResolverTreeAndPopulateStartAndEndKeys(filterResolverTree.getRight(),
         segmentProperties, startKeys, setOfStartKeyByteArray, endKeys, setOfEndKeyByteArray,
         startKeyList, endKeyList);
   }
@@ -1377,24 +1329,11 @@ public final class FilterUtil {
    */
   public static void logError(Throwable e, boolean invalidRowsPresent) {
     if (!invalidRowsPresent) {
-      invalidRowsPresent = true;
       LOGGER.error(e, CarbonCommonConstants.FILTER_INVALID_MEMBER + e.getMessage());
     }
   }
 
   /**
-   * This method will return list of all the unknown expressions
-   *
-   * @param expression
-   */
-  public static List<UnknownExpression> getUnknownExpressionsList(Expression expression) {
-    List<UnknownExpression> listOfExp =
-        new ArrayList<UnknownExpression>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
-    getUnknownExpressionsList(expression, listOfExp);
-    return listOfExp;
-  }
-
-  /**
    * This method will compare double values for its equality and also it will preserve
    * the -0.0 and 0.0 equality as per == ,also preserve NaN equality check as per
    * java.lang.Double.equals()
@@ -1411,21 +1350,4 @@ public final class FilterUtil {
 
   }
 
-  /**
-   * This method will prepare the list with all unknown expressions
-   *
-   * @param expression
-   * @param lst
-   */
-  private static void getUnknownExpressionsList(Expression expression,
-      List<UnknownExpression> lst) {
-    if (expression instanceof UnknownExpression) {
-      UnknownExpression colExp = (UnknownExpression) expression;
-      lst.add(colExp);
-      return;
-    }
-    for (Expression child : expression.getChildren()) {
-      getUnknownExpressionsList(child, lst);
-    }
-  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/GenericQueryType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/GenericQueryType.java b/core/src/main/java/org/apache/carbondata/scan/filter/GenericQueryType.java
index 881489c..bcf0dc3 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/GenericQueryType.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/GenericQueryType.java
@@ -22,7 +22,6 @@ package org.apache.carbondata.scan.filter;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.util.List;
 
 import org.apache.carbondata.core.carbon.datastore.chunk.DimensionColumnDataChunk;
 import org.apache.carbondata.scan.processor.BlocksChunkHolder;
@@ -39,35 +38,16 @@ public interface GenericQueryType {
 
   void setParentname(String parentname);
 
-  int getBlockIndex();
-
-  void setBlockIndex(int blockIndex);
-
   void addChildren(GenericQueryType children);
 
-  void getAllPrimitiveChildren(List<GenericQueryType> primitiveChild);
-
-  int getSurrogateIndex();
-
-  void setSurrogateIndex(int surrIndex);
-
   int getColsCount();
 
-  void setKeySize(int[] keyBlockSize);
-
-  int getKeyOrdinalForQuery();
-
-  void setKeyOrdinalForQuery(int keyOrdinalForQuery);
-
   void parseBlocksAndReturnComplexColumnByteArray(DimensionColumnDataChunk[] dimensionDataChunks,
       int rowNumber, DataOutputStream dataOutputStream) throws IOException;
 
   DataType getSchemaType();
 
-  void parseAndGetResultBytes(ByteBuffer complexData, DataOutputStream dataOutput)
-      throws IOException;
-
-  void fillRequiredBlockData(BlocksChunkHolder blockChunkHolder);
+  void fillRequiredBlockData(BlocksChunkHolder blockChunkHolder) throws IOException;
 
   Object getDataBasedOnDataTypeFromSurrogates(ByteBuffer surrogateData);
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/AndFilterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/AndFilterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/AndFilterExecuterImpl.java
index cce4fe2..ff4f8ce 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/AndFilterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/AndFilterExecuterImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.executer;
 
+import java.io.IOException;
 import java.util.BitSet;
 
 import org.apache.carbondata.scan.expression.exception.FilterUnsupportedException;
@@ -34,7 +35,7 @@ public class AndFilterExecuterImpl implements FilterExecuter {
   }
 
   @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder)
-      throws FilterUnsupportedException {
+      throws FilterUnsupportedException, IOException {
     BitSet leftFilters = leftExecuter.applyFilter(blockChunkHolder);
     if (leftFilters.isEmpty()) {
       return leftFilters;

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeColGroupFilterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeColGroupFilterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeColGroupFilterExecuterImpl.java
index 4ef2c15..2b006dc 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeColGroupFilterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeColGroupFilterExecuterImpl.java
@@ -95,12 +95,10 @@ public class ExcludeColGroupFilterExecuterImpl extends ExcludeFilterExecuterImpl
     mdKeyOrdinal.add(getMdkeyOrdinal(dimColEvaluatorInfo.getColumnIndex(), colGrpId));
     int[] maskByteRanges = QueryUtil.getMaskedByteRangeBasedOrdinal(mdKeyOrdinal, keyGenerator);
     byte[] maxKey = QueryUtil.getMaxKeyBasedOnOrinal(mdKeyOrdinal, keyGenerator);
-    int[] maksedByte = QueryUtil.getMaskedByte(keyGenerator.getKeySizeInBytes(), maskByteRanges);
     KeyStructureInfo restructureInfos = new KeyStructureInfo();
     restructureInfos.setKeyGenerator(keyGenerator);
     restructureInfos.setMaskByteRanges(maskByteRanges);
     restructureInfos.setMaxKey(maxKey);
-    restructureInfos.setMaskedBytes(maksedByte);
     return restructureInfos;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeFilterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeFilterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeFilterExecuterImpl.java
index db4326b..b3136b6 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeFilterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/ExcludeFilterExecuterImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.executer;
 
+import java.io.IOException;
 import java.util.BitSet;
 import java.util.List;
 
@@ -46,7 +47,7 @@ public class ExcludeFilterExecuterImpl implements FilterExecuter {
         dimColEvaluatorInfo.getDimension(), dimColumnExecuterInfo);
   }
 
-  @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder) {
+  @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder) throws IOException {
     int blockIndex = segmentProperties.getDimensionOrdinalToBlockMapping()
         .get(dimColEvaluatorInfo.getColumnIndex());
     if (null == blockChunkHolder.getDimensionDataChunk()[blockIndex]) {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/FilterExecuter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/FilterExecuter.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/FilterExecuter.java
index 29a72da..8d03093 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/FilterExecuter.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/FilterExecuter.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.executer;
 
+import java.io.IOException;
 import java.util.BitSet;
 
 import org.apache.carbondata.scan.expression.exception.FilterUnsupportedException;
@@ -31,7 +32,8 @@ public interface FilterExecuter {
    * @return
    * @throws FilterUnsupportedException
    */
-  BitSet applyFilter(BlocksChunkHolder blocksChunkHolder) throws FilterUnsupportedException;
+  BitSet applyFilter(BlocksChunkHolder blocksChunkHolder)
+      throws FilterUnsupportedException, IOException;
 
   /**
    * API will verify whether the block can be shortlisted based on block

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeColGroupFilterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeColGroupFilterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeColGroupFilterExecuterImpl.java
index edceb82..57b1f4d 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeColGroupFilterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeColGroupFilterExecuterImpl.java
@@ -95,12 +95,10 @@ public class IncludeColGroupFilterExecuterImpl extends IncludeFilterExecuterImpl
     mdKeyOrdinal.add(getMdkeyOrdinal(dimColumnEvaluatorInfo.getColumnIndex(), colGrpId));
     int[] maskByteRanges = QueryUtil.getMaskedByteRangeBasedOrdinal(mdKeyOrdinal, keyGenerator);
     byte[] maxKey = QueryUtil.getMaxKeyBasedOnOrinal(mdKeyOrdinal, keyGenerator);
-    int[] maksedByte = QueryUtil.getMaskedByte(keyGenerator.getKeySizeInBytes(), maskByteRanges);
     KeyStructureInfo restructureInfos = new KeyStructureInfo();
     restructureInfos.setKeyGenerator(keyGenerator);
     restructureInfos.setMaskByteRanges(maskByteRanges);
     restructureInfos.setMaxKey(maxKey);
-    restructureInfos.setMaskedBytes(maksedByte);
     return restructureInfos;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeFilterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeFilterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeFilterExecuterImpl.java
index f399aa9..becec63 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeFilterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/IncludeFilterExecuterImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.executer;
 
+import java.io.IOException;
 import java.util.BitSet;
 import java.util.List;
 
@@ -42,13 +43,12 @@ public class IncludeFilterExecuterImpl implements FilterExecuter {
     this.dimColumnEvaluatorInfo = dimColumnEvaluatorInfo;
     this.segmentProperties = segmentProperties;
     dimColumnExecuterInfo = new DimColumnExecuterFilterInfo();
-    FilterUtil
-        .prepareKeysFromSurrogates(dimColumnEvaluatorInfo.getFilterValues(), segmentProperties,
-            dimColumnEvaluatorInfo.getDimension(), dimColumnExecuterInfo);
+    FilterUtil.prepareKeysFromSurrogates(dimColumnEvaluatorInfo.getFilterValues(),
+        segmentProperties, dimColumnEvaluatorInfo.getDimension(), dimColumnExecuterInfo);
 
   }
 
-  @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder) {
+  @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder) throws IOException {
     int blockIndex = segmentProperties.getDimensionOrdinalToBlockMapping()
         .get(dimColumnEvaluatorInfo.getColumnIndex());
     if (null == blockChunkHolder.getDimensionDataChunk()[blockIndex]) {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/OrFilterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/OrFilterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/OrFilterExecuterImpl.java
index 8fd5431..1ca89b1 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/OrFilterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/OrFilterExecuterImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.executer;
 
+import java.io.IOException;
 import java.util.BitSet;
 
 import org.apache.carbondata.scan.expression.exception.FilterUnsupportedException;
@@ -34,7 +35,7 @@ public class OrFilterExecuterImpl implements FilterExecuter {
   }
 
   @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder)
-      throws FilterUnsupportedException {
+      throws FilterUnsupportedException, IOException {
     BitSet leftFilters = leftExecuter.applyFilter(blockChunkHolder);
     BitSet rightFilters = rightExecuter.applyFilter(blockChunkHolder);
     leftFilters.or(rightFilters);

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelFilterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelFilterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelFilterExecuterImpl.java
index 00f80bb..678cf51 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelFilterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelFilterExecuterImpl.java
@@ -42,7 +42,6 @@ import org.apache.carbondata.core.keygenerator.directdictionary.DirectDictionary
 import org.apache.carbondata.core.keygenerator.directdictionary.DirectDictionaryKeyGeneratorFactory;
 import org.apache.carbondata.core.util.CarbonUtil;
 import org.apache.carbondata.core.util.DataTypeUtil;
-import org.apache.carbondata.scan.executor.exception.QueryExecutionException;
 import org.apache.carbondata.scan.executor.infos.KeyStructureInfo;
 import org.apache.carbondata.scan.executor.util.QueryUtil;
 import org.apache.carbondata.scan.expression.Expression;
@@ -94,7 +93,7 @@ public class RowLevelFilterExecuterImpl implements FilterExecuter {
   }
 
   @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder)
-      throws FilterUnsupportedException {
+      throws FilterUnsupportedException, IOException {
     for (int i = 0; i < dimColEvaluatorInfoList.size(); i++) {
       DimColumnResolvedFilterInfo dimColumnEvaluatorInfo = dimColEvaluatorInfoList.get(i);
       if (dimColumnEvaluatorInfo.getDimension().getDataType() != DataType.ARRAY
@@ -112,8 +111,8 @@ public class RowLevelFilterExecuterImpl implements FilterExecuter {
     // CHECKSTYLE:OFF Approval No:Approval-V1R2C10_001
     if (null != msrColEvalutorInfoList) {
       for (MeasureColumnResolvedFilterInfo msrColumnEvalutorInfo : msrColEvalutorInfoList) {
-        if (msrColumnEvalutorInfo.isMeasureExistsInCurrentSlice() && null == blockChunkHolder
-            .getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()]) {
+        if (null == blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()])
+        {
           blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()] =
               blockChunkHolder.getDataBlock().getMeasureChunk(blockChunkHolder.getFileReader(),
                   msrColumnEvalutorInfo.getColumnIndex());
@@ -127,11 +126,7 @@ public class RowLevelFilterExecuterImpl implements FilterExecuter {
     RowIntf row = new RowImpl();
     boolean invalidRowsPresent = false;
     for (int index = 0; index < numberOfRows; index++) {
-      try {
-        createRow(blockChunkHolder, row, index);
-      } catch (QueryExecutionException e) {
-        FilterUtil.logError(e, invalidRowsPresent);
-      }
+      createRow(blockChunkHolder, row, index);
       Boolean rslt = false;
       try {
         rslt = exp.evaluate(row).getBoolean();
@@ -156,12 +151,12 @@ public class RowLevelFilterExecuterImpl implements FilterExecuter {
    * @param blockChunkHolder
    * @param row
    * @param index
-   * @throws QueryExecutionException
+   * @throws IOException
    */
   private void createRow(BlocksChunkHolder blockChunkHolder, RowIntf row, int index)
-      throws QueryExecutionException {
+      throws IOException {
     Object[] record = new Object[dimColEvaluatorInfoList.size() + msrColEvalutorInfoList.size()];
-    String memberString = null;
+    String memberString;
     for (int i = 0; i < dimColEvaluatorInfoList.size(); i++) {
       DimColumnResolvedFilterInfo dimColumnEvaluatorInfo = dimColEvaluatorInfoList.get(i);
       if (dimColumnEvaluatorInfo.getDimension().getDataType() != DataType.ARRAY
@@ -178,7 +173,7 @@ public class RowLevelFilterExecuterImpl implements FilterExecuter {
                   .getDimensionDataChunk()[blocksIndex[i]];
           if (null != dimensionColumnDataChunk.getCompleteDataChunk()) {
             memberString =
-                readMemberBasedOnNoDictionaryVal(dimColumnEvaluatorInfo, dimensionColumnDataChunk,
+                readMemberBasedOnNoDictionaryVal(dimensionColumnDataChunk,
                     index);
             if (null != memberString) {
               if (memberString.equals(CarbonCommonConstants.MEMBER_DEFAULT_VAL)) {
@@ -195,12 +190,10 @@ public class RowLevelFilterExecuterImpl implements FilterExecuter {
           int dictionaryValue =
               readSurrogatesFromColumnBlock(blockChunkHolder, index, dimColumnEvaluatorInfo,
                   blocksIndex[i]);
-          Dictionary forwardDictionary = null;
           if (dimColumnEvaluatorInfo.getDimension().hasEncoding(Encoding.DICTIONARY)
               && !dimColumnEvaluatorInfo.getDimension().hasEncoding(Encoding.DIRECT_DICTIONARY)) {
             memberString =
-                getFilterActualValueFromDictionaryValue(dimColumnEvaluatorInfo, dictionaryValue,
-                    forwardDictionary);
+                getFilterActualValueFromDictionaryValue(dimColumnEvaluatorInfo, dictionaryValue);
             record[dimColumnEvaluatorInfo.getRowIndex()] = DataTypeUtil
                 .getDataBasedOnDataType(memberString,
                     dimColumnEvaluatorInfo.getDimension().getDataType());
@@ -244,32 +237,27 @@ public class RowLevelFilterExecuterImpl implements FilterExecuter {
           msrType = DataType.DOUBLE;
       }
       // if measure doesnt exist then set the default value.
-      if (!msrColumnEvalutorInfo.isMeasureExistsInCurrentSlice()) {
-        record[msrColumnEvalutorInfo.getRowIndex()] = msrColumnEvalutorInfo.getDefaultValue();
-      } else {
-        Object msrValue;
-        switch (msrType) {
-          case INT:
-          case LONG:
-            msrValue =
-                blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()]
-                    .getMeasureDataHolder().getReadableLongValueByIndex(index);
-            break;
-          case DECIMAL:
-            msrValue =
-                blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()]
-                    .getMeasureDataHolder().getReadableBigDecimalValueByIndex(index);
-            break;
-          default:
-            msrValue =
-                blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()]
-                    .getMeasureDataHolder().getReadableDoubleValueByIndex(index);
-        }
-        record[msrColumnEvalutorInfo.getRowIndex()] =
-            blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()]
-                .getNullValueIndexHolder().getBitSet().get(index) ? null : msrValue;
-
+      Object msrValue;
+      switch (msrType) {
+        case INT:
+        case LONG:
+          msrValue =
+              blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()]
+                  .getMeasureDataHolder().getReadableLongValueByIndex(index);
+          break;
+        case DECIMAL:
+          msrValue =
+              blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()]
+                  .getMeasureDataHolder().getReadableBigDecimalValueByIndex(index);
+          break;
+        default:
+          msrValue =
+              blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()]
+                  .getMeasureDataHolder().getReadableDoubleValueByIndex(index);
       }
+      record[msrColumnEvalutorInfo.getRowIndex()] =
+          blockChunkHolder.getMeasureDataChunk()[msrColumnEvalutorInfo.getColumnIndex()]
+              .getNullValueIndexHolder().getBitSet().get(index) ? null : msrValue;
     }
     row.setValues(record);
   }
@@ -299,20 +287,14 @@ public class RowLevelFilterExecuterImpl implements FilterExecuter {
    *
    * @param dimColumnEvaluatorInfo
    * @param dictionaryValue
-   * @param forwardDictionary
    * @return
-   * @throws QueryExecutionException
+   * @throws IOException
    */
   private String getFilterActualValueFromDictionaryValue(
-      DimColumnResolvedFilterInfo dimColumnEvaluatorInfo, int dictionaryValue,
-      Dictionary forwardDictionary) throws QueryExecutionException {
+      DimColumnResolvedFilterInfo dimColumnEvaluatorInfo, int dictionaryValue) throws IOException {
     String memberString;
-    try {
-      forwardDictionary = FilterUtil
-          .getForwardDictionaryCache(tableIdentifier, dimColumnEvaluatorInfo.getDimension());
-    } catch (QueryExecutionException e) {
-      throw new QueryExecutionException(e);
-    }
+    Dictionary forwardDictionary = FilterUtil.getForwardDictionaryCache(
+        tableIdentifier, dimColumnEvaluatorInfo.getDimension());
 
     memberString = forwardDictionary.getDictionaryValueForKey(dictionaryValue);
     if (null != memberString) {
@@ -375,13 +357,11 @@ public class RowLevelFilterExecuterImpl implements FilterExecuter {
    * directly the filter data will read, no need to scan the dictionary
    * or read the dictionary value.
    *
-   * @param dimColumnEvaluatorInfo
    * @param dimensionColumnDataChunk
    * @param index
    * @return
    */
   private String readMemberBasedOnNoDictionaryVal(
-      DimColumnResolvedFilterInfo dimColumnEvaluatorInfo,
       VariableLengthDimensionDataChunk dimensionColumnDataChunk, int index) {
     byte[] noDictionaryVals;
     if (null != dimensionColumnDataChunk.getAttributes().getInvertedIndexesReverse()) {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtThanFiterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtThanFiterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtThanFiterExecuterImpl.java
index 10b83d7..cb21c88 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtThanFiterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtThanFiterExecuterImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.executer;
 
+import java.io.IOException;
 import java.util.BitSet;
 import java.util.List;
 
@@ -73,7 +74,7 @@ public class RowLevelRangeGrtThanFiterExecuterImpl extends RowLevelFilterExecute
   }
 
   @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder)
-      throws FilterUnsupportedException {
+      throws FilterUnsupportedException, IOException {
     if (!dimColEvaluatorInfoList.get(0).getDimension().hasEncoding(Encoding.DICTIONARY)) {
       return super.applyFilter(blockChunkHolder);
     }
@@ -120,8 +121,8 @@ public class RowLevelRangeGrtThanFiterExecuterImpl extends RowLevelFilterExecute
           .getFirstIndexUsingBinarySearch(dimensionColumnDataChunk, startIndex, numerOfRows - 1,
               filterValues[i], true);
       if (start >= 0) {
-        start = CarbonUtil.nextGreaterValueToTarget(start,
-            (FixedLengthDimensionDataChunk) dimensionColumnDataChunk, filterValues[i], numerOfRows);
+        start = CarbonUtil.nextGreaterValueToTarget(start, dimensionColumnDataChunk,
+            filterValues[i], numerOfRows);
       }
       // Logic will handle the case where the range filter member is not present in block
       // in this case the binary search will return the index from where the bit sets will be

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtrThanEquaToFilterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtrThanEquaToFilterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtrThanEquaToFilterExecuterImpl.java
index 808cb51..7f4cc7c 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtrThanEquaToFilterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeGrtrThanEquaToFilterExecuterImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.executer;
 
+import java.io.IOException;
 import java.util.BitSet;
 import java.util.List;
 
@@ -74,7 +75,7 @@ public class RowLevelRangeGrtrThanEquaToFilterExecuterImpl extends RowLevelFilte
   }
 
   @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder)
-      throws FilterUnsupportedException {
+      throws FilterUnsupportedException, IOException {
     if (!dimColEvaluatorInfoList.get(0).getDimension().hasEncoding(Encoding.DICTIONARY)) {
       return super.applyFilter(blockChunkHolder);
     }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecuterImpl.java
index 367ebbd..4d7284d 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecuterImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.executer;
 
+import java.io.IOException;
 import java.util.BitSet;
 import java.util.List;
 
@@ -76,7 +77,7 @@ public class RowLevelRangeLessThanEqualFilterExecuterImpl extends RowLevelFilter
   }
 
   @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder)
-      throws FilterUnsupportedException {
+      throws FilterUnsupportedException, IOException {
     if (!dimColEvaluatorInfoList.get(0).getDimension().hasEncoding(Encoding.DICTIONARY)) {
       return super.applyFilter(blockChunkHolder);
     }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanFiterExecuterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanFiterExecuterImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanFiterExecuterImpl.java
index 31760e6..4819cb5 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanFiterExecuterImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeLessThanFiterExecuterImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.executer;
 
+import java.io.IOException;
 import java.util.BitSet;
 import java.util.List;
 
@@ -76,7 +77,7 @@ public class RowLevelRangeLessThanFiterExecuterImpl extends RowLevelFilterExecut
   }
 
   @Override public BitSet applyFilter(BlocksChunkHolder blockChunkHolder)
-      throws FilterUnsupportedException {
+      throws FilterUnsupportedException, IOException {
     if (!dimColEvaluatorInfoList.get(0).getDimension().hasEncoding(Encoding.DICTIONARY)) {
       return super.applyFilter(blockChunkHolder);
     }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeTypeExecuterFacory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeTypeExecuterFacory.java b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeTypeExecuterFacory.java
index 4c46f6d..cef0f06 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeTypeExecuterFacory.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/executer/RowLevelRangeTypeExecuterFacory.java
@@ -35,7 +35,6 @@ public class RowLevelRangeTypeExecuterFacory {
    *
    * @param filterExpressionResolverTree
    * @param segmentProperties
-   * @param dataType                     DataType
    * @return the generator instance
    */
   public static RowLevelFilterExecuterImpl getRowLevelRangeTypeExecuter(
@@ -49,7 +48,7 @@ public class RowLevelRangeTypeExecuterFacory {
                 .getDimColEvaluatorInfoList(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree)
                 .getMsrColEvalutorInfoList(),
-            ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree).getFilterExpression(),
+            filterExpressionResolverTree.getFilterExpression(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree).getTableIdentifier(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree)
                 .getFilterRangeValues(segmentProperties), segmentProperties);
@@ -59,7 +58,7 @@ public class RowLevelRangeTypeExecuterFacory {
                 .getDimColEvaluatorInfoList(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree)
                 .getMsrColEvalutorInfoList(),
-            ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree).getFilterExpression(),
+            filterExpressionResolverTree.getFilterExpression(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree).getTableIdentifier(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree)
                 .getFilterRangeValues(segmentProperties), segmentProperties);
@@ -69,7 +68,7 @@ public class RowLevelRangeTypeExecuterFacory {
                 .getDimColEvaluatorInfoList(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree)
                 .getMsrColEvalutorInfoList(),
-            ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree).getFilterExpression(),
+            filterExpressionResolverTree.getFilterExpression(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree).getTableIdentifier(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree)
                 .getFilterRangeValues(segmentProperties), segmentProperties);
@@ -79,7 +78,7 @@ public class RowLevelRangeTypeExecuterFacory {
                 .getDimColEvaluatorInfoList(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree)
                 .getMsrColEvalutorInfoList(),
-            ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree).getFilterExpression(),
+            filterExpressionResolverTree.getFilterExpression(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree).getTableIdentifier(),
             ((RowLevelRangeFilterResolverImpl) filterExpressionResolverTree)
                 .getFilterRangeValues(segmentProperties), segmentProperties);

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/AndFilterResolverImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/AndFilterResolverImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/AndFilterResolverImpl.java
deleted file mode 100644
index 2495621..0000000
--- a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/AndFilterResolverImpl.java
+++ /dev/null
@@ -1,56 +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.scan.filter.resolver;
-
-import java.util.List;
-import java.util.SortedMap;
-
-import org.apache.carbondata.core.carbon.AbsoluteTableIdentifier;
-import org.apache.carbondata.core.carbon.datastore.block.SegmentProperties;
-import org.apache.carbondata.scan.executor.exception.QueryExecutionException;
-import org.apache.carbondata.scan.expression.BinaryExpression;
-import org.apache.carbondata.scan.filter.intf.ExpressionType;
-
-public class AndFilterResolverImpl extends LogicalFilterResolverImpl {
-
-  /**
-   *i
-   */
-  private static final long serialVersionUID = -761688076874662001L;
-
-  public AndFilterResolverImpl(FilterResolverIntf leftEvalutor, FilterResolverIntf rightEvalutor,
-      ExpressionType filterExpressionType,BinaryExpression expression) {
-    super(leftEvalutor, rightEvalutor, expression);
-  }
-
-  @Override public void getStartKey(long[] startKeys,
-      SortedMap<Integer, byte[]> noDicStartKeys, List<long[]> startKeyList)
-      throws QueryExecutionException {
-    leftEvalutor.getStartKey(startKeys, noDicStartKeys, startKeyList);
-    rightEvalutor.getStartKey(startKeys, noDicStartKeys, startKeyList);
-  }
-
-  @Override public void getEndKey(SegmentProperties segmentProperties,
-      AbsoluteTableIdentifier tableIdentifier, long[] endKeys,
-      SortedMap<Integer, byte[]> noDicEndKeys, List<long[]> endKeyList)
-      throws QueryExecutionException {
-    leftEvalutor.getEndKey(segmentProperties, tableIdentifier, endKeys, noDicEndKeys, endKeyList);
-    rightEvalutor.getEndKey(segmentProperties, tableIdentifier, endKeys, noDicEndKeys, endKeyList);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/ConditionalFilterResolverImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/ConditionalFilterResolverImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/ConditionalFilterResolverImpl.java
index b8e0b79..d22bf38 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/ConditionalFilterResolverImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/ConditionalFilterResolverImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.carbondata.scan.filter.resolver;
 
+import java.io.IOException;
 import java.util.List;
 import java.util.SortedMap;
 
@@ -26,7 +27,6 @@ import org.apache.carbondata.core.carbon.datastore.block.SegmentProperties;
 import org.apache.carbondata.core.carbon.metadata.datatype.DataType;
 import org.apache.carbondata.core.carbon.metadata.encoder.Encoding;
 import org.apache.carbondata.core.carbon.metadata.schema.table.column.CarbonDimension;
-import org.apache.carbondata.scan.executor.exception.QueryExecutionException;
 import org.apache.carbondata.scan.expression.ColumnExpression;
 import org.apache.carbondata.scan.expression.Expression;
 import org.apache.carbondata.scan.expression.conditional.BinaryConditionalExpression;
@@ -59,11 +59,10 @@ public class ConditionalFilterResolverImpl implements FilterResolverIntf {
    * dictionaries for executing/evaluating the filter expressions in the
    * executer layer.
    *
-   * @throws QueryExecutionException
    * @throws FilterUnsupportedException
    */
   @Override public void resolve(AbsoluteTableIdentifier absoluteTableIdentifier)
-      throws FilterUnsupportedException {
+      throws FilterUnsupportedException, IOException {
     FilterResolverMetadata metadata = new FilterResolverMetadata();
     metadata.setTableIdentifier(absoluteTableIdentifier);
     if ((!isExpressionResolve) && exp instanceof BinaryConditionalExpression) {
@@ -189,32 +188,22 @@ public class ConditionalFilterResolverImpl implements FilterResolverIntf {
    * method will calculates the start key based on the filter surrogates
    */
   public void getStartKey(long[] startKey,
-      SortedMap<Integer, byte[]> setOfStartKeyByteArray, List<long[]> startKeyList)
-      throws QueryExecutionException {
-    if (null == dimColResolvedFilterInfo.getStarIndexKey()) {
-      FilterUtil.getStartKey(dimColResolvedFilterInfo.getDimensionResolvedFilterInstance(),
-          startKey, startKeyList);
-      FilterUtil.getStartKeyForNoDictionaryDimension(dimColResolvedFilterInfo,
-          setOfStartKeyByteArray);
-    }
+      SortedMap<Integer, byte[]> setOfStartKeyByteArray, List<long[]> startKeyList) {
+    FilterUtil.getStartKey(dimColResolvedFilterInfo.getDimensionResolvedFilterInstance(),
+        startKey, startKeyList);
+    FilterUtil.getStartKeyForNoDictionaryDimension(dimColResolvedFilterInfo,
+        setOfStartKeyByteArray);
   }
 
   /**
-   * method will get the start key based on the filter surrogates
-   *
-   * @return end IndexKey
-   * @throws QueryExecutionException
+   * get the start key based on the filter surrogates
    */
-  @Override public void getEndKey(SegmentProperties segmentProperties,
-      AbsoluteTableIdentifier absoluteTableIdentifier, long[] endKeys,
-      SortedMap<Integer, byte[]> setOfEndKeyByteArray, List<long[]> endKeyList)
-      throws QueryExecutionException {
-    if (null == dimColResolvedFilterInfo.getEndIndexKey()) {
-      FilterUtil.getEndKey(dimColResolvedFilterInfo.getDimensionResolvedFilterInstance(),
-          absoluteTableIdentifier, endKeys, segmentProperties, endKeyList);
-      FilterUtil.getEndKeyForNoDictionaryDimension(dimColResolvedFilterInfo,
-          setOfEndKeyByteArray);
-    }
+  @Override public void getEndKey(SegmentProperties segmentProperties, long[] endKeys,
+      SortedMap<Integer, byte[]> setOfEndKeyByteArray, List<long[]> endKeyList) {
+    FilterUtil.getEndKey(dimColResolvedFilterInfo.getDimensionResolvedFilterInstance(), endKeys,
+        segmentProperties, endKeyList);
+    FilterUtil.getEndKeyForNoDictionaryDimension(dimColResolvedFilterInfo,
+        setOfEndKeyByteArray);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/FilterResolverIntf.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/FilterResolverIntf.java b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/FilterResolverIntf.java
index cd108fb..dd6c5c8 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/FilterResolverIntf.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/FilterResolverIntf.java
@@ -18,13 +18,13 @@
  */
 package org.apache.carbondata.scan.filter.resolver;
 
+import java.io.IOException;
 import java.io.Serializable;
 import java.util.List;
 import java.util.SortedMap;
 
 import org.apache.carbondata.core.carbon.AbsoluteTableIdentifier;
 import org.apache.carbondata.core.carbon.datastore.block.SegmentProperties;
-import org.apache.carbondata.scan.executor.exception.QueryExecutionException;
 import org.apache.carbondata.scan.expression.Expression;
 import org.apache.carbondata.scan.expression.exception.FilterUnsupportedException;
 import org.apache.carbondata.scan.filter.intf.FilterExecuterType;
@@ -37,10 +37,11 @@ public interface FilterResolverIntf extends Serializable {
    * dictionaries for executing/evaluating the filter expressions in the
    * executer layer.
    *
-   * @throws QueryExecutionException
+   * @throws IOException
    * @throws FilterUnsupportedException
    */
-  void resolve(AbsoluteTableIdentifier absoluteTableIdentifier) throws FilterUnsupportedException;
+  void resolve(AbsoluteTableIdentifier absoluteTableIdentifier)
+      throws IOException, FilterUnsupportedException;
 
   /**
    * This API will provide the left column filter expression
@@ -69,25 +70,22 @@ public interface FilterResolverIntf extends Serializable {
   /**
    * API will get the start key based on the filter applied based on the key generator
    *
-   * @param segmentProperties
    * @param startKey
    * @param setOfStartKeyByteArray
    */
   void getStartKey(long[] startKey, SortedMap<Integer, byte[]> setOfStartKeyByteArray,
-      List<long[]> startKeyList) throws QueryExecutionException;
+      List<long[]> startKeyList);
 
   /**
    * API will read the end key based on the max surrogate of
    * particular dimension column
    *
-   * @param setOfEndKeyByteArray
    * @param endKeys
+   * @param setOfEndKeyByteArray
    * @return
-   * @throws QueryExecutionException
    */
-  void getEndKey(SegmentProperties segmentProperties, AbsoluteTableIdentifier tableIdentifier,
-      long[] endKeys, SortedMap<Integer, byte[]> setOfEndKeyByteArray, List<long[]> endKeyList)
-      throws QueryExecutionException;
+  void getEndKey(SegmentProperties segmentProperties, long[] endKeys,
+      SortedMap<Integer, byte[]> setOfEndKeyByteArray, List<long[]> endKeyList);
 
   /**
    * API will return the filter executer type which will be used to evaluate

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/LogicalFilterResolverImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/LogicalFilterResolverImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/LogicalFilterResolverImpl.java
index 3ab3e25..4d09e65 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/LogicalFilterResolverImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/LogicalFilterResolverImpl.java
@@ -24,7 +24,6 @@ import java.util.SortedMap;
 
 import org.apache.carbondata.core.carbon.AbsoluteTableIdentifier;
 import org.apache.carbondata.core.carbon.datastore.block.SegmentProperties;
-import org.apache.carbondata.scan.executor.exception.QueryExecutionException;
 import org.apache.carbondata.scan.expression.BinaryExpression;
 import org.apache.carbondata.scan.expression.Expression;
 import org.apache.carbondata.scan.filter.intf.ExpressionType;
@@ -89,14 +88,12 @@ public class LogicalFilterResolverImpl implements FilterResolverIntf {
 
   @Override
   public void getStartKey(long[] startKey, SortedMap<Integer, byte[]> setOfStartKeyByteArray,
-      List<long[]> startKeyList) throws QueryExecutionException {
+      List<long[]> startKeyList) {
 
   }
 
-  @Override public void getEndKey(SegmentProperties segmentProperties,
-      AbsoluteTableIdentifier tableIdentifier, long[] endKeys,
-      SortedMap<Integer, byte[]> setOfEndKeyByteArray, List<long[]> endKeyList)
-      throws QueryExecutionException {
+  @Override public void getEndKey(SegmentProperties segmentProperties, long[] endKeys,
+      SortedMap<Integer, byte[]> setOfEndKeyByteArray, List<long[]> endKeyList) {
 
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RestructureFilterResolverImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RestructureFilterResolverImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RestructureFilterResolverImpl.java
deleted file mode 100644
index 15c015a..0000000
--- a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RestructureFilterResolverImpl.java
+++ /dev/null
@@ -1,208 +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.scan.filter.resolver;
-
-import java.util.List;
-import java.util.SortedMap;
-
-import org.apache.carbondata.core.carbon.AbsoluteTableIdentifier;
-import org.apache.carbondata.core.carbon.datastore.block.SegmentProperties;
-import org.apache.carbondata.core.carbon.metadata.datatype.DataType;
-import org.apache.carbondata.scan.expression.ColumnExpression;
-import org.apache.carbondata.scan.expression.Expression;
-import org.apache.carbondata.scan.expression.conditional.BinaryConditionalExpression;
-import org.apache.carbondata.scan.expression.conditional.ConditionalExpression;
-import org.apache.carbondata.scan.expression.exception.FilterUnsupportedException;
-import org.apache.carbondata.scan.filter.FilterUtil;
-import org.apache.carbondata.scan.filter.intf.FilterExecuterType;
-import org.apache.carbondata.scan.filter.resolver.resolverinfo.DimColumnResolvedFilterInfo;
-
-public class RestructureFilterResolverImpl implements FilterResolverIntf {
-  /**
-   *
-   */
-  private static final long serialVersionUID = -5399656036192814524L;
-
-  protected DimColumnResolvedFilterInfo dimColumnResolvedFilterInfo;
-
-  private Expression exp;
-
-  private String defaultValue;
-
-  private int surrogate;
-
-  private boolean isExpressionResolve;
-
-  private boolean isIncludeFilter;
-
-  public RestructureFilterResolverImpl(Expression exp, String defaultValue, int surrogate,
-      boolean isExpressionResolve, boolean isIncludeFilter) {
-    dimColumnResolvedFilterInfo = new DimColumnResolvedFilterInfo();
-    this.exp = exp;
-    this.defaultValue = defaultValue;
-    this.surrogate = surrogate;
-    this.isExpressionResolve = isExpressionResolve;
-    this.isIncludeFilter = isIncludeFilter;
-  }
-
-  /**
-   * Method will resolve the filters and it will replace the newly added dimension with default
-   * value
-   *
-   * @param absoluteTableIdentifier
-   * @throws FilterUnsupportedException
-   */
-  @Override public void resolve(AbsoluteTableIdentifier absoluteTableIdentifier)
-      throws FilterUnsupportedException {
-
-    DimColumnResolvedFilterInfo dimColumnResolvedFilterInfo = new DimColumnResolvedFilterInfo();
-    if (!this.isExpressionResolve && exp instanceof BinaryConditionalExpression) {
-      BinaryConditionalExpression binaryConditionalExpression = (BinaryConditionalExpression) exp;
-      Expression left = binaryConditionalExpression.getLeft();
-      Expression right = binaryConditionalExpression.getRight();
-      if (left instanceof ColumnExpression) {
-        ColumnExpression columnExpression = (ColumnExpression) left;
-        if (columnExpression.getDataType().equals(DataType.TIMESTAMP) ||
-            columnExpression.getDataType().equals(DataType.DATE) ) {
-          isExpressionResolve = true;
-        } else {
-          // If imei=imei comes in filter condition then we need to
-          // skip processing of right expression.
-          // This flow has reached here assuming that this is a single
-          // column expression.
-          // we need to check if the other expression contains column
-          // expression or not in depth.
-          if (FilterUtil.checkIfExpressionContainsColumn(right)) {
-            isExpressionResolve = true;
-          } else {
-            dimColumnResolvedFilterInfo
-                .setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
-            dimColumnResolvedFilterInfo.setFilterValues(
-                FilterUtil.getFilterListForRS(right, columnExpression, defaultValue, surrogate));
-          }
-        }
-      } else if (right instanceof ColumnExpression) {
-        ColumnExpression columnExpression = (ColumnExpression) right;
-        if (columnExpression.getDataType().equals(DataType.TIMESTAMP) ||
-            columnExpression.getDataType().equals(DataType.DATE)) {
-          isExpressionResolve = true;
-        } else {
-
-          // If imei=imei comes in filter condition then we need to
-          // skip processing of right expression.
-          // This flow has reached here assuming that this is a single
-          // column expression.
-          // we need to check if the other expression contains column
-          // expression or not in depth.
-          if (checkIfExpressionContainsColumn(left)) {
-            isExpressionResolve = true;
-          } else {
-            dimColumnResolvedFilterInfo
-                .setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
-            dimColumnResolvedFilterInfo.setFilterValues(
-                FilterUtil.getFilterListForRS(left, columnExpression, defaultValue, surrogate));
-          }
-        }
-      }
-    }
-    if (this.isExpressionResolve && exp instanceof ConditionalExpression) {
-      ConditionalExpression conditionalExpression = (ConditionalExpression) exp;
-      List<ColumnExpression> columnList = conditionalExpression.getColumnList();
-      dimColumnResolvedFilterInfo.setColumnIndex(columnList.get(0).getDimension().getOrdinal());
-      dimColumnResolvedFilterInfo.setFilterValues(FilterUtil
-          .getFilterListForAllMembersRS(exp, columnList.get(0), defaultValue, surrogate,
-              isIncludeFilter));
-    }
-
-  }
-
-  /**
-   * This method will check if a given expression contains a column expression recursively.
-   *
-   * @return boolean
-   */
-  private boolean checkIfExpressionContainsColumn(Expression expression) {
-    if (expression instanceof ColumnExpression) {
-      return true;
-    }
-    for (Expression child : expression.getChildren()) {
-      if (checkIfExpressionContainsColumn(child)) {
-        return true;
-      }
-    }
-
-    return false;
-  }
-
-  @Override public FilterResolverIntf getLeft() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override public FilterResolverIntf getRight() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  /**
-   * Method will return the DimColumnResolvedFilterInfo instance which consists
-   * the mapping of the respective dimension and its surrogates involved in
-   * filter expression.
-   *
-   * @return DimColumnResolvedFilterInfo
-   */
-  public DimColumnResolvedFilterInfo getDimColResolvedFilterInfo() {
-    return dimColumnResolvedFilterInfo;
-  }
-
-  /**
-   * For restructure resolver no implementation is required for getting
-   * the start key since it already has default values
-   */
-  @Override public void getStartKey(long[] startKeys,
-      SortedMap<Integer, byte[]> noDicStartKeys, List<long[]> startKeyList) {
-
-  }
-
-  /**
-   * For restructure resolver no implementation is required for getting
-   * the end  key since it already has default values
-   *
-   * @return IndexKey.
-   */
-  @Override public void getEndKey(SegmentProperties segmentProperties,
-      AbsoluteTableIdentifier tableIdentifier, long[] endKeys,
-      SortedMap<Integer, byte[]> noDicEndKeys, List<long[]> endKeyList) {
-  }
-
-  /**
-   * Method will get the executer type inorder to create filter executer tree
-   *
-   * @return FilterExecuterType
-   */
-  @Override public FilterExecuterType getFilterExecuterType() {
-    return FilterExecuterType.RESTRUCTURE;
-  }
-
-  @Override public Expression getFilterExpression() {
-    // TODO Auto-generated method stub
-    return exp;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelFilterResolverImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelFilterResolverImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelFilterResolverImpl.java
index 466d048..e6fb166 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelFilterResolverImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelFilterResolverImpl.java
@@ -23,7 +23,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.carbondata.core.carbon.AbsoluteTableIdentifier;
-import org.apache.carbondata.core.carbon.metadata.schema.table.column.CarbonMeasure;
 import org.apache.carbondata.core.constants.CarbonCommonConstants;
 import org.apache.carbondata.scan.expression.ColumnExpression;
 import org.apache.carbondata.scan.expression.Expression;
@@ -35,8 +34,6 @@ import org.apache.carbondata.scan.filter.resolver.resolverinfo.MeasureColumnReso
 public class RowLevelFilterResolverImpl extends ConditionalFilterResolverImpl {
 
   private static final long serialVersionUID = 176122729713729929L;
-  protected boolean isExpressionResolve;
-  protected boolean isIncludeFilter;
 
   private List<DimColumnResolvedFilterInfo> dimColEvaluatorInfoList;
   private List<MeasureColumnResolvedFilterInfo> msrColEvalutorInfoList;
@@ -74,10 +71,8 @@ public class RowLevelFilterResolverImpl extends ConditionalFilterResolverImpl {
         } else {
           msrColumnEvalutorInfo = new MeasureColumnResolvedFilterInfo();
           msrColumnEvalutorInfo.setRowIndex(index++);
-          msrColumnEvalutorInfo.setAggregator(
-              ((CarbonMeasure) columnExpression.getCarbonColumn()).getAggregateFunction());
           msrColumnEvalutorInfo
-              .setColumnIndex(((CarbonMeasure) columnExpression.getCarbonColumn()).getOrdinal());
+              .setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
           msrColumnEvalutorInfo.setType(columnExpression.getCarbonColumn().getDataType());
           msrColEvalutorInfoList.add(msrColumnEvalutorInfo);
         }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java
index f07fe98..66952f7 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/RowLevelRangeFilterResolverImpl.java
@@ -25,17 +25,13 @@ import java.util.Comparator;
 import java.util.List;
 import java.util.SortedMap;
 
-import org.apache.carbondata.common.logging.LogService;
-import org.apache.carbondata.common.logging.LogServiceFactory;
 import org.apache.carbondata.core.carbon.AbsoluteTableIdentifier;
 import org.apache.carbondata.core.carbon.datastore.block.SegmentProperties;
 import org.apache.carbondata.core.carbon.metadata.encoder.Encoding;
-import org.apache.carbondata.core.carbon.metadata.schema.table.column.CarbonMeasure;
 import org.apache.carbondata.core.constants.CarbonCommonConstants;
 import org.apache.carbondata.core.keygenerator.directdictionary.DirectDictionaryGenerator;
 import org.apache.carbondata.core.keygenerator.directdictionary.DirectDictionaryKeyGeneratorFactory;
 import org.apache.carbondata.core.util.ByteUtil;
-import org.apache.carbondata.scan.executor.exception.QueryExecutionException;
 import org.apache.carbondata.scan.expression.ColumnExpression;
 import org.apache.carbondata.scan.expression.Expression;
 import org.apache.carbondata.scan.expression.ExpressionResult;
@@ -55,8 +51,6 @@ public class RowLevelRangeFilterResolverImpl extends ConditionalFilterResolverIm
    *
    */
   private static final long serialVersionUID = 6629319265336666789L;
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(RowLevelRangeFilterResolverImpl.class.getName());
   private List<DimColumnResolvedFilterInfo> dimColEvaluatorInfoList;
   private List<MeasureColumnResolvedFilterInfo> msrColEvalutorInfoList;
   private AbsoluteTableIdentifier tableIdentifier;
@@ -101,16 +95,10 @@ public class RowLevelRangeFilterResolverImpl extends ConditionalFilterResolverIm
    */
   public void getStartKey(long[] startKey,
       SortedMap<Integer, byte[]> noDictStartKeys, List<long[]> startKeyList) {
-    if (null == dimColEvaluatorInfoList.get(0).getStarIndexKey()) {
-      try {
-        FilterUtil.getStartKey(dimColEvaluatorInfoList.get(0).getDimensionResolvedFilterInstance(),
-            startKey, startKeyList);
-        FilterUtil
-            .getStartKeyForNoDictionaryDimension(dimColEvaluatorInfoList.get(0), noDictStartKeys);
-      } catch (QueryExecutionException e) {
-        LOGGER.error("Can not get the start key during block prune");
-      }
-    }
+    FilterUtil.getStartKey(dimColEvaluatorInfoList.get(0).getDimensionResolvedFilterInstance(),
+        startKey, startKeyList);
+    FilterUtil
+        .getStartKeyForNoDictionaryDimension(dimColEvaluatorInfoList.get(0), noDictStartKeys);
   }
 
   /**
@@ -118,20 +106,12 @@ public class RowLevelRangeFilterResolverImpl extends ConditionalFilterResolverIm
    *
    * @return end IndexKey
    */
-  @Override public void getEndKey(SegmentProperties segmentProperties,
-      AbsoluteTableIdentifier absoluteTableIdentifier, long[] endKeys,
+  @Override public void getEndKey(SegmentProperties segmentProperties, long[] endKeys,
       SortedMap<Integer, byte[]> noDicEndKeys, List<long[]> endKeyList) {
-    if (null == dimColEvaluatorInfoList.get(0).getEndIndexKey()) {
-      try {
-        FilterUtil.getEndKey(dimColEvaluatorInfoList.get(0).getDimensionResolvedFilterInstance(),
-            absoluteTableIdentifier, endKeys, segmentProperties, endKeyList);
-        FilterUtil
-            .getEndKeyForNoDictionaryDimension(dimColEvaluatorInfoList.get(0), noDicEndKeys);
-      } catch (QueryExecutionException e) {
-        // TODO Auto-generated catch block
-        LOGGER.error("Can not get the end key during block prune");
-      }
-    }
+    FilterUtil.getEndKey(dimColEvaluatorInfoList.get(0).getDimensionResolvedFilterInstance(),
+        endKeys, segmentProperties, endKeyList);
+    FilterUtil
+        .getEndKeyForNoDictionaryDimension(dimColEvaluatorInfoList.get(0), noDicEndKeys);
   }
 
   private List<byte[]> getNoDictionaryRangeValues() {
@@ -170,7 +150,8 @@ public class RowLevelRangeFilterResolverImpl extends ConditionalFilterResolverIm
    * Method which will resolve the filter expression by converting the filter
    * member to its assigned dictionary values.
    */
-  public void resolve(AbsoluteTableIdentifier absoluteTableIdentifier) {
+  public void resolve(AbsoluteTableIdentifier absoluteTableIdentifier)
+      throws FilterUnsupportedException {
     DimColumnResolvedFilterInfo dimColumnEvaluatorInfo = null;
     MeasureColumnResolvedFilterInfo msrColumnEvalutorInfo = null;
     int index = 0;
@@ -182,7 +163,6 @@ public class RowLevelRangeFilterResolverImpl extends ConditionalFilterResolverIm
           dimColumnEvaluatorInfo = new DimColumnResolvedFilterInfo();
           DimColumnFilterInfo filterInfo = new DimColumnFilterInfo();
           dimColumnEvaluatorInfo.setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
-          //dimColumnEvaluatorInfo.se
           dimColumnEvaluatorInfo.setRowIndex(index++);
           dimColumnEvaluatorInfo.setDimension(columnExpression.getDimension());
           dimColumnEvaluatorInfo.setDimensionExistsInCurrentSilce(false);
@@ -199,10 +179,8 @@ public class RowLevelRangeFilterResolverImpl extends ConditionalFilterResolverIm
         } else {
           msrColumnEvalutorInfo = new MeasureColumnResolvedFilterInfo();
           msrColumnEvalutorInfo.setRowIndex(index++);
-          msrColumnEvalutorInfo.setAggregator(
-              ((CarbonMeasure) columnExpression.getCarbonColumn()).getAggregateFunction());
           msrColumnEvalutorInfo
-              .setColumnIndex(((CarbonMeasure) columnExpression.getCarbonColumn()).getOrdinal());
+              .setColumnIndex(columnExpression.getCarbonColumn().getOrdinal());
           msrColumnEvalutorInfo.setType(columnExpression.getCarbonColumn().getDataType());
           msrColEvalutorInfoList.add(msrColumnEvalutorInfo);
         }
@@ -210,7 +188,8 @@ public class RowLevelRangeFilterResolverImpl extends ConditionalFilterResolverIm
     }
   }
 
-  private List<Integer> getDirectSurrogateValues(ColumnExpression columnExpression) {
+  private List<Integer> getDirectSurrogateValues(ColumnExpression columnExpression)
+      throws FilterUnsupportedException {
     List<ExpressionResult> listOfExpressionResults = new ArrayList<ExpressionResult>(20);
     DirectDictionaryGenerator directDictionaryGenerator = DirectDictionaryKeyGeneratorFactory
         .getDirectDictionaryGenerator(columnExpression.getDimension().getDataType());
@@ -229,7 +208,7 @@ public class RowLevelRangeFilterResolverImpl extends ConditionalFilterResolverIm
                 CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT));
       }
     } catch (FilterIllegalMemberException e) {
-      new FilterUnsupportedException(e);
+      throw new FilterUnsupportedException(e);
     }
     return filterValuesList;
   }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/DimColumnResolvedFilterInfo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/DimColumnResolvedFilterInfo.java b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/DimColumnResolvedFilterInfo.java
index bf61d85..4c0eae6 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/DimColumnResolvedFilterInfo.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/DimColumnResolvedFilterInfo.java
@@ -19,21 +19,20 @@
 
 package org.apache.carbondata.scan.filter.resolver.resolverinfo;
 
+import java.io.IOException;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.carbondata.core.carbon.datastore.IndexKey;
 import org.apache.carbondata.core.carbon.metadata.schema.table.column.CarbonDimension;
 import org.apache.carbondata.scan.expression.exception.FilterUnsupportedException;
 import org.apache.carbondata.scan.filter.DimColumnFilterInfo;
 import org.apache.carbondata.scan.filter.resolver.metadata.FilterResolverMetadata;
-import org.apache.carbondata.scan.filter.resolver.resolverinfo.visitable.ResolvedFilterInfoVisitable;
 import org.apache.carbondata.scan.filter.resolver.resolverinfo.visitor.ResolvedFilterInfoVisitorIntf;
 
-public class DimColumnResolvedFilterInfo implements Serializable, ResolvedFilterInfoVisitable {
+public class DimColumnResolvedFilterInfo implements Serializable {
   /**
    *
    */
@@ -45,35 +44,17 @@ public class DimColumnResolvedFilterInfo implements Serializable, ResolvedFilter
   private int columnIndex = -1;
 
   /**
-   * need compressed data from file
-   */
-  private boolean needCompressedData;
-
-  /**
    * rowIndex
    */
   private int rowIndex = -1;
 
   private boolean isDimensionExistsInCurrentSilce = true;
 
-  private int rsSurrogates;
-
   private String defaultValue;
 
   private CarbonDimension dimension;
 
   /**
-   * start index key of the block based on the keygenerator
-   */
-  private transient IndexKey starIndexKey;
-
-  /**
-   * end index key  which is been formed considering the max surrogate values
-   * from dictionary cache
-   */
-  private transient IndexKey endIndexKey;
-
-  /**
    * reolved filter object of a particlar filter Expression.
    */
   private DimColumnFilterInfo resolvedFilterValueObj;
@@ -84,22 +65,6 @@ public class DimColumnResolvedFilterInfo implements Serializable, ResolvedFilter
     dimensionResolvedFilter = new HashMap<CarbonDimension, List<DimColumnFilterInfo>>(20);
   }
 
-  public IndexKey getStarIndexKey() {
-    return starIndexKey;
-  }
-
-  public void setStarIndexKey(IndexKey starIndexKey) {
-    this.starIndexKey = starIndexKey;
-  }
-
-  public IndexKey getEndIndexKey() {
-    return endIndexKey;
-  }
-
-  public void setEndIndexKey(IndexKey endIndexKey) {
-    this.endIndexKey = endIndexKey;
-  }
-
   public void addDimensionResolvedFilterInstance(CarbonDimension dimension,
       DimColumnFilterInfo filterResolvedObj) {
     List<DimColumnFilterInfo> currentVals = dimensionResolvedFilter.get(dimension);
@@ -132,14 +97,6 @@ public class DimColumnResolvedFilterInfo implements Serializable, ResolvedFilter
     this.columnIndex = columnIndex;
   }
 
-  public boolean isNeedCompressedData() {
-    return needCompressedData;
-  }
-
-  public void setNeedCompressedData(boolean needCompressedData) {
-    this.needCompressedData = needCompressedData;
-  }
-
   public DimColumnFilterInfo getFilterValues() {
     return resolvedFilterValueObj;
   }
@@ -164,14 +121,6 @@ public class DimColumnResolvedFilterInfo implements Serializable, ResolvedFilter
     this.isDimensionExistsInCurrentSilce = isDimensionExistsInCurrentSilce;
   }
 
-  public int getRsSurrogates() {
-    return rsSurrogates;
-  }
-
-  public void setRsSurrogates(int rsSurrogates) {
-    this.rsSurrogates = rsSurrogates;
-  }
-
   public String getDefaultValue() {
     return defaultValue;
   }
@@ -180,8 +129,8 @@ public class DimColumnResolvedFilterInfo implements Serializable, ResolvedFilter
     this.defaultValue = defaultValue;
   }
 
-  @Override public void populateFilterInfoBasedOnColumnType(ResolvedFilterInfoVisitorIntf visitor,
-      FilterResolverMetadata metadata) throws FilterUnsupportedException {
+  public void populateFilterInfoBasedOnColumnType(ResolvedFilterInfoVisitorIntf visitor,
+      FilterResolverMetadata metadata) throws FilterUnsupportedException, IOException {
     if (null != visitor) {
       visitor.populateFilterResolvedInfo(this, metadata);
       this.addDimensionResolvedFilterInstance(metadata.getColumnExpression().getDimension(),

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/MeasureColumnResolvedFilterInfo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/MeasureColumnResolvedFilterInfo.java b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/MeasureColumnResolvedFilterInfo.java
index 8055ae9..c02361b 100644
--- a/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/MeasureColumnResolvedFilterInfo.java
+++ b/core/src/main/java/org/apache/carbondata/scan/filter/resolver/resolverinfo/MeasureColumnResolvedFilterInfo.java
@@ -31,12 +31,6 @@ public class MeasureColumnResolvedFilterInfo implements Serializable {
 
   private int rowIndex = -1;
 
-  private Object uniqueValue;
-
-  private String aggregator;
-
-  private boolean isMeasureExistsInCurrentSlice = true;
-
   private Object defaultValue;
 
   private org.apache.carbondata.core.carbon.metadata.datatype.DataType type;
@@ -57,14 +51,6 @@ public class MeasureColumnResolvedFilterInfo implements Serializable {
     this.rowIndex = rowIndex;
   }
 
-  public Object getUniqueValue() {
-    return uniqueValue;
-  }
-
-  public void setUniqueValue(Object uniqueValue) {
-    this.uniqueValue = uniqueValue;
-  }
-
   public org.apache.carbondata.core.carbon.metadata.datatype.DataType getType() {
     return type;
   }
@@ -73,33 +59,12 @@ public class MeasureColumnResolvedFilterInfo implements Serializable {
     this.type = dataType;
   }
 
-  /**
-   * @return Returns the aggregator.
-   */
-  public String getAggregator() {
-    return aggregator;
-  }
-
-  /**
-   * @param aggregator The aggregator to set.
-   */
-  public void setAggregator(String aggregator) {
-    this.aggregator = aggregator;
-  }
-
   public boolean isMeasureExistsInCurrentSlice() {
-    return isMeasureExistsInCurrentSlice;
-  }
-
-  public void setMeasureExistsInCurrentSlice(boolean isMeasureExistsInCurrentSlice) {
-    this.isMeasureExistsInCurrentSlice = isMeasureExistsInCurrentSlice;
+    return true;
   }
 
   public Object getDefaultValue() {
     return defaultValue;
   }
 
-  public void setDefaultValue(double defaultValue) {
-    this.defaultValue = defaultValue;
-  }
 }


Mime
View raw message