Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,24 @@
import org.apache.iceberg.TableOperations;
import org.apache.iceberg.TableScan;
import org.apache.iceberg.TableScanContext;
import org.apache.iceberg.events.Listeners;
import org.apache.iceberg.events.ScanEvent;
import org.apache.iceberg.expressions.Expression;
import org.apache.iceberg.expressions.ResidualEvaluator;
import org.apache.iceberg.io.CloseableIterable;
import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
import org.apache.iceberg.util.ParallelIterable;
import org.apache.iceberg.util.ThreadPools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
* A {@link DataTableScan} which uses Hive table and partition metadata to read tables.
* This scan does not provide any time travel, snapshot isolation, incremental computation benefits.
*/
public class LegacyHiveTableScan extends DataTableScan {
private static final Logger LOG = LoggerFactory.getLogger(LegacyHiveTableScan.class);

protected LegacyHiveTableScan(TableOperations ops, Table table) {
super(ops, table);
Expand All @@ -62,6 +67,11 @@ protected TableScan newRefinedScan(TableOperations ops, Table table, Schema sche

@Override
public CloseableIterable<FileScanTask> planFiles() {
LOG.info("Scanning table {} with filter {}", table().toString(), filter());

Listeners.notifyAll(
new ScanEvent(table().toString(), -1, filter(), schema()));

LegacyHiveTableOperations hiveOps = (LegacyHiveTableOperations) tableOps();
PartitionSpec spec = hiveOps.current().spec();
String schemaString = SchemaParser.toJson(spec.schema());
Expand Down