Search in sources :

Example 1 with FilterTransformer

use of org.apache.drill.metastore.mongo.transform.FilterTransformer in project drill by apache.

the class MongoRead method internalExecute.

@Override
protected List<T> internalExecute() {
    FilterTransformer filterTransformer = context.transformer().filter();
    Bson rowFilter = filterTransformer.combine(filterTransformer.transform(metadataTypes), filterTransformer.transform(filter));
    List<Document> documents = Lists.newLinkedList();
    context.table().find(rowFilter).forEach(documents::add);
    return context.transformer().outputData().columns(columns.stream().map(MetastoreColumn::columnName).collect(Collectors.toList())).documents(documents).execute();
}
Also used : Document(org.bson.Document) FilterTransformer(org.apache.drill.metastore.mongo.transform.FilterTransformer) MetastoreColumn(org.apache.drill.metastore.MetastoreColumn) Bson(org.bson.conversions.Bson)

Aggregations

MetastoreColumn (org.apache.drill.metastore.MetastoreColumn)1 FilterTransformer (org.apache.drill.metastore.mongo.transform.FilterTransformer)1 Document (org.bson.Document)1 Bson (org.bson.conversions.Bson)1