Package org.apache.iceberg
Interface TableScan
- All Superinterfaces:
Scan<TableScan,
FileScanTask, CombinedScanTask>
- All Known Implementing Classes:
AllDataFilesTable.AllDataFilesTableScan
,AllDeleteFilesTable.AllDeleteFilesTableScan
,AllFilesTable.AllFilesTableScan
,AllManifestsTable.AllManifestsTableScan
,DataFilesTable.DataFilesTableScan
,DataTableScan
,DeleteFilesTable.DeleteFilesTableScan
,FilesTable.FilesTableScan
API for configuring a table scan.
-
Method Summary
Modifier and TypeMethodDescriptiondefault TableScan
appendsAfter
(long fromSnapshotId) Deprecated.default TableScan
appendsBetween
(long fromSnapshotId, long toSnapshotId) Deprecated.since 1.0.0, will be removed in 2.0.0; useTable.newIncrementalAppendScan()
instead.asOfTime
(long timestampMillis) Create a newTableScan
from this scan's configuration that will use the most recent snapshot as of the given time in milliseconds on the branch in the scan or main if no branch is set.snapshot()
Returns theSnapshot
that will be used by this scan.table()
Returns theTable
from which this scan loads data.default TableScan
Create a newTableScan
from this scan's configuration that will use the given reference.useSnapshot
(long snapshotId) Create a newTableScan
from this scan's configuration that will use the given snapshot by ID.Methods inherited from interface org.apache.iceberg.Scan
caseSensitive, filter, filter, ignoreResiduals, includeColumnStats, includeColumnStats, isCaseSensitive, metricsReporter, option, planFiles, planTasks, planWith, project, schema, select, select, splitLookback, splitOpenFileCost, targetSplitSize
-
Method Details
-
table
Table table()Returns theTable
from which this scan loads data.- Returns:
- this scan's table
-
useSnapshot
Create a newTableScan
from this scan's configuration that will use the given snapshot by ID.- Parameters:
snapshotId
- a snapshot ID- Returns:
- a new scan based on this with the given snapshot ID
- Throws:
IllegalArgumentException
- if the snapshot cannot be found
-
useRef
Create a newTableScan
from this scan's configuration that will use the given reference.- Parameters:
ref
- reference- Returns:
- a new scan based on the given reference.
- Throws:
IllegalArgumentException
- if a reference with the given name could not be found
-
asOfTime
Create a newTableScan
from this scan's configuration that will use the most recent snapshot as of the given time in milliseconds on the branch in the scan or main if no branch is set.- Parameters:
timestampMillis
- a timestamp in milliseconds.- Returns:
- a new scan based on this with the current snapshot at the given time
- Throws:
IllegalArgumentException
- if the snapshot cannot be found or time travel is attempted on a tag
-
appendsBetween
Deprecated.since 1.0.0, will be removed in 2.0.0; useTable.newIncrementalAppendScan()
instead.Create a newTableScan
to read appended data fromfromSnapshotId
exclusive totoSnapshotId
inclusive.- Parameters:
fromSnapshotId
- the last snapshot id read by the user, exclusivetoSnapshotId
- read append data up to this snapshot id- Returns:
- a table scan which can read append data from
fromSnapshotId
exclusive and up totoSnapshotId
inclusive
-
appendsAfter
Deprecated.since 1.0.0, will be removed in 2.0.0; useTable.newIncrementalAppendScan()
instead.Create a newTableScan
to read appended data fromfromSnapshotId
exclusive to the current snapshot inclusive.- Parameters:
fromSnapshotId
- - the last snapshot id read by the user, exclusive- Returns:
- a table scan which can read append data from
fromSnapshotId
exclusive and up to current snapshot inclusive
-
snapshot
Snapshot snapshot()Returns theSnapshot
that will be used by this scan.If the snapshot was not configured using
asOfTime(long)
oruseSnapshot(long)
, the current table snapshot will be used.- Returns:
- the Snapshot this scan will use
-
Table.newIncrementalAppendScan()
instead.