use of org.apache.carbondata.core.scan.filter.SingleTableProvider in project carbondata by apache.
the class MapredCarbonInputFormat method getQueryModel.
private QueryModel getQueryModel(Configuration configuration, String path) throws IOException, InvalidConfigurationException {
CarbonTable carbonTable = getCarbonTable(configuration, path);
TableProvider tableProvider = new SingleTableProvider(carbonTable);
// getting the table absoluteTableIdentifier from the carbonTable
// to avoid unnecessary deserialization
AbsoluteTableIdentifier identifier = carbonTable.getAbsoluteTableIdentifier();
String projectionString = getProjection(configuration, carbonTable, identifier.getCarbonTableIdentifier().getTableName());
String[] projectionColumns = projectionString.split(",");
QueryModel queryModel = carbonTable.createQueryWithProjection(projectionColumns, new DataTypeConverterImpl());
// set the filter to the query model in order to filter blocklet before scan
Expression filter = getFilterPredicates(configuration);
carbonTable.processFilterExpression(filter, null, null);
FilterResolverIntf filterIntf = carbonTable.resolveFilter(filter, tableProvider);
queryModel.setFilterExpressionResolverTree(filterIntf);
return queryModel;
}
Aggregations