use of org.apache.drill.exec.store.mongo.MongoFilterBuilder in project drill by apache.
the class MongoPluginImplementor method implement.
@Override
public void implement(PluginFilterRel filter) throws IOException {
visitChild(filter.getInput());
LogicalExpression conditionExp = DrillOptiq.toDrill(new DrillParseContext(PrelUtil.getPlannerSettings(filter.getCluster().getPlanner())), filter.getInput(), filter.getCondition());
MongoFilterBuilder mongoFilterBuilder = new MongoFilterBuilder(conditionExp);
if (runAggregate) {
Bson convertedFilterExpression = Aggregates.match(mongoFilterBuilder.parseTree()).toBsonDocument();
operations.add(convertedFilterExpression);
} else {
filters = mongoFilterBuilder.parseTree();
}
}
use of org.apache.drill.exec.store.mongo.MongoFilterBuilder in project drill by apache.
the class MongoPluginImplementor method canImplement.
@Override
public boolean canImplement(Filter filter) {
if (hasPluginGroupScan(filter)) {
LogicalExpression conditionExp = DrillOptiq.toDrill(new DrillParseContext(PrelUtil.getPlannerSettings(filter.getCluster().getPlanner())), filter.getInput(), filter.getCondition());
MongoFilterBuilder filterBuilder = new MongoFilterBuilder(conditionExp);
filterBuilder.parseTree();
return filterBuilder.isAllExpressionsConverted();
}
return false;
}
Aggregations