Interface PaginatedScan
- All Superinterfaces:
Scan
- All Known Implementing Classes:
PaginatedScanImpl
Scan that supports pagination.
This interface allows consumers to retrieve scan results in discrete, ordered pages rather than all at once. This is particularly useful for large datasets where materializing the full result set would be expensive in terms of memory or compute resources.
Pagination is achieved via a combination of pageSize and pageToken. The
pageSize controls how many Scan files are returned in each page, while the pageToken
encodes the location of next batch to read and is used to resume the scan from exactly where the
last page ended. For the first page, the pageToken should be Optional.empty().
Consumers typically use PaginatedScan in a loop: they call getScanFiles() to
retrieve an iterator over the current page's scan files. After consuming the iterator, users
should call PaginatedScanFilesIterator.getCurrentPageToken() to retrieve a token to pass
into the next page request. This allows users to scan the dataset incrementally, resuming from
where they left off.
-
Method Summary
Modifier and TypeMethodDescriptiongetScanFiles(Engine engine) Get a paginated iterator of Scan files for the current page.Methods inherited from interface io.delta.kernel.Scan
getRemainingFilter, getScanState
-
Method Details
-
getScanFiles
Get a paginated iterator of Scan files for the current page.- Specified by:
getScanFilesin interfaceScan- Parameters:
engine-Engineinstance to use in Delta Kernel.- Returns:
- iterator of
FilteredColumnarBatchs for the current page. - See Also:
-