use of com.facebook.presto.spi.TableLayoutFilterCoverage in project presto by prestodb.
the class WarnOnScanWithoutPartitionPredicate method validate.
@Override
public void validate(PlanNode plan, Session session, Metadata metadata, SqlParser sqlParser, TypeProvider types, WarningCollector warningCollector) {
for (TableScanNode scan : searchFrom(plan).where(TableScanNode.class::isInstance).<TableScanNode>findAll()) {
TableHandle tableHandle = scan.getTable();
TableLayoutFilterCoverage partitioningFilterCoverage = metadata.getTableLayoutFilterCoverage(session, tableHandle, warnOnNoTableLayoutFilter);
if (partitioningFilterCoverage == NOT_COVERED) {
String warningMessage = String.format("No partition filter for scan of table %s", scan.getTable().getConnectorHandle());
warningCollector.add(new PrestoWarning(PERFORMANCE_WARNING, warningMessage));
}
}
}
Aggregations