carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [38/56] [abbrv] incubator-carbondata git commit: Refactor org.carbondata.query package (#692)
Date Thu, 23 Jun 2016 14:16:26 GMT
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/model/QueryModel.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/model/QueryModel.java b/core/src/main/java/org/carbondata/query/carbon/model/QueryModel.java
deleted file mode 100644
index 92334db..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/model/QueryModel.java
+++ /dev/null
@@ -1,516 +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.carbondata.query.carbon.model;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.carbondata.core.cache.dictionary.Dictionary;
-import org.carbondata.core.carbon.AbsoluteTableIdentifier;
-import org.carbondata.core.carbon.datastore.block.TableBlockInfo;
-import org.carbondata.core.carbon.metadata.schema.table.CarbonTable;
-import org.carbondata.core.carbon.metadata.schema.table.column.CarbonColumn;
-import org.carbondata.core.carbon.metadata.schema.table.column.CarbonDimension;
-import org.carbondata.core.carbon.metadata.schema.table.column.CarbonMeasure;
-import org.carbondata.core.util.CarbonUtil;
-import org.carbondata.query.expression.ColumnExpression;
-import org.carbondata.query.expression.Expression;
-import org.carbondata.query.expression.UnknownExpression;
-import org.carbondata.query.expression.conditional.ConditionalExpression;
-import org.carbondata.query.filter.resolver.FilterResolverIntf;
-
-/**
- * Query model which will have all the detail
- * about the query, This will be sent from driver to executor '
- * This will be refereed to executing the query.
- */
-public class QueryModel implements Serializable {
-
-  /**
-   * serialization version
-   */
-  private static final long serialVersionUID = -4674677234007089052L;
-
-  /**
-   * list of dimension selected for in query
-   */
-  private List<QueryDimension> queryDimension;
-
-  /**
-   * list of dimension in which sorting is applied
-   */
-  private List<QueryDimension> sortDimension;
-
-  /**
-   * list of measure selected in query
-   */
-  private List<QueryMeasure> queryMeasures;
-
-  /**
-   * query id
-   */
-  private String queryId;
-
-  /**
-   * to check if it a aggregate table
-   */
-  private boolean isAggTable;
-
-  /**
-   * filter tree
-   */
-  private FilterResolverIntf filterExpressionResolverTree;
-
-  /**
-   * in case of lime query we need to know how many
-   * records will passed from executor
-   */
-  private int limit;
-
-  /**
-   * to check if it is a count star query , so processing will be different
-   */
-  private boolean isCountStarQuery;
-
-  /**
-   * to check whether aggregation is required during query execution
-   */
-  private boolean detailQuery;
-
-  /**
-   * table block information in which query will be executed
-   */
-  private List<TableBlockInfo> tableBlockInfos;
-
-  /**
-   * sort in which dimension will be get sorted
-   */
-  private byte[] sortOrder;
-
-  /**
-   * absolute table identifier
-   */
-  private AbsoluteTableIdentifier absoluteTableIdentifier;
-  /**
-   * in case of detail query with sort we are spilling to disk
-   * to this location will be used to write the temp file in this location
-   */
-  private String queryTempLocation;
-
-  /**
-   * To handle most of the computation in query engines like spark and hive, carbon should give
-   * raw detailed records to it.
-   */
-  private boolean forcedDetailRawQuery;
-
-  /**
-   * paritition column list
-   */
-  private List<String> paritionColumns;
-
-  /**
-   * this will hold the information about the dictionary dimension
-   * which to
-   */
-  public transient Map<String, Dictionary> columnToDictionaryMapping;
-
-  /**
-   * table on which query will be executed
-   * TODO need to remove this ad pass only the path
-   * and carbon metadata will load the table from metadata file
-   */
-  private CarbonTable table;
-
-  /**
-   * This is used only whne [forcedDetailRawQuery = true]. By default forcedDetailRawQuery returns
-   * dictionary values. But user wants in detail raw bytes the user set this field to true.
-   */
-  private boolean rawBytesDetailQuery;
-
-  public QueryModel() {
-    tableBlockInfos = new ArrayList<TableBlockInfo>();
-    queryDimension = new ArrayList<QueryDimension>();
-    queryMeasures = new ArrayList<QueryMeasure>();
-    sortDimension = new ArrayList<QueryDimension>();
-    sortOrder = new byte[0];
-    paritionColumns = new ArrayList<String>();
-
-  }
-
-  public static QueryModel createModel(AbsoluteTableIdentifier absoluteTableIdentifier,
-      CarbonQueryPlan queryPlan, CarbonTable carbonTable) {
-    QueryModel queryModel = new QueryModel();
-    String factTableName = carbonTable.getFactTableName();
-    queryModel.setAbsoluteTableIdentifier(absoluteTableIdentifier);
-
-    fillQueryModel(queryPlan, carbonTable, queryModel, factTableName);
-
-    queryModel.setLimit(queryPlan.getLimit());
-    queryModel.setDetailQuery(queryPlan.isDetailQuery());
-    queryModel.setForcedDetailRawQuery(queryPlan.isRawDetailQuery());
-    queryModel.setQueryId(queryPlan.getQueryId());
-    queryModel.setQueryTempLocation(queryPlan.getOutLocationPath());
-    return queryModel;
-  }
-
-  private static void fillQueryModel(CarbonQueryPlan queryPlan, CarbonTable carbonTable,
-      QueryModel queryModel, String factTableName) {
-    queryModel.setAbsoluteTableIdentifier(carbonTable.getAbsoluteTableIdentifier());
-    queryModel.setQueryDimension(queryPlan.getDimensions());
-    fillSortInfoInModel(queryModel, queryPlan.getSortedDimemsions());
-    queryModel.setQueryMeasures(
-        queryPlan.getMeasures());
-    if (null != queryPlan.getFilterExpression()) {
-      processFilterExpression(queryPlan.getFilterExpression(),
-          carbonTable.getDimensionByTableName(factTableName),
-          carbonTable.getMeasureByTableName(factTableName));
-    }
-    queryModel.setCountStarQuery(queryPlan.isCountStarQuery());
-    //TODO need to remove this code, and executor will load the table
-    // from file metadata
-    queryModel.setTable(carbonTable);
-  }
-
-  private static void fillSortInfoInModel(QueryModel executorModel,
-      List<QueryDimension> sortedDims) {
-    if (null != sortedDims) {
-      byte[] sortOrderByteArray = new byte[sortedDims.size()];
-      int i = 0;
-      for (QueryColumn mdim : sortedDims) {
-        sortOrderByteArray[i++] = (byte) mdim.getSortOrder().ordinal();
-      }
-      executorModel.setSortOrder(sortOrderByteArray);
-      executorModel.setSortDimension(sortedDims);
-    } else {
-      executorModel.setSortOrder(new byte[0]);
-      executorModel.setSortDimension(new ArrayList<QueryDimension>(0));
-    }
-
-  }
-
-  public static void processFilterExpression(
-      Expression filterExpression, List<CarbonDimension> dimensions, List<CarbonMeasure> measures) {
-    if (null != filterExpression) {
-      if (null != filterExpression.getChildren() && filterExpression.getChildren().size() == 0) {
-        if (filterExpression instanceof ConditionalExpression) {
-          List<ColumnExpression> listOfCol =
-              ((ConditionalExpression) filterExpression).getColumnList();
-          for (ColumnExpression expression : listOfCol) {
-            setDimAndMsrColumnNode(dimensions, measures, (ColumnExpression) expression);
-          }
-
-        }
-      }
-      for (Expression expression : filterExpression.getChildren()) {
-
-        if (expression instanceof ColumnExpression) {
-          setDimAndMsrColumnNode(dimensions, measures, (ColumnExpression) expression);
-        } else if (expression instanceof UnknownExpression) {
-          UnknownExpression exp = ((UnknownExpression) expression);
-          List<ColumnExpression> listOfColExpression = exp.getAllColumnList();
-          for (ColumnExpression col : listOfColExpression) {
-            setDimAndMsrColumnNode(dimensions, measures, col);
-          }
-        } else {
-          processFilterExpression(expression, dimensions, measures);
-        }
-      }
-    }
-
-  }
-
-  private static CarbonMeasure getCarbonMetadataMeasure(String name, List<CarbonMeasure> measures) {
-    for (CarbonMeasure measure : measures) {
-      if (measure.getColName().equalsIgnoreCase(name)) {
-        return measure;
-      }
-    }
-    return null;
-  }
-
-  private static void setDimAndMsrColumnNode(List<CarbonDimension> dimensions,
-      List<CarbonMeasure> measures, ColumnExpression col) {
-    CarbonDimension dim;
-    CarbonMeasure msr;
-    String columnName;
-    columnName = col.getColumnName();
-    dim = CarbonUtil.findDimension(dimensions, columnName);
-    col.setCarbonColumn(dim);
-    col.setDimension(dim);
-    col.setDimension(true);
-    if (null == dim) {
-      msr = getCarbonMetadataMeasure(columnName, measures);
-      col.setCarbonColumn(msr);
-      col.setDimension(false);
-    }
-  }
-
-  /**
-   * It gets the projection columns
-   */
-  public CarbonColumn[] getProjectionColumns() {
-    CarbonColumn[] carbonColumns =
-        new CarbonColumn[getQueryDimension().size() + getQueryMeasures()
-            .size()];
-    for (QueryDimension dimension : getQueryDimension()) {
-      carbonColumns[dimension.getQueryOrder()] = dimension.getDimension();
-    }
-    for (QueryMeasure msr : getQueryMeasures()) {
-      carbonColumns[msr.getQueryOrder()] = msr.getMeasure();
-    }
-    return carbonColumns;
-  }
-
-  /**
-   * @return the queryDimension
-   */
-  public List<QueryDimension> getQueryDimension() {
-    return queryDimension;
-  }
-
-  /**
-   * @param queryDimension the queryDimension to set
-   */
-  public void setQueryDimension(List<QueryDimension> queryDimension) {
-    this.queryDimension = queryDimension;
-  }
-
-  /**
-   * @return the queryMeasures
-   */
-  public List<QueryMeasure> getQueryMeasures() {
-    return queryMeasures;
-  }
-
-  /**
-   * @param queryMeasures the queryMeasures to set
-   */
-  public void setQueryMeasures(List<QueryMeasure> queryMeasures) {
-    this.queryMeasures = queryMeasures;
-  }
-
-  /**
-   * @return the queryId
-   */
-  public String getQueryId() {
-    return queryId;
-  }
-
-  /**
-   * @param queryId the queryId to set
-   */
-  public void setQueryId(String queryId) {
-    this.queryId = queryId;
-  }
-
-  /**
-   * @return the isAggTable
-   */
-  public boolean isAggTable() {
-    return isAggTable;
-  }
-
-  /**
-   * @param isAggTable the isAggTable to set
-   */
-  public void setAggTable(boolean isAggTable) {
-    this.isAggTable = isAggTable;
-  }
-
-  /**
-   * @return the limit
-   */
-  public int getLimit() {
-    return limit;
-  }
-
-  /**
-   * @param limit the limit to set
-   */
-  public void setLimit(int limit) {
-    this.limit = limit;
-  }
-
-  /**
-   * @return the isCountStarQuery
-   */
-  public boolean isCountStarQuery() {
-    return isCountStarQuery;
-  }
-
-  /**
-   * @param isCountStarQuery the isCountStarQuery to set
-   */
-  public void setCountStarQuery(boolean isCountStarQuery) {
-    this.isCountStarQuery = isCountStarQuery;
-  }
-
-  /**
-   * @return the isdetailQuery
-   */
-  public boolean isDetailQuery() {
-    return detailQuery;
-  }
-
-  public void setDetailQuery(boolean detailQuery) {
-    this.detailQuery = detailQuery;
-  }
-
-  /**
-   * @return the tableBlockInfos
-   */
-  public List<TableBlockInfo> getTableBlockInfos() {
-    return tableBlockInfos;
-  }
-
-  /**
-   * @param tableBlockInfos the tableBlockInfos to set
-   */
-  public void setTableBlockInfos(List<TableBlockInfo> tableBlockInfos) {
-    this.tableBlockInfos = tableBlockInfos;
-  }
-
-  /**
-   * @return the queryTempLocation
-   */
-  public String getQueryTempLocation() {
-    return queryTempLocation;
-  }
-
-  /**
-   * @param queryTempLocation the queryTempLocation to set
-   */
-  public void setQueryTempLocation(String queryTempLocation) {
-    this.queryTempLocation = queryTempLocation;
-  }
-
-  /**
-   * @return the sortOrder
-   */
-  public byte[] getSortOrder() {
-    return sortOrder;
-  }
-
-  /**
-   * @param sortOrder the sortOrder to set
-   */
-  public void setSortOrder(byte[] sortOrder) {
-    this.sortOrder = sortOrder;
-  }
-
-  /**
-   * @return the sortDimension
-   */
-  public List<QueryDimension> getSortDimension() {
-    return sortDimension;
-  }
-
-  /**
-   * @param sortDimension the sortDimension to set
-   */
-  public void setSortDimension(List<QueryDimension> sortDimension) {
-    this.sortDimension = sortDimension;
-  }
-
-  /**
-   * @return the filterEvaluatorTree
-   */
-  public FilterResolverIntf getFilterExpressionResolverTree() {
-    return filterExpressionResolverTree;
-  }
-
-  public void setFilterExpressionResolverTree(FilterResolverIntf filterExpressionResolverTree) {
-    this.filterExpressionResolverTree = filterExpressionResolverTree;
-  }
-
-  /**
-   * @return the absoluteTableIdentifier
-   */
-  public AbsoluteTableIdentifier getAbsoluteTableIdentifier() {
-    return absoluteTableIdentifier;
-  }
-
-  /**
-   * @param absoluteTableIdentifier the absoluteTableIdentifier to set
-   */
-  public void setAbsoluteTableIdentifier(AbsoluteTableIdentifier absoluteTableIdentifier) {
-    this.absoluteTableIdentifier = absoluteTableIdentifier;
-  }
-
-  /**
-   * @return the paritionColumns
-   */
-  public List<String> getParitionColumns() {
-    return paritionColumns;
-  }
-
-  /**
-   * @param paritionColumns the paritionColumns to set
-   */
-  public void setParitionColumns(List<String> paritionColumns) {
-    this.paritionColumns = paritionColumns;
-  }
-
-  /**
-   * @return the table
-   */
-  public CarbonTable getTable() {
-    return table;
-  }
-
-  /**
-   * @param table the table to set
-   */
-  public void setTable(CarbonTable table) {
-    this.table = table;
-  }
-
-  public boolean isForcedDetailRawQuery() {
-    return forcedDetailRawQuery;
-  }
-
-  public void setForcedDetailRawQuery(boolean forcedDetailRawQuery) {
-    this.forcedDetailRawQuery = forcedDetailRawQuery;
-  }
-
-  /**
-   * @return
-   */
-  public Map<String, Dictionary> getColumnToDictionaryMapping() {
-    return columnToDictionaryMapping;
-  }
-
-  /**
-   * @param columnToDictionaryMapping
-   */
-  public void setColumnToDictionaryMapping(Map<String, Dictionary> columnToDictionaryMapping) {
-    this.columnToDictionaryMapping = columnToDictionaryMapping;
-  }
-
-  public boolean isRawBytesDetailQuery() {
-    return rawBytesDetailQuery;
-  }
-
-  public void setRawBytesDetailQuery(boolean rawBytesDetailQuery) {
-    this.rawBytesDetailQuery = rawBytesDetailQuery;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/model/QuerySchemaInfo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/model/QuerySchemaInfo.java b/core/src/main/java/org/carbondata/query/carbon/model/QuerySchemaInfo.java
deleted file mode 100644
index 2d1971d..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/model/QuerySchemaInfo.java
+++ /dev/null
@@ -1,86 +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.carbondata.query.carbon.model;
-
-import java.io.Serializable;
-
-import org.carbondata.core.keygenerator.KeyGenerator;
-
-public class QuerySchemaInfo implements Serializable {
-
-  private int[] maskedByteIndexes;
-
-  private KeyGenerator keyGenerator;
-
-  private QueryDimension[] queryDimensions;
-
-  private QueryMeasure[] queryMeasures;
-
-  private int[] queryOrder;
-
-  private int[] queryReverseOrder;
-
-  public int[] getMaskedByteIndexes() {
-    return maskedByteIndexes;
-  }
-
-  public void setMaskedByteIndexes(int[] maskedByteIndexes) {
-    this.maskedByteIndexes = maskedByteIndexes;
-  }
-
-  public KeyGenerator getKeyGenerator() {
-    return keyGenerator;
-  }
-
-  public void setKeyGenerator(KeyGenerator keyGenerator) {
-    this.keyGenerator = keyGenerator;
-  }
-
-  public QueryDimension[] getQueryDimensions() {
-    return queryDimensions;
-  }
-
-  public void setQueryDimensions(QueryDimension[] queryDimensions) {
-    this.queryDimensions = queryDimensions;
-  }
-
-  public QueryMeasure[] getQueryMeasures() {
-    return queryMeasures;
-  }
-
-  public void setQueryMeasures(QueryMeasure[] queryMeasures) {
-    this.queryMeasures = queryMeasures;
-  }
-
-  public int[] getQueryOrder() {
-    return queryOrder;
-  }
-
-  public void setQueryOrder(int[] queryOrder) {
-    this.queryOrder = queryOrder;
-  }
-
-  public int[] getQueryReverseOrder() {
-    return queryReverseOrder;
-  }
-
-  public void setQueryReverseOrder(int[] queryReverseOrder) {
-    this.queryReverseOrder = queryReverseOrder;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/model/SortOrderType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/model/SortOrderType.java b/core/src/main/java/org/carbondata/query/carbon/model/SortOrderType.java
deleted file mode 100644
index a734a46..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/model/SortOrderType.java
+++ /dev/null
@@ -1,57 +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.carbondata.query.carbon.model;
-
-/**
- * enum for sorting the columns
- */
-public enum SortOrderType {
-
-    /**
-     * Ascending order
-     */
-    ASC(0),
-
-    /**
-     * Descending order.
-     */
-    DSC(1),
-
-    /**
-     * No order mentioned
-     */
-    NONE(-1);
-  /**
-   * Order type in numeric
-   */
-  private int orderType;
-
-  SortOrderType(int orderType) {
-    this.orderType = orderType;
-  }
-
-  /**
-   * Order type in number
-   *
-   * @return orderType int
-   */
-  public int getOrderType() {
-    return orderType;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/processor/AbstractDataBlockIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/processor/AbstractDataBlockIterator.java b/core/src/main/java/org/carbondata/query/carbon/processor/AbstractDataBlockIterator.java
deleted file mode 100644
index 52b1bdf..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/processor/AbstractDataBlockIterator.java
+++ /dev/null
@@ -1,126 +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.carbondata.query.carbon.processor;
-
-import org.carbondata.common.logging.LogService;
-import org.carbondata.common.logging.LogServiceFactory;
-import org.carbondata.core.carbon.datastore.DataRefNode;
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.iterator.CarbonIterator;
-import org.carbondata.query.carbon.collector.ScannedResultCollector;
-import org.carbondata.query.carbon.collector.impl.ListBasedResultCollector;
-import org.carbondata.query.carbon.executor.exception.QueryExecutionException;
-import org.carbondata.query.carbon.executor.infos.BlockExecutionInfo;
-import org.carbondata.query.carbon.result.AbstractScannedResult;
-import org.carbondata.query.carbon.result.Result;
-import org.carbondata.query.carbon.scanner.BlockletScanner;
-import org.carbondata.query.carbon.scanner.impl.FilterScanner;
-import org.carbondata.query.carbon.scanner.impl.NonFilterScanner;
-
-/**
- * This abstract class provides a skeletal implementation of the
- * Block iterator.
- */
-public abstract class AbstractDataBlockIterator extends CarbonIterator<Result> {
-
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(AbstractDataBlockIterator.class.getName());
-  /**
-   * iterator which will be used to iterate over data blocks
-   */
-  protected CarbonIterator<DataRefNode> dataBlockIterator;
-
-  /**
-   * execution details
-   */
-  protected BlockExecutionInfo blockExecutionInfo;
-
-  /**
-   * result collector which will be used to aggregate the scanned result
-   */
-  protected ScannedResultCollector scannerResultAggregator;
-
-  /**
-   * processor which will be used to process the block processing can be
-   * filter processing or non filter processing
-   */
-  protected BlockletScanner blockletScanner;
-
-  /**
-   * to hold the data block
-   */
-  protected BlocksChunkHolder blocksChunkHolder;
-
-  /**
-   * batch size of result
-   */
-  protected int batchSize;
-
-  protected AbstractScannedResult scannedResult;
-
-  public AbstractDataBlockIterator(BlockExecutionInfo blockExecutionInfo,
-      FileHolder fileReader, int batchSize) {
-    this.blockExecutionInfo = blockExecutionInfo;
-    dataBlockIterator = new BlockletIterator(blockExecutionInfo.getFirstDataBlock(),
-        blockExecutionInfo.getNumberOfBlockToScan());
-    blocksChunkHolder = new BlocksChunkHolder(blockExecutionInfo.getTotalNumberDimensionBlock(),
-        blockExecutionInfo.getTotalNumberOfMeasureBlock());
-    blocksChunkHolder.setFileReader(fileReader);
-
-    if (blockExecutionInfo.getFilterExecuterTree() != null) {
-      blockletScanner = new FilterScanner(blockExecutionInfo);
-    } else {
-      blockletScanner = new NonFilterScanner(blockExecutionInfo);
-    }
-
-    this.scannerResultAggregator =
-        new ListBasedResultCollector(blockExecutionInfo);
-    this.batchSize = batchSize;
-  }
-
-  public boolean hasNext() {
-    try {
-      if (scannedResult != null && scannedResult.hasNext()) {
-        return true;
-      } else {
-        scannedResult = getNextScannedResult();
-        while (scannedResult != null) {
-          if (scannedResult.hasNext()) {
-            return true;
-          }
-          scannedResult = getNextScannedResult();
-        }
-        return false;
-      }
-    } catch (QueryExecutionException ex) {
-      throw new RuntimeException(ex);
-    }
-  }
-
-  private AbstractScannedResult getNextScannedResult() throws QueryExecutionException {
-    if (dataBlockIterator.hasNext()) {
-      blocksChunkHolder.setDataBlock(dataBlockIterator.next());
-      blocksChunkHolder.reset();
-      return blockletScanner.scanBlocklet(blocksChunkHolder);
-    }
-    return null;
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/processor/BlockletIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/processor/BlockletIterator.java b/core/src/main/java/org/carbondata/query/carbon/processor/BlockletIterator.java
deleted file mode 100644
index 307ff64..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/processor/BlockletIterator.java
+++ /dev/null
@@ -1,88 +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.carbondata.query.carbon.processor;
-
-import org.carbondata.core.carbon.datastore.DataRefNode;
-import org.carbondata.core.iterator.CarbonIterator;
-
-/**
- * Below class will be used to iterate over data block
- */
-public class BlockletIterator extends CarbonIterator<DataRefNode> {
-  /**
-   * data store block
-   */
-  protected DataRefNode datablock;
-  /**
-   * block counter to keep a track how many block has been processed
-   */
-  private int blockCounter;
-
-  /**
-   * flag to be used to check any more data block is present or not
-   */
-  private boolean hasNext = true;
-
-  /**
-   * total number blocks assgned to this iterator
-   */
-  private long totalNumberOfBlocksToScan;
-
-  /**
-   * Constructor
-   *
-   * @param datablock                 first data block
-   * @param totalNumberOfBlocksToScan total number of blocks to be scanned
-   */
-  public BlockletIterator(DataRefNode datablock, long totalNumberOfBlocksToScan) {
-    this.datablock = datablock;
-    this.totalNumberOfBlocksToScan = totalNumberOfBlocksToScan;
-  }
-
-  /**
-   * is all the blocks assigned to this iterator has been processed
-   */
-  @Override public boolean hasNext() {
-    return hasNext;
-  }
-
-  @Override
-  /**
-   * To get the next block
-   * @return next data block
-   *
-   */
-  public DataRefNode next() {
-    // get the current blocks
-    DataRefNode datablockTemp = datablock;
-    // store the next data block
-    datablock = datablock.getNextDataRefNode();
-    // increment the counter
-    blockCounter++;
-    // if all the data block is processed then
-    // set the has next flag to false
-    // or if number of blocks assigned to this iterator is processed
-    // then also set the hasnext flag to false
-    if (null == datablock || blockCounter >= this.totalNumberOfBlocksToScan) {
-      hasNext = false;
-    }
-    return datablockTemp;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/processor/BlocksChunkHolder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/processor/BlocksChunkHolder.java b/core/src/main/java/org/carbondata/query/carbon/processor/BlocksChunkHolder.java
deleted file mode 100644
index 35ab66d..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/processor/BlocksChunkHolder.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.carbondata.query.carbon.processor;
-
-import org.carbondata.core.carbon.datastore.DataRefNode;
-import org.carbondata.core.carbon.datastore.chunk.DimensionColumnDataChunk;
-import org.carbondata.core.carbon.datastore.chunk.MeasureColumnDataChunk;
-import org.carbondata.core.datastorage.store.FileHolder;
-
-/**
- * Block chunk holder which will hold the dimension and
- * measure chunk
- */
-public class BlocksChunkHolder {
-
-  /**
-   * dimension column data chunk
-   */
-  private DimensionColumnDataChunk[] dimensionDataChunk;
-
-  /**
-   * measure column data chunk
-   */
-  private MeasureColumnDataChunk[] measureDataChunk;
-
-  /**
-   * file reader which will use to read the block from file
-   */
-  private FileHolder fileReader;
-
-  /**
-   * data block
-   */
-  private DataRefNode dataBlock;
-
-  public BlocksChunkHolder(int numberOfDimensionBlock, int numberOfMeasureBlock) {
-    dimensionDataChunk = new DimensionColumnDataChunk[numberOfDimensionBlock];
-    measureDataChunk = new MeasureColumnDataChunk[numberOfMeasureBlock];
-  }
-
-  /**
-   * @return the dimensionDataChunk
-   */
-  public DimensionColumnDataChunk[] getDimensionDataChunk() {
-    return dimensionDataChunk;
-  }
-
-  /**
-   * @param dimensionDataChunk the dimensionDataChunk to set
-   */
-  public void setDimensionDataChunk(DimensionColumnDataChunk[] dimensionDataChunk) {
-    this.dimensionDataChunk = dimensionDataChunk;
-  }
-
-  /**
-   * @return the measureDataChunk
-   */
-  public MeasureColumnDataChunk[] getMeasureDataChunk() {
-    return measureDataChunk;
-  }
-
-  /**
-   * @param measureDataChunk the measureDataChunk to set
-   */
-  public void setMeasureDataChunk(MeasureColumnDataChunk[] measureDataChunk) {
-    this.measureDataChunk = measureDataChunk;
-  }
-
-  /**
-   * @return the fileReader
-   */
-  public FileHolder getFileReader() {
-    return fileReader;
-  }
-
-  /**
-   * @param fileReader the fileReader to set
-   */
-  public void setFileReader(FileHolder fileReader) {
-    this.fileReader = fileReader;
-  }
-
-  /**
-   * @return the dataBlock
-   */
-  public DataRefNode getDataBlock() {
-    return dataBlock;
-  }
-
-  /**
-   * @param dataBlock the dataBlock to set
-   */
-  public void setDataBlock(DataRefNode dataBlock) {
-    this.dataBlock = dataBlock;
-  }
-
-  /***
-   * To reset the measure chunk and dimension chunk
-   * array
-   */
-  public void reset() {
-    for (int i = 0; i < measureDataChunk.length; i++) {
-      this.measureDataChunk[i] = null;
-    }
-    for (int i = 0; i < dimensionDataChunk.length; i++) {
-      this.dimensionDataChunk[i] = null;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/processor/impl/DataBlockIteratorImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/processor/impl/DataBlockIteratorImpl.java b/core/src/main/java/org/carbondata/query/carbon/processor/impl/DataBlockIteratorImpl.java
deleted file mode 100644
index ade1965..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/processor/impl/DataBlockIteratorImpl.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.carbondata.query.carbon.processor.impl;
-
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.query.carbon.executor.infos.BlockExecutionInfo;
-import org.carbondata.query.carbon.processor.AbstractDataBlockIterator;
-import org.carbondata.query.carbon.result.Result;
-
-/**
- * Below class will be used to process the block for detail query
- */
-public class DataBlockIteratorImpl extends AbstractDataBlockIterator {
-
-  /**
-   * DataBlockIteratorImpl Constructor
-   *
-   * @param blockExecutionInfo execution information
-   */
-  public DataBlockIteratorImpl(BlockExecutionInfo blockExecutionInfo,
-      FileHolder fileReader, int batchSize) {
-    super(blockExecutionInfo, fileReader, batchSize);
-  }
-
-  /**
-   * It scans the block and returns the result with @batchSize
-   *
-   * @return Result of @batchSize
-   */
-  public Result next() {
-    this.scannerResultAggregator.collectData(scannedResult, batchSize);
-    Result result = this.scannerResultAggregator.getCollectedResult();
-    while (result.size() < batchSize && hasNext()) {
-      this.scannerResultAggregator.collectData(scannedResult, batchSize-result.size());
-      result.merge(this.scannerResultAggregator.getCollectedResult());
-    }
-    return result;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/AbstractScannedResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/AbstractScannedResult.java b/core/src/main/java/org/carbondata/query/carbon/result/AbstractScannedResult.java
deleted file mode 100644
index 444b2bd..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/AbstractScannedResult.java
+++ /dev/null
@@ -1,347 +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.carbondata.query.carbon.result;
-
-import java.math.BigDecimal;
-import java.util.Map;
-
-import org.carbondata.core.carbon.datastore.chunk.DimensionColumnDataChunk;
-import org.carbondata.core.carbon.datastore.chunk.MeasureColumnDataChunk;
-import org.carbondata.query.carbon.executor.infos.BlockExecutionInfo;
-import org.carbondata.query.carbon.executor.infos.KeyStructureInfo;
-
-/**
- * Scanned result class which will store and provide the result on request
- */
-public abstract class AbstractScannedResult {
-
-  /**
-   * current row number
-   */
-  protected int currentRow = -1;
-  /**
-   * row mapping indexes
-   */
-  protected int[] rowMapping;
-  /**
-   * key size of the fixed length column
-   */
-  private int fixedLengthKeySize;
-  /**
-   * total number of rows
-   */
-  private int totalNumberOfRows;
-  /**
-   * to keep track of number of rows process
-   */
-  private int rowCounter;
-  /**
-   * dimension column data chunk
-   */
-  private DimensionColumnDataChunk[] dataChunks;
-  /**
-   * measure column data chunk
-   */
-  private MeasureColumnDataChunk[] measureDataChunks;
-  /**
-   * dictionary column block index in file
-   */
-  private int[] dictionaryColumnBlockIndexes;
-
-  /**
-   * no dictionary column block index in file
-   */
-  private int[] noDictionaryColumnBlockIndexes;
-
-  /**
-   * column group to is key structure info
-   * which will be used to get the key from the complete
-   * column group key
-   * For example if only one dimension of the column group is selected
-   * then from complete column group key it will be used to mask the key and
-   * get the particular column key
-   */
-  private Map<Integer, KeyStructureInfo> columnGroupKeyStructureInfo;
-
-  public AbstractScannedResult(BlockExecutionInfo blockExecutionInfo) {
-    this.fixedLengthKeySize = blockExecutionInfo.getFixedLengthKeySize();
-    this.noDictionaryColumnBlockIndexes = blockExecutionInfo.getNoDictionaryBlockIndexes();
-    this.dictionaryColumnBlockIndexes = blockExecutionInfo.getDictionaryColumnBlockIndex();
-    this.columnGroupKeyStructureInfo = blockExecutionInfo.getColumnGroupToKeyStructureInfo();
-  }
-
-  /**
-   * Below method will be used to set the dimension chunks
-   * which will be used to create a row
-   *
-   * @param dataChunks dimension chunks used in query
-   */
-  public void setDimensionChunks(DimensionColumnDataChunk[] dataChunks) {
-    this.dataChunks = dataChunks;
-  }
-
-  /**
-   * Below method will be used to set the measure column chunks
-   *
-   * @param measureDataChunks measure data chunks
-   */
-  public void setMeasureChunks(MeasureColumnDataChunk[] measureDataChunks) {
-    this.measureDataChunks = measureDataChunks;
-  }
-
-  /**
-   * Below method will be used to get the chunk based in measure ordinal
-   *
-   * @param ordinal measure ordinal
-   * @return measure column chunk
-   */
-  public MeasureColumnDataChunk getMeasureChunk(int ordinal) {
-    return measureDataChunks[ordinal];
-  }
-
-  /**
-   * Below method will be used to get the key for all the dictionary dimensions
-   * which is present in the query
-   *
-   * @param rowId row id selected after scanning
-   * @return return the dictionary key
-   */
-  protected byte[] getDictionaryKeyArray(int rowId) {
-    byte[] completeKey = new byte[fixedLengthKeySize];
-    int offset = 0;
-    for (int i = 0; i < this.dictionaryColumnBlockIndexes.length; i++) {
-      offset += dataChunks[dictionaryColumnBlockIndexes[i]]
-          .fillChunkData(completeKey, offset, rowId,
-              columnGroupKeyStructureInfo.get(dictionaryColumnBlockIndexes[i]));
-    }
-    rowCounter++;
-    return completeKey;
-  }
-
-  /**
-   * Just increment the counter incase of query only on measures.
-   */
-  public void incrementCounter() {
-    rowCounter ++;
-    currentRow ++;
-  }
-
-  /**
-   * Below method will be used to get the dimension data based on dimension
-   * ordinal and index
-   *
-   * @param dimOrdinal dimension ordinal present in the query
-   * @param rowId      row index
-   * @return dimension data based on row id
-   */
-  protected byte[] getDimensionData(int dimOrdinal, int rowId) {
-    return dataChunks[dimOrdinal].getChunkData(rowId);
-  }
-
-  /**
-   * Below method will be used to get the dimension key array
-   * for all the no dictionary dimension present in the query
-   *
-   * @param rowId row number
-   * @return no dictionary keys for all no dictionary dimension
-   */
-  protected byte[][] getNoDictionaryKeyArray(int rowId) {
-    byte[][] noDictionaryColumnsKeys = new byte[noDictionaryColumnBlockIndexes.length][];
-    int position = 0;
-    for (int i = 0; i < this.noDictionaryColumnBlockIndexes.length; i++) {
-      noDictionaryColumnsKeys[position++] =
-          dataChunks[noDictionaryColumnBlockIndexes[i]].getChunkData(rowId);
-    }
-    return noDictionaryColumnsKeys;
-  }
-
-  /**
-   * Below method will be used to get the complex type keys array based
-   * on row id for all the complex type dimension selected in query
-   *
-   * @param rowId row number
-   * @return complex type key array for all the complex dimension selected in query
-   */
-  protected byte[][] getComplexTypeKeyArray(int rowId) {
-    return new byte[0][];
-  }
-
-  /**
-   * @return return the total number of row after scanning
-   */
-  public int numberOfOutputRows() {
-    return this.totalNumberOfRows;
-  }
-
-  /**
-   * to check whether any more row is present in the result
-   *
-   * @return
-   */
-  public boolean hasNext() {
-    return rowCounter < this.totalNumberOfRows;
-  }
-
-  /**
-   * As this class will be a flyweight object so
-   * for one block all the blocklet scanning will use same result object
-   * in that case we need to reset the counter to zero so
-   * for new result it will give the result from zero
-   */
-  public void reset() {
-    rowCounter = 0;
-    currentRow = -1;
-  }
-
-  /**
-   * @param totalNumberOfRows set total of number rows valid after scanning
-   */
-  public void setNumberOfRows(int totalNumberOfRows) {
-    this.totalNumberOfRows = totalNumberOfRows;
-  }
-
-  /**
-   * After applying filter it will return the  bit set with the valid row indexes
-   * so below method will be used to set the row indexes
-   *
-   * @param indexes
-   */
-  public void setIndexes(int[] indexes) {
-    this.rowMapping = indexes;
-  }
-
-  /**
-   * Below method will be used to check whether measure value is null or not
-   *
-   * @param ordinal  measure ordinal
-   * @param rowIndex row number to be checked
-   * @return whether it is null or not
-   */
-  protected boolean isNullMeasureValue(int ordinal, int rowIndex) {
-    return measureDataChunks[ordinal].getNullValueIndexHolder().getBitSet().get(rowIndex);
-  }
-
-  /**
-   * Below method will be used to get the measure value of
-   * long type
-   *
-   * @param ordinal  measure ordinal
-   * @param rowIndex row number of the measure value
-   * @return measure value of long type
-   */
-  protected long getLongMeasureValue(int ordinal, int rowIndex) {
-    return measureDataChunks[ordinal].getMeasureDataHolder().getReadableLongValueByIndex(rowIndex);
-  }
-
-  /**
-   * Below method will be used to get the measure value of double type
-   *
-   * @param ordinal  measure ordinal
-   * @param rowIndex row number
-   * @return measure value of double type
-   */
-  protected double getDoubleMeasureValue(int ordinal, int rowIndex) {
-    return measureDataChunks[ordinal].getMeasureDataHolder()
-        .getReadableDoubleValueByIndex(rowIndex);
-  }
-
-  /**
-   * Below method will be used to get the measure type of big decimal data type
-   *
-   * @param ordinal  ordinal of the of the measure
-   * @param rowIndex row number
-   * @return measure of big decimal type
-   */
-  protected BigDecimal getBigDecimalMeasureValue(int ordinal, int rowIndex) {
-    return measureDataChunks[ordinal].getMeasureDataHolder()
-        .getReadableBigDecimalValueByIndex(rowIndex);
-  }
-
-  /**
-   * will return the current valid row id
-   *
-   * @return valid row id
-   */
-  public abstract int getCurrenrRowId();
-
-  /**
-   * @return dictionary key array for all the dictionary dimension
-   * selected in query
-   */
-  public abstract byte[] getDictionaryKeyArray();
-
-  /**
-   * Return the dimension data based on dimension ordinal
-   *
-   * @param dimensionOrdinal dimension ordinal
-   * @return dimension data
-   */
-  public abstract byte[] getDimensionKey(int dimensionOrdinal);
-
-  /**
-   * Below method will be used to get the complex type key array
-   *
-   * @return complex type key array
-   */
-  public abstract byte[][] getComplexTypeKeyArray();
-
-  /**
-   * Below method will be used to get the no dictionary key
-   * array for all the no dictionary dimension selected in query
-   *
-   * @return no dictionary key array for all the no dictionary dimension
-   */
-  public abstract byte[][] getNoDictionaryKeyArray();
-
-  /**
-   * Below method will be used to to check whether measure value
-   * is null or for a measure
-   *
-   * @param ordinal measure ordinal
-   * @return is null or not
-   */
-  public abstract boolean isNullMeasureValue(int ordinal);
-
-  /**
-   * Below method will be used to get the measure value for measure
-   * of long data type
-   *
-   * @param ordinal measure ordinal
-   * @return long value of measure
-   */
-  public abstract long getLongMeasureValue(int ordinal);
-
-  /**
-   * Below method will be used to get the value of measure of double
-   * type
-   *
-   * @param ordinal measure ordinal
-   * @return measure value
-   */
-  public abstract double getDoubleMeasureValue(int ordinal);
-
-  /**
-   * Below method will be used to get the data of big decimal type
-   * of a measure
-   *
-   * @param ordinal measure ordinal
-   * @return measure value
-   */
-  public abstract BigDecimal getBigDecimalMeasureValue(int ordinal);
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/BatchRawResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/BatchRawResult.java b/core/src/main/java/org/carbondata/query/carbon/result/BatchRawResult.java
deleted file mode 100644
index b00c021..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/BatchRawResult.java
+++ /dev/null
@@ -1,43 +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.carbondata.query.carbon.result;
-
-/**
- * Below class holds the query result of batches.
- */
-public class BatchRawResult extends BatchResult {
-
-  /**
-   * This method will return one row at a time based on the counter given.
-   * @param counter
-   * @return
-   */
-  public Object[] getRawRow(int counter) {
-    return rows[counter];
-  }
-
-  /**
-   * For getting the total size.
-   * @return
-   */
-  public int getSize() {
-    return rows.length;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/BatchResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/BatchResult.java b/core/src/main/java/org/carbondata/query/carbon/result/BatchResult.java
deleted file mode 100644
index 220336b..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/BatchResult.java
+++ /dev/null
@@ -1,86 +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.carbondata.query.carbon.result;
-
-import java.util.NoSuchElementException;
-
-import org.carbondata.core.iterator.CarbonIterator;
-
-/**
- * Below class holds the query result
- */
-public class BatchResult extends CarbonIterator<Object[]> {
-
-  /**
-   * list of keys
-   */
-  protected Object[][] rows;
-
-  /**
-   * counter to check whether all the records are processed or not
-   */
-  protected int counter;
-
-  public BatchResult() {
-    this.rows = new Object[0][];
-  }
-
-  /**
-   * Below method will be used to get the rows
-   *
-   * @return
-   */
-  public Object[][] getRows() {
-    return rows;
-  }
-
-  /**
-   * Below method will be used to get the set the values
-   *
-   * @param rows
-   */
-  public void setRows(Object[][] rows) {
-    this.rows = rows;
-  }
-
-
-  /**
-   * Returns {@code true} if the iteration has more elements.
-   *
-   * @return {@code true} if the iteration has more elements
-   */
-  @Override public boolean hasNext() {
-    return counter < rows.length;
-  }
-
-  /**
-   * Returns the next element in the iteration.
-   *
-   * @return the next element in the iteration
-   */
-  @Override public Object[] next() {
-    if (!hasNext()) {
-      throw new NoSuchElementException();
-    }
-    Object[] row = rows[counter];
-    counter++;
-    return row;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/ListBasedResultWrapper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/ListBasedResultWrapper.java b/core/src/main/java/org/carbondata/query/carbon/result/ListBasedResultWrapper.java
deleted file mode 100644
index 1a40fc3..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/ListBasedResultWrapper.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.carbondata.query.carbon.result;
-
-import org.carbondata.query.carbon.wrappers.ByteArrayWrapper;
-
-public class ListBasedResultWrapper {
-
-  private ByteArrayWrapper key;
-
-  private Object[] value;
-
-  /**
-   * @return the key
-   */
-  public ByteArrayWrapper getKey() {
-    return key;
-  }
-
-  /**
-   * @param key the key to set
-   */
-  public void setKey(ByteArrayWrapper key) {
-    this.key = key;
-  }
-
-  /**
-   * @return the value
-   */
-  public Object[] getValue() {
-    return value;
-  }
-
-  /**
-   * @param value the value to set
-   */
-  public void setValue(Object[] value) {
-    this.value = value;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/Result.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/Result.java b/core/src/main/java/org/carbondata/query/carbon/result/Result.java
deleted file mode 100644
index 8526b07..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/Result.java
+++ /dev/null
@@ -1,70 +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.carbondata.query.carbon.result;
-
-import org.carbondata.query.carbon.wrappers.ByteArrayWrapper;
-
-/**
- * Result interface for storing the result
- */
-public interface Result<K, V> {
-  /**
-   * Below method will be used to
-   * add the sccaed result
-   *
-   * @param result
-   */
-  void addScannedResult(K result);
-
-  /**
-   * Returns {@code true} if the iteration has more elements.
-   *
-   * @return {@code true} if the iteration has more elements
-   */
-  boolean hasNext();
-
-  /**
-   * Below method will return the result key
-   *
-   * @return key
-   */
-  ByteArrayWrapper getKey();
-
-  /**
-   * Below code will return the result value
-   *
-   * @return value
-   */
-  V[] getValue();
-
-  void merge(Result<K, V> otherResult);
-
-  /**
-   * Below method will be used to get the result
-   *
-   * @return
-   */
-  K getResult();
-
-  /**
-   * @return size of the result
-   */
-  int size();
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/comparator/FixedLengthKeyResultComparator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/comparator/FixedLengthKeyResultComparator.java b/core/src/main/java/org/carbondata/query/carbon/result/comparator/FixedLengthKeyResultComparator.java
deleted file mode 100644
index cfdcc27..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/comparator/FixedLengthKeyResultComparator.java
+++ /dev/null
@@ -1,71 +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.carbondata.query.carbon.result.comparator;
-
-import java.util.Comparator;
-
-import org.carbondata.query.carbon.result.ListBasedResultWrapper;
-
-/**
- * Fixed length key comparator
- */
-public class FixedLengthKeyResultComparator implements Comparator<ListBasedResultWrapper> {
-
-  /**
-   * compareRange
-   */
-  private int[] compareRange;
-
-  /**
-   * sortOrder
-   */
-  private byte sortOrder;
-
-  /**
-   * maskedKey
-   */
-  private byte[] maskedKey;
-
-  public FixedLengthKeyResultComparator(int[] compareRange, byte sortOrder, byte[] maskedKey) {
-    this.compareRange = compareRange;
-    this.sortOrder = sortOrder;
-    this.maskedKey = maskedKey;
-  }
-
-  @Override public int compare(ListBasedResultWrapper listBasedResultWrapper1,
-      ListBasedResultWrapper listBasedResultWrapper2) {
-    int cmp = 0;
-    byte[] o1 = listBasedResultWrapper1.getKey().getDictionaryKey();
-    byte[] o2 = listBasedResultWrapper2.getKey().getDictionaryKey();
-    for (int i = 0; i < compareRange.length; i++) {
-      int a = (o1[compareRange[i]] & this.maskedKey[i]) & 0xff;
-      int b = (o2[compareRange[i]] & this.maskedKey[i]) & 0xff;
-      cmp = a - b;
-      if (cmp != 0) {
-
-        if (sortOrder == 1) {
-          return cmp * -1;
-        }
-        return cmp;
-      }
-    }
-    return 0;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/comparator/VariableLengthKeyResultComparator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/comparator/VariableLengthKeyResultComparator.java b/core/src/main/java/org/carbondata/query/carbon/result/comparator/VariableLengthKeyResultComparator.java
deleted file mode 100644
index 262258d..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/comparator/VariableLengthKeyResultComparator.java
+++ /dev/null
@@ -1,80 +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.carbondata.query.carbon.result.comparator;
-
-import java.nio.charset.Charset;
-import java.util.Comparator;
-
-import org.carbondata.core.carbon.metadata.datatype.DataType;
-import org.carbondata.core.constants.CarbonCommonConstants;
-import org.carbondata.query.carbon.result.ListBasedResultWrapper;
-import org.carbondata.query.carbon.util.DataTypeUtil;
-
-/**
- * Variable length key comparator
- */
-public class VariableLengthKeyResultComparator implements Comparator<ListBasedResultWrapper> {
-
-  /**
-   * sort order
-   */
-  private byte sortOrder;
-
-  /**
-   * no dictionary column index
-   */
-  private int noDictionaryColumnIndex;
-
-  /**
-   * data type of the column
-   */
-  private DataType dataType;
-
-  public VariableLengthKeyResultComparator(byte sortOrder, int noDictionaryColumnIndex,
-      DataType dataType) {
-    this.sortOrder = sortOrder;
-    this.noDictionaryColumnIndex = noDictionaryColumnIndex;
-    this.dataType = dataType;
-  }
-
-  @Override public int compare(ListBasedResultWrapper listBasedResultWrapperFirst,
-      ListBasedResultWrapper listBasedResultWrapperSecond) {
-    // get the result
-    byte[] noDictionaryKeysFirst =
-        listBasedResultWrapperFirst.getKey().getNoDictionaryKeyByIndex(noDictionaryColumnIndex);
-    // convert the result based on actual data type
-    Object dataBasedOnDataTypeFirst =
-        DataTypeUtil.getDataBasedOnDataType(new String(noDictionaryKeysFirst, Charset
-            .forName(CarbonCommonConstants.DEFAULT_CHARSET)), dataType);
-    byte[] noDictionaryKeysSecond =
-        listBasedResultWrapperSecond.getKey().getNoDictionaryKeyByIndex(noDictionaryColumnIndex);
-    Object dataBasedOnDataTypeSecond = DataTypeUtil.getDataBasedOnDataType(
-        new String(noDictionaryKeysSecond, Charset.forName(CarbonCommonConstants.DEFAULT_CHARSET)),
-        dataType);
-    int cmp = 0;
-    // compare the result
-    cmp = DataTypeUtil
-        .compareBasedOnDatatYpe(dataBasedOnDataTypeFirst, dataBasedOnDataTypeSecond, dataType);
-    if (sortOrder == 1) {
-      cmp = cmp * -1;
-    }
-    return cmp;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/impl/FilterQueryScannedResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/impl/FilterQueryScannedResult.java b/core/src/main/java/org/carbondata/query/carbon/result/impl/FilterQueryScannedResult.java
deleted file mode 100644
index 51083a9..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/impl/FilterQueryScannedResult.java
+++ /dev/null
@@ -1,128 +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.carbondata.query.carbon.result.impl;
-
-import java.math.BigDecimal;
-
-import org.carbondata.query.carbon.executor.infos.BlockExecutionInfo;
-import org.carbondata.query.carbon.result.AbstractScannedResult;
-
-/**
- * Result provider class in case of filter query
- * In case of filter query data will be send
- * based on filtered row index
- */
-public class FilterQueryScannedResult extends AbstractScannedResult {
-
-  public FilterQueryScannedResult(BlockExecutionInfo tableBlockExecutionInfos) {
-    super(tableBlockExecutionInfos);
-  }
-
-  /**
-   * @return dictionary key array for all the dictionary dimension
-   * selected in query
-   */
-  @Override public byte[] getDictionaryKeyArray() {
-    ++currentRow;
-    return getDictionaryKeyArray(rowMapping[currentRow]);
-  }
-
-  /**
-   * Below method will be used to get the complex type key array
-   *
-   * @return complex type key array
-   */
-  @Override public byte[][] getComplexTypeKeyArray() {
-    return getComplexTypeKeyArray(rowMapping[currentRow]);
-  }
-
-  /**
-   * Below method will be used to get the no dictionary key
-   * array for all the no dictionary dimension selected in query
-   *
-   * @return no dictionary key array for all the no dictionary dimension
-   */
-  @Override public byte[][] getNoDictionaryKeyArray() {
-    return getNoDictionaryKeyArray(rowMapping[currentRow]);
-  }
-
-  /**
-   * will return the current valid row id
-   *
-   * @return valid row id
-   */
-  @Override public int getCurrenrRowId() {
-    return rowMapping[currentRow];
-  }
-
-  /**
-   * Return the dimension data based on dimension ordinal
-   *
-   * @param dimensionOrdinal dimension ordinal
-   * @return dimension data
-   */
-  @Override public byte[] getDimensionKey(int dimensionOrdinal) {
-    return getDimensionData(dimensionOrdinal, rowMapping[currentRow]);
-  }
-
-  /**
-   * Below method will be used to to check whether measure value
-   * is null or for a measure
-   *
-   * @param ordinal measure ordinal
-   * @return is null or not
-   */
-  @Override public boolean isNullMeasureValue(int ordinal) {
-    return isNullMeasureValue(ordinal, rowMapping[currentRow]);
-  }
-
-  /**
-   * Below method will be used to get the measure value for measure
-   * of long data type
-   *
-   * @param ordinal measure ordinal
-   * @return long value of measure
-   */
-  @Override public long getLongMeasureValue(int ordinal) {
-    return getLongMeasureValue(ordinal, rowMapping[currentRow]);
-  }
-
-  /**
-   * Below method will be used to get the value of measure of double
-   * type
-   *
-   * @param ordinal measure ordinal
-   * @return measure value
-   */
-  @Override public double getDoubleMeasureValue(int ordinal) {
-    return getDoubleMeasureValue(ordinal, rowMapping[currentRow]);
-  }
-
-  /**
-   * Below method will be used to get the data of big decimal type
-   * of a measure
-   *
-   * @param ordinal measure ordinal
-   * @return measure value
-   */
-  @Override public BigDecimal getBigDecimalMeasureValue(int ordinal) {
-    return getBigDecimalMeasureValue(ordinal, rowMapping[currentRow]);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/impl/ListBasedResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/impl/ListBasedResult.java b/core/src/main/java/org/carbondata/query/carbon/result/impl/ListBasedResult.java
deleted file mode 100644
index 3f31028..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/impl/ListBasedResult.java
+++ /dev/null
@@ -1,153 +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.carbondata.query.carbon.result.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.carbondata.core.constants.CarbonCommonConstants;
-import org.carbondata.query.carbon.result.ListBasedResultWrapper;
-import org.carbondata.query.carbon.result.Result;
-import org.carbondata.query.carbon.wrappers.ByteArrayWrapper;
-
-/**
- * Below class is a holder over list based result wrapper
- */
-public class ListBasedResult implements Result<List<ListBasedResultWrapper>, Object> {
-
-  /**
-   * current result list
-   */
-  private List<ListBasedResultWrapper> currentRowPointer;
-
-  /**
-   * all result list , this is required because if we merger all the scanned
-   * result from all the blocks in one list, that list creation will take more
-   * time as every time list will create a big array and then it will do copy
-   * the older element to new array, and creation of big array will also be a
-   * problem if memory is fragmented then jvm in to do defragmentation to
-   * create a big space, but if divide the data in multiple list than it avoid
-   * copy and defragmentation
-   */
-  private List<List<ListBasedResultWrapper>> allRowsResult;
-
-  /**
-   * counter to check how many result processed
-   */
-  private int totalRecordCounter = -1;
-
-  /**
-   * number of records
-   */
-  private int totalNumberOfRecords;
-
-  /**
-   * current counter of the record in list
-   */
-  private int listRecordCounter = -1;
-
-  /**
-   * current list counter
-   */
-  private int currentListCounter;
-
-  public ListBasedResult() {
-    currentRowPointer =
-        new ArrayList<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
-    allRowsResult =
-        new ArrayList<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
-  }
-
-  /**
-   * below method will be used to add the scan result
-   */
-  @Override public void addScannedResult(List<ListBasedResultWrapper> listBasedResult) {
-    this.currentRowPointer = listBasedResult;
-    totalNumberOfRecords = listBasedResult.size();
-    allRowsResult.add(listBasedResult);
-  }
-
-  /**
-   * Method to check more result is present
-   * or not
-   */
-  @Override public boolean hasNext() {
-    if (allRowsResult.size() == 0) {
-      return false;
-    }
-    // As we are storing data in list of list, below code is to check whether
-    // any more result is present
-    // in the result.
-    // first it will check list counter is zero if it is zero
-    // than it will check list counter to check how many list has been processed
-    // if more list are present and all the list of current list is processed
-    // than it will take a new list from all row result list
-    totalRecordCounter++;
-    listRecordCounter++;
-    if (listRecordCounter == 0 || (listRecordCounter >= currentRowPointer.size()
-        && currentListCounter < allRowsResult.size())) {
-      listRecordCounter = 0;
-      currentRowPointer = allRowsResult.get(currentListCounter);
-      currentListCounter++;
-    }
-    return totalRecordCounter < totalNumberOfRecords;
-  }
-
-  /**
-   * @return key
-   */
-  @Override public ByteArrayWrapper getKey() {
-    return currentRowPointer.get(listRecordCounter).getKey();
-  }
-
-  /**
-   * @return will return the value
-   */
-  @Override public Object[] getValue() {
-    return currentRowPointer.get(listRecordCounter).getValue();
-  }
-
-  /***
-   * below method will be used to merge the
-   * scanned result
-   *
-   * @param otherResult return to be merged
-   */
-  @Override public void merge(Result<List<ListBasedResultWrapper>, Object> otherResult) {
-    if (otherResult.size() > 0) {
-      totalNumberOfRecords += otherResult.size();
-      this.allRowsResult.add(otherResult.getResult());
-    }
-  }
-
-  /**
-   * Return the size of the result
-   */
-  @Override public int size() {
-    return totalNumberOfRecords;
-  }
-
-  /**
-   * @return the complete result
-   */
-  @Override public List<ListBasedResultWrapper> getResult() {
-    return currentRowPointer;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/impl/NonFilterQueryScannedResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/impl/NonFilterQueryScannedResult.java b/core/src/main/java/org/carbondata/query/carbon/result/impl/NonFilterQueryScannedResult.java
deleted file mode 100644
index 1268575..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/impl/NonFilterQueryScannedResult.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.carbondata.query.carbon.result.impl;
-
-import java.math.BigDecimal;
-
-import org.carbondata.query.carbon.executor.infos.BlockExecutionInfo;
-import org.carbondata.query.carbon.result.AbstractScannedResult;
-
-/**
- * Result provide class for non filter query
- * In case of no filter query we need to return
- * complete data
- */
-public class NonFilterQueryScannedResult extends AbstractScannedResult {
-
-  public NonFilterQueryScannedResult(BlockExecutionInfo blockExecutionInfo) {
-    super(blockExecutionInfo);
-  }
-
-  /**
-   * @return dictionary key array for all the dictionary dimension selected in
-   * query
-   */
-  @Override public byte[] getDictionaryKeyArray() {
-    ++currentRow;
-    return getDictionaryKeyArray(currentRow);
-  }
-
-  /**
-   * Below method will be used to get the complex type key array
-   *
-   * @return complex type key array
-   */
-  @Override public byte[][] getComplexTypeKeyArray() {
-    return getComplexTypeKeyArray(currentRow);
-  }
-
-  /**
-   * Below method will be used to get the no dictionary key array for all the
-   * no dictionary dimension selected in query
-   *
-   * @return no dictionary key array for all the no dictionary dimension
-   */
-  @Override public byte[][] getNoDictionaryKeyArray() {
-    return getNoDictionaryKeyArray(currentRow);
-  }
-
-  /**
-   * will return the current valid row id
-   *
-   * @return valid row id
-   */
-  @Override public int getCurrenrRowId() {
-    return currentRow;
-  }
-
-  /**
-   * Return the dimension data based on dimension ordinal
-   *
-   * @param dimensionOrdinal dimension ordinal
-   * @return dimension data
-   */
-  @Override public byte[] getDimensionKey(int dimensionOrdinal) {
-    return getDimensionData(dimensionOrdinal, currentRow);
-  }
-
-  /**
-   * Below method will be used to to check whether measure value is null or
-   * for a measure
-   *
-   * @param ordinal measure ordinal
-   * @return is null or not
-   */
-  @Override public boolean isNullMeasureValue(int ordinal) {
-    return isNullMeasureValue(ordinal, currentRow);
-  }
-
-  /**
-   * Below method will be used to get the measure value for measure of long
-   * data type
-   *
-   * @param ordinal measure ordinal
-   * @return long value of measure
-   */
-  @Override public long getLongMeasureValue(int ordinal) {
-    return getLongMeasureValue(ordinal, currentRow);
-  }
-
-  /**
-   * Below method will be used to get the value of measure of double type
-   *
-   * @param ordinal measure ordinal
-   * @return measure value
-   */
-  @Override public double getDoubleMeasureValue(int ordinal) {
-    return getDoubleMeasureValue(ordinal, currentRow);
-  }
-
-  /**
-   * Below method will be used to get the data of big decimal type of a
-   * measure
-   *
-   * @param ordinal measure ordinal
-   * @return measure value
-   */
-  @Override public BigDecimal getBigDecimalMeasureValue(int ordinal) {
-    return getBigDecimalMeasureValue(ordinal, currentRow);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/iterator/AbstractDetailQueryResultIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/iterator/AbstractDetailQueryResultIterator.java b/core/src/main/java/org/carbondata/query/carbon/result/iterator/AbstractDetailQueryResultIterator.java
deleted file mode 100644
index d2aa014..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/iterator/AbstractDetailQueryResultIterator.java
+++ /dev/null
@@ -1,134 +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.carbondata.query.carbon.result.iterator;
-
-import java.util.List;
-
-import org.carbondata.common.logging.LogService;
-import org.carbondata.common.logging.LogServiceFactory;
-import org.carbondata.core.carbon.datastore.DataRefNode;
-import org.carbondata.core.carbon.datastore.DataRefNodeFinder;
-import org.carbondata.core.carbon.datastore.impl.btree.BTreeDataRefNodeFinder;
-import org.carbondata.core.constants.CarbonCommonConstants;
-import org.carbondata.core.datastorage.store.FileHolder;
-import org.carbondata.core.datastorage.store.impl.FileFactory;
-import org.carbondata.core.iterator.CarbonIterator;
-import org.carbondata.core.util.CarbonProperties;
-import org.carbondata.query.carbon.executor.infos.BlockExecutionInfo;
-import org.carbondata.query.carbon.executor.internal.InternalQueryExecutor;
-import org.carbondata.query.carbon.model.QueryModel;
-import org.carbondata.query.carbon.processor.AbstractDataBlockIterator;
-import org.carbondata.query.carbon.processor.impl.DataBlockIteratorImpl;
-
-/**
- * In case of detail query we cannot keep all the records in memory so for
- * executing that query are returning a iterator over block and every time next
- * call will come it will execute the block and return the result
- */
-public abstract class AbstractDetailQueryResultIterator extends CarbonIterator {
-
-  /**
-   * LOGGER.
-   */
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(AbstractDetailQueryResultIterator.class.getName());
-
-  /**
-   * execution info of the block
-   */
-  protected List<BlockExecutionInfo> blockExecutionInfos;
-
-  /**
-   * executor which will execute the query
-   */
-  protected InternalQueryExecutor executor;
-
-  /**
-   * number of cores which can be used
-   */
-  private int batchSize;
-
-  /**
-   * file reader which will be used to execute the query
-   */
-  protected FileHolder fileReader;
-
-  protected AbstractDataBlockIterator dataBlockIterator;
-
-  protected boolean nextBatch = false;
-
-  public AbstractDetailQueryResultIterator(List<BlockExecutionInfo> infos, QueryModel queryModel) {
-    String batchSizeString =
-        CarbonProperties.getInstance().getProperty(CarbonCommonConstants.DETAIL_QUERY_BATCH_SIZE);
-    if (null != batchSizeString) {
-      try {
-        batchSize = Integer.parseInt(batchSizeString);
-      } catch (NumberFormatException ne) {
-        LOGGER.error("Invalid inmemory records size. Using default value");
-        batchSize = CarbonCommonConstants.DETAIL_QUERY_BATCH_SIZE_DEFAULT;
-      }
-    } else {
-      batchSize = CarbonCommonConstants.DETAIL_QUERY_BATCH_SIZE_DEFAULT;
-    }
-
-    this.blockExecutionInfos = infos;
-    this.fileReader = FileFactory.getFileHolder(
-        FileFactory.getFileType(queryModel.getAbsoluteTableIdentifier().getStorePath()));
-    intialiseInfos();
-  }
-
-  private void intialiseInfos() {
-    for (BlockExecutionInfo blockInfo : blockExecutionInfos) {
-      DataRefNodeFinder finder = new BTreeDataRefNodeFinder(blockInfo.getEachColumnValueSize());
-      DataRefNode startDataBlock = finder
-          .findFirstDataBlock(blockInfo.getDataBlock().getDataRefNode(), blockInfo.getStartKey());
-      DataRefNode endDataBlock = finder
-          .findLastDataBlock(blockInfo.getDataBlock().getDataRefNode(), blockInfo.getEndKey());
-      long numberOfBlockToScan = endDataBlock.nodeNumber() - startDataBlock.nodeNumber() + 1;
-      blockInfo.setFirstDataBlock(startDataBlock);
-      blockInfo.setNumberOfBlockToScan(numberOfBlockToScan);
-    }
-  }
-
-  @Override public boolean hasNext() {
-    if ((dataBlockIterator != null && dataBlockIterator.hasNext()) || nextBatch) {
-      return true;
-    } else {
-      dataBlockIterator = getDataBlockIterator();
-      while (dataBlockIterator != null) {
-        if (dataBlockIterator.hasNext()) {
-          return true;
-        }
-        dataBlockIterator = getDataBlockIterator();
-      }
-      return false;
-    }
-  }
-
-  private DataBlockIteratorImpl getDataBlockIterator() {
-    if(blockExecutionInfos.size() > 0) {
-      BlockExecutionInfo executionInfo = blockExecutionInfos.get(0);
-      blockExecutionInfos.remove(executionInfo);
-      return new DataBlockIteratorImpl(executionInfo, fileReader, batchSize);
-    }
-    return null;
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/iterator/ChunkBasedDetailResultIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/iterator/ChunkBasedDetailResultIterator.java b/core/src/main/java/org/carbondata/query/carbon/result/iterator/ChunkBasedDetailResultIterator.java
deleted file mode 100644
index 826f816..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/iterator/ChunkBasedDetailResultIterator.java
+++ /dev/null
@@ -1,75 +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.carbondata.query.carbon.result.iterator;
-
-import java.util.List;
-
-import org.carbondata.core.iterator.CarbonIterator;
-import org.carbondata.query.carbon.executor.impl.QueryExecutorProperties;
-import org.carbondata.query.carbon.model.QueryModel;
-import org.carbondata.query.carbon.result.BatchResult;
-import org.carbondata.query.carbon.result.ListBasedResultWrapper;
-import org.carbondata.query.carbon.result.Result;
-import org.carbondata.query.carbon.result.preparator.QueryResultPreparator;
-import org.carbondata.query.carbon.result.preparator.impl.DetailQueryResultPreparatorImpl;
-
-/**
- * Iterator over chunk result
- */
-public class ChunkBasedDetailResultIterator extends CarbonIterator<BatchResult> {
-
-  /**
-   * query result prepartor which will be used to create a query result
-   */
-  private QueryResultPreparator<List<ListBasedResultWrapper>, Object> queryResultPreparator;
-
-  /**
-   * iterator over result
-   */
-  private CarbonIterator<Result> queryResultIterator;
-
-  public ChunkBasedDetailResultIterator(CarbonIterator<Result> queryResultIterator,
-      QueryExecutorProperties executerProperties, QueryModel queryModel) {
-    this.queryResultIterator = queryResultIterator;
-    this.queryResultPreparator =
-        new DetailQueryResultPreparatorImpl(executerProperties, queryModel);
-
-  }
-
-  /**
-   * Returns {@code true} if the iteration has more elements. (In other words,
-   * returns {@code true}
-   *
-   * @return {@code true} if the iteration has more elements
-   */
-  @Override public boolean hasNext() {
-    return queryResultIterator.hasNext();
-  }
-
-  /**
-   * Returns the next element in the iteration.
-   *
-   * @return the next element in the iteration
-   */
-  @Override public BatchResult next() {
-    return queryResultPreparator.prepareQueryResult(queryResultIterator.next());
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/1c725f5b/core/src/main/java/org/carbondata/query/carbon/result/iterator/ChunkRowIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/iterator/ChunkRowIterator.java b/core/src/main/java/org/carbondata/query/carbon/result/iterator/ChunkRowIterator.java
deleted file mode 100644
index 3db3404..0000000
--- a/core/src/main/java/org/carbondata/query/carbon/result/iterator/ChunkRowIterator.java
+++ /dev/null
@@ -1,79 +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.carbondata.query.carbon.result.iterator;
-
-import org.carbondata.core.iterator.CarbonIterator;
-import org.carbondata.query.carbon.result.BatchResult;
-
-/**
- * Iterator over row result
- */
-public class ChunkRowIterator extends CarbonIterator<Object[]> {
-
-  /**
-   * iterator over chunk result
-   */
-  private CarbonIterator<BatchResult> iterator;
-
-  /**
-   * currect chunk
-   */
-  private BatchResult currentchunk;
-
-  public ChunkRowIterator(CarbonIterator<BatchResult> iterator) {
-    this.iterator = iterator;
-    if (iterator.hasNext()) {
-      currentchunk = iterator.next();
-    }
-  }
-
-  /**
-   * Returns {@code true} if the iteration has more elements. (In other words,
-   * returns {@code true} if {@link #next} would return an element rather than
-   * throwing an exception.)
-   *
-   * @return {@code true} if the iteration has more elements
-   */
-  @Override public boolean hasNext() {
-    if (null != currentchunk) {
-      if ((currentchunk.hasNext())) {
-        return true;
-      } else if (!currentchunk.hasNext()) {
-        while (iterator.hasNext()) {
-          currentchunk = iterator.next();
-          if (currentchunk != null && currentchunk.hasNext()) {
-            return true;
-          }
-        }
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Returns the next element in the iteration.
-   *
-   * @return the next element in the iteration
-   */
-  @Override public Object[] next() {
-    return currentchunk.next();
-  }
-
-}


Mime
View raw message