ThisT
- actual BaseScan implementation class typeT
- type of ScanTask returnedG
- type of ScanTaskGroup returnedpublic abstract class SnapshotScan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.util.List<java.lang.String> |
DELETE_SCAN_COLUMNS |
protected static java.util.List<java.lang.String> |
DELETE_SCAN_WITH_STATS_COLUMNS |
protected static java.util.List<java.lang.String> |
SCAN_COLUMNS |
Modifier | Constructor and Description |
---|---|
protected |
SnapshotScan(Table table,
Schema schema,
org.apache.iceberg.TableScanContext context) |
Modifier and Type | Method and Description |
---|---|
ThisT |
asOfTime(long timestampMillis) |
ThisT |
caseSensitive(boolean caseSensitive)
Create a new scan from this that, if data columns where selected via
Scan.select(java.util.Collection) , controls whether the match to the schema will be done with case
sensitivity. |
protected org.apache.iceberg.TableScanContext |
context() |
protected abstract CloseableIterable<T> |
doPlanFiles() |
Expression |
filter()
Returns this scan's filter
Expression . |
ThisT |
filter(Expression expr)
Create a new scan from the results of this filtered by the
Expression . |
ThisT |
ignoreResiduals()
Create a new scan from this that applies data filtering to files but not to rows in those
files.
|
ThisT |
includeColumnStats()
Create a new scan from this that loads the column stats with each data file.
|
boolean |
isCaseSensitive()
Returns whether this scan is case-sensitive with respect to column names.
|
ThisT |
metricsReporter(MetricsReporter reporter)
Create a new scan that will report scan metrics to the provided reporter in addition to
reporters maintained by the scan.
|
protected abstract ThisT |
newRefinedScan(Table newTable,
Schema newSchema,
org.apache.iceberg.TableScanContext newContext) |
ThisT |
option(java.lang.String property,
java.lang.String value)
Create a new scan from this scan's configuration that will override the
Table 's
behavior based on the incoming pair. |
protected java.util.Map<java.lang.String,java.lang.String> |
options() |
protected java.util.concurrent.ExecutorService |
planExecutor() |
CloseableIterable<T> |
planFiles()
Plan tasks for this scan where each task reads a single file.
|
ThisT |
planWith(java.util.concurrent.ExecutorService executorService)
Create a new scan to use a particular executor to plan.
|
ThisT |
project(Schema projectedSchema)
Create a new scan from this with the schema as its projection.
|
protected java.util.List<java.lang.String> |
scanColumns() |
protected ScanMetrics |
scanMetrics() |
Schema |
schema()
Returns this scan's projection
Schema . |
ThisT |
select(java.util.Collection<java.lang.String> columns)
Create a new scan from this that will read the given data columns.
|
protected boolean |
shouldIgnoreResiduals() |
protected boolean |
shouldPlanWithExecutor() |
Snapshot |
snapshot() |
protected java.lang.Long |
snapshotId() |
int |
splitLookback()
Returns the split lookback for this scan.
|
long |
splitOpenFileCost()
Returns the split open file cost for this scan.
|
Table |
table() |
protected Schema |
tableSchema() |
long |
targetSplitSize()
Returns the target split size for this scan.
|
java.lang.String |
toString() |
ThisT |
useRef(java.lang.String name) |
ThisT |
useSnapshot(long scanSnapshotId) |
protected static final java.util.List<java.lang.String> SCAN_COLUMNS
protected static final java.util.List<java.lang.String> DELETE_SCAN_COLUMNS
protected static final java.util.List<java.lang.String> DELETE_SCAN_WITH_STATS_COLUMNS
protected java.lang.Long snapshotId()
protected abstract CloseableIterable<T> doPlanFiles()
protected ScanMetrics scanMetrics()
public ThisT useSnapshot(long scanSnapshotId)
public ThisT useRef(java.lang.String name)
public ThisT asOfTime(long timestampMillis)
public CloseableIterable<T> planFiles()
Scan
Use Scan.planTasks()
for planning balanced tasks where each task will read either a
single file, a part of a file, or multiple files.
public Snapshot snapshot()
public java.lang.String toString()
toString
in class java.lang.Object
public Table table()
protected Schema tableSchema()
protected org.apache.iceberg.TableScanContext context()
protected java.util.Map<java.lang.String,java.lang.String> options()
protected java.util.List<java.lang.String> scanColumns()
protected boolean shouldIgnoreResiduals()
protected boolean shouldPlanWithExecutor()
protected java.util.concurrent.ExecutorService planExecutor()
protected abstract ThisT newRefinedScan(Table newTable, Schema newSchema, org.apache.iceberg.TableScanContext newContext)
public ThisT option(java.lang.String property, java.lang.String value)
Scan
Table
's
behavior based on the incoming pair. Unknown properties will be ignored.option
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
property
- name of the table property to be overriddenvalue
- value to override withpublic ThisT project(Schema projectedSchema)
Scan
project
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
projectedSchema
- a projection schemapublic ThisT caseSensitive(boolean caseSensitive)
Scan
Scan.select(java.util.Collection)
, controls whether the match to the schema will be done with case
sensitivity. Default is true.caseSensitive
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
public boolean isCaseSensitive()
Scan
isCaseSensitive
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
public ThisT includeColumnStats()
Scan
Column stats include: value count, null value count, lower bounds, and upper bounds.
includeColumnStats
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
public ThisT select(java.util.Collection<java.lang.String> columns)
Scan
select
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
columns
- column names from the table's schemapublic ThisT filter(Expression expr)
Scan
Expression
.filter
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
expr
- a filter expressionpublic Expression filter()
Scan
Expression
.filter
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
public ThisT ignoreResiduals()
Scan
ignoreResiduals
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
public ThisT planWith(java.util.concurrent.ExecutorService executorService)
Scan
planWith
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
executorService
- the provided executorpublic Schema schema()
Scan
Schema
.
If the projection schema was set directly using Scan.project(Schema)
, returns that
schema.
If the projection schema was set by calling Scan.select(Collection)
, returns a
projection schema that includes the selected data fields and any fields used in the filter
expression.
schema
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
public long targetSplitSize()
Scan
targetSplitSize
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
public int splitLookback()
Scan
splitLookback
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
public long splitOpenFileCost()
Scan
splitOpenFileCost
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>
public ThisT metricsReporter(MetricsReporter reporter)
Scan
metricsReporter
in interface Scan<ThisT,T extends ScanTask,G extends ScanTaskGroup<T>>