use of org.apache.drill.exec.store.iceberg.snapshot.Snapshot in project drill by apache.
the class IcebergGroupScan method initTableScan.
public static TableScan initTableScan(IcebergFormatPlugin formatPlugin, String path, LogicalExpression condition) {
TableScan tableScan = new HadoopTables(formatPlugin.getFsConf()).load(path).newScan();
Map<String, String> properties = formatPlugin.getConfig().getProperties();
if (properties != null) {
for (Map.Entry<String, String> entry : properties.entrySet()) {
tableScan = tableScan.option(entry.getKey(), entry.getValue());
}
}
if (condition != null) {
Expression expression = condition.accept(DrillExprToIcebergTranslator.INSTANCE, null);
tableScan = tableScan.filter(expression);
}
Snapshot snapshot = formatPlugin.getConfig().getSnapshot();
if (snapshot != null) {
tableScan = snapshot.apply(tableScan);
}
Boolean caseSensitive = formatPlugin.getConfig().getCaseSensitive();
if (caseSensitive != null) {
tableScan = tableScan.caseSensitive(caseSensitive);
}
Boolean includeColumnStats = formatPlugin.getConfig().getIncludeColumnStats();
if (includeColumnStats != null && includeColumnStats) {
tableScan = tableScan.includeColumnStats();
}
Boolean ignoreResiduals = formatPlugin.getConfig().getIgnoreResiduals();
if (ignoreResiduals != null && ignoreResiduals) {
tableScan = tableScan.ignoreResiduals();
}
return tableScan;
}
Aggregations