Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2148#discussion_r181587662
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/scan/model/QueryModelBuilder.java 
---
    @@ -23,51 +23,101 @@
     import 
org.apache.carbondata.core.metadata.schema.table.column.CarbonDimension;
     import 
org.apache.carbondata.core.metadata.schema.table.column.CarbonMeasure;
     import org.apache.carbondata.core.scan.expression.Expression;
    +import org.apache.carbondata.core.scan.filter.SingleTableProvider;
     import org.apache.carbondata.core.scan.filter.resolver.FilterResolverIntf;
    +import org.apache.carbondata.core.util.DataTypeConverter;
     
     public class QueryModelBuilder {
     
    -  private CarbonTable carbonTable;
    +  private CarbonTable table;
    +  private QueryProjection projection;
    +  private Expression filterExpression;
    +  private DataTypeConverter dataTypeConverter;
    +  private boolean forcedDetailRawQuery;
    +  private boolean readPageByPage;
     
    -  public QueryModelBuilder(CarbonTable carbonTable) {
    -    this.carbonTable = carbonTable;
    +  public QueryModelBuilder(CarbonTable table) {
    +    this.table = table;
       }
     
    -  public QueryModel build(String[] projectionColumnNames, Expression 
filterExpression) {
    -    QueryModel queryModel = QueryModel.newInstance(carbonTable);
    -    QueryProjection projection = 
carbonTable.createProjection(projectionColumnNames);
    -    queryModel.setProjection(projection);
    -    boolean[] isFilterDimensions = new 
boolean[carbonTable.getDimensionOrdinalMax()];
    -    boolean[] isFilterMeasures = new 
boolean[carbonTable.getAllMeasures().size()];
    -    carbonTable.processFilterExpression(filterExpression, 
isFilterDimensions, isFilterMeasures);
    -    queryModel.setIsFilterDimensions(isFilterDimensions);
    -    queryModel.setIsFilterMeasures(isFilterMeasures);
    -    FilterResolverIntf filterIntf = 
carbonTable.resolveFilter(filterExpression, null);
    -    queryModel.setFilterExpressionResolverTree(filterIntf);
    -    return queryModel;
    +  public QueryModelBuilder projectColumns(String[] projectionColumns) {
    +    String factTableName = table.getTableName();
    +    QueryProjection projection = new QueryProjection();
    +    // fill dimensions
    +    // If columns are null, set all dimensions and measures
    --- End diff --
    
    fixed


---

Reply via email to