Package io.delta.kernel
Interface Scan
- All Known Implementing Classes:
ScanImpl
Represents a scan of a Delta table.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionGet the remaining filter that is not guaranteed to be satisfied for the data Delta Kernel returns.getScanFiles(Engine engine) Get an iterator of data files to scan.getScanState(Engine engine) Get the scan state associated with the current scan.transformPhysicalData(Engine engine, Row scanState, Row scanFile, CloseableIterator<ColumnarBatch> physicalDataIter) Transform the physical data read from the table data file into the logical data that expected out of the Delta table.
-
Method Details
-
getScanFiles
Get an iterator of data files to scan.- Parameters:
engine-Engineinstance to use in Delta Kernel.- Returns:
- iterator of
FilteredColumnarBatchs where each selected row in the batch corresponds to one scan file. Schema of each row is defined as follows:- name:
add, type:struct - Description: Represents `AddFile` DeltaLog action
- name:
path, type:string, description: location of the file. - name:
partitionValues, type:map(string, string), description: A map from partition column to value for this logical file. - name:
size, type:long, description: size of the file. - name:
modificationTime, type:log, description: the time this logical file was created, as milliseconds since the epoch. - name:
dataChange, type:boolean, description: When false the logical file must already be present in the table or the records in the added file must be contained in one or more remove actions in the same version - name:
deletionVector, type:string, description: Either null (or absent in JSON) when no DV is associated with this data file, or a struct (described below) that contains necessary information about the DV that is part of this logical file. For description of each member variable in `deletionVector` @see Protocol- name:
storageType, type:string - name:
pathOrInlineDv, type:string - name:
offset, type:log - name:
sizeInBytes, type:log - name:
cardinality, type:log
- name:
- name:
tags, type:map(string, string), description: Map containing metadata about the scan file.
- name:
- name:
-
getRemainingFilter
Get the remaining filter that is not guaranteed to be satisfied for the data Delta Kernel returns. This filter is used by Delta Kernel to do data skipping when possible.- Returns:
- the remaining filter as a
Predicate.
-
getScanState
Get the scan state associated with the current scan. This state is common across all files in the scan to be read. -
transformPhysicalData
static CloseableIterator<FilteredColumnarBatch> transformPhysicalData(Engine engine, Row scanState, Row scanFile, CloseableIterator<ColumnarBatch> physicalDataIter) throws IOException Transform the physical data read from the table data file into the logical data that expected out of the Delta table.- Parameters:
engine- Connector providedEngineimplementation.scanState- Scan state returned bygetScanState(Engine)scanFile- Scan file from where the physical dataphysicalDataIteris read from.physicalDataIter- Iterator ofColumnarBatchs containing the physical data read from thescanFile.- Returns:
- Data read from the input scan files as an iterator of
FilteredColumnarBatchs. EachFilteredColumnarBatchinstance contains the data read and an optional selection vector that indicates data rows as valid or invalid. It is the responsibility of the caller to close this iterator. - Throws:
IOException- when error occurs while reading the data.
-