use of org.apache.drill.exec.store.iceberg.IcebergGroupScan in project drill by apache.
the class IcebergPluginImplementor method canImplement.
@Override
public boolean canImplement(Filter filter) {
RexNode condition = filter.getCondition();
LogicalExpression logicalExpression = DrillOptiq.toDrill(new DrillParseContext(PrelUtil.getPlannerSettings(filter.getCluster().getPlanner())), filter.getInput(), condition);
Expression expression = logicalExpression.accept(DrillExprToIcebergTranslator.INSTANCE, null);
if (expression != null) {
try {
GroupScan scan = findGroupScan(filter);
if (scan instanceof IcebergGroupScan) {
IcebergGroupScan groupScan = (IcebergGroupScan) scan;
// ensures that expression compatible with table schema
expression = Binder.bind(groupScan.getTableScan().schema().asStruct(), expression, true);
} else {
return false;
}
} catch (ValidationException e) {
return false;
}
}
return expression != null;
}
Aggregations