Bases: _Weakrefable
Fragment of data from a Dataset.
Methods
Attributes
Count rows matching the scanner filter.
Expression
, default None
Scan will return only the rows matching the filter. If possible the predicate will be pushed down to exploit the partition information or internal metadata found in the data source, e.g. Parquet statistics. Otherwise filters the loaded RecordBatches before yielding them.
int
, default 131_072
The maximum row count for scanned record batches. If scanned record batches are overflowing memory then this method can be called to reduce their size.
int
, default 16
The number of batches to read ahead in a file. This might not work for all file formats. Increasing this number will increase RAM usage but could also improve IO utilization.
int
, default 4
The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions
, default None
Options specific to a particular scan and fragment type, which can change between different scans of the same dataset.
True
If enabled, then maximum parallelism will be used determined by the number of available CPU cores.
True
If enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool
, default None
For memory allocations, if required. If not specified, uses the default pool.
int
Load the first N rows of the fragment.
int
The number of rows to load.
list
of str
, default None
The columns to project. This can be a list of column names to include (order and duplicates will be preserved), or a dictionary with {new_column_name: expression} values for more advanced projections.
The list of columns or expressions may use the special fields __batch_index (the index of the batch within the fragment), __fragment_index (the index of the fragment within the dataset), __last_in_fragment (whether the batch is last in fragment), and __filename (the name of the source file or a description of the source fragment).
The columns will be passed down to Datasets and corresponding data fragments to avoid loading, copying, and deserializing columns that will not be required further down the compute chain. By default all of the available columns are projected. Raises an exception if any of the referenced column names does not exist in the datasetâs Schema.
Expression
, default None
Scan will return only the rows matching the filter. If possible the predicate will be pushed down to exploit the partition information or internal metadata found in the data source, e.g. Parquet statistics. Otherwise filters the loaded RecordBatches before yielding them.
int
, default 131_072
The maximum row count for scanned record batches. If scanned record batches are overflowing memory then this method can be called to reduce their size.
int
, default 16
The number of batches to read ahead in a file. This might not work for all file formats. Increasing this number will increase RAM usage but could also improve IO utilization.
int
, default 4
The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions
, default None
Options specific to a particular scan and fragment type, which can change between different scans of the same dataset.
True
If enabled, then maximum parallelism will be used determined by the number of available CPU cores.
True
If enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool
, default None
For memory allocations, if required. If not specified, uses the default pool.
Table
An Expression which evaluates to true for all data viewed by this Fragment.
Return the physical schema of this Fragment. This schema can be different from the dataset read schema.
Build a scan operation against the fragment.
Data is not loaded immediately. Instead, this produces a Scanner, which exposes further operations (e.g. loading all data as a table, counting rows).
Schema
Schema to use for scanning. This is used to unify a Fragment to its Datasetâs schema. If not specified this will use the Fragmentâs physical schema which might differ for each Fragment.
list
of str
, default None
The columns to project. This can be a list of column names to include (order and duplicates will be preserved), or a dictionary with {new_column_name: expression} values for more advanced projections.
The list of columns or expressions may use the special fields __batch_index (the index of the batch within the fragment), __fragment_index (the index of the fragment within the dataset), __last_in_fragment (whether the batch is last in fragment), and __filename (the name of the source file or a description of the source fragment).
The columns will be passed down to Datasets and corresponding data fragments to avoid loading, copying, and deserializing columns that will not be required further down the compute chain. By default all of the available columns are projected. Raises an exception if any of the referenced column names does not exist in the datasetâs Schema.
Expression
, default None
Scan will return only the rows matching the filter. If possible the predicate will be pushed down to exploit the partition information or internal metadata found in the data source, e.g. Parquet statistics. Otherwise filters the loaded RecordBatches before yielding them.
int
, default 131_072
The maximum row count for scanned record batches. If scanned record batches are overflowing memory then this method can be called to reduce their size.
int
, default 16
The number of batches to read ahead in a file. This might not work for all file formats. Increasing this number will increase RAM usage but could also improve IO utilization.
int
, default 4
The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions
, default None
Options specific to a particular scan and fragment type, which can change between different scans of the same dataset.
True
If enabled, then maximum parallelism will be used determined by the number of available CPU cores.
True
If enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool
, default None
For memory allocations, if required. If not specified, uses the default pool.
Scanner
Select rows of data by index.
Array
or array-like
The indices of row to select in the dataset.
list
of str
, default None
The columns to project. This can be a list of column names to include (order and duplicates will be preserved), or a dictionary with {new_column_name: expression} values for more advanced projections.
The list of columns or expressions may use the special fields __batch_index (the index of the batch within the fragment), __fragment_index (the index of the fragment within the dataset), __last_in_fragment (whether the batch is last in fragment), and __filename (the name of the source file or a description of the source fragment).
The columns will be passed down to Datasets and corresponding data fragments to avoid loading, copying, and deserializing columns that will not be required further down the compute chain. By default all of the available columns are projected. Raises an exception if any of the referenced column names does not exist in the datasetâs Schema.
Expression
, default None
Scan will return only the rows matching the filter. If possible the predicate will be pushed down to exploit the partition information or internal metadata found in the data source, e.g. Parquet statistics. Otherwise filters the loaded RecordBatches before yielding them.
int
, default 131_072
The maximum row count for scanned record batches. If scanned record batches are overflowing memory then this method can be called to reduce their size.
int
, default 16
The number of batches to read ahead in a file. This might not work for all file formats. Increasing this number will increase RAM usage but could also improve IO utilization.
int
, default 4
The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions
, default None
Options specific to a particular scan and fragment type, which can change between different scans of the same dataset.
True
If enabled, then maximum parallelism will be used determined by the number of available CPU cores.
True
If enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool
, default None
For memory allocations, if required. If not specified, uses the default pool.
Table
Read the fragment as materialized record batches.
Schema
, optional
Concrete schema to use for scanning.
list
of str
, default None
The columns to project. This can be a list of column names to include (order and duplicates will be preserved), or a dictionary with {new_column_name: expression} values for more advanced projections.
The list of columns or expressions may use the special fields __batch_index (the index of the batch within the fragment), __fragment_index (the index of the fragment within the dataset), __last_in_fragment (whether the batch is last in fragment), and __filename (the name of the source file or a description of the source fragment).
The columns will be passed down to Datasets and corresponding data fragments to avoid loading, copying, and deserializing columns that will not be required further down the compute chain. By default all of the available columns are projected. Raises an exception if any of the referenced column names does not exist in the datasetâs Schema.
Expression
, default None
Scan will return only the rows matching the filter. If possible the predicate will be pushed down to exploit the partition information or internal metadata found in the data source, e.g. Parquet statistics. Otherwise filters the loaded RecordBatches before yielding them.
int
, default 131_072
The maximum row count for scanned record batches. If scanned record batches are overflowing memory then this method can be called to reduce their size.
int
, default 16
The number of batches to read ahead in a file. This might not work for all file formats. Increasing this number will increase RAM usage but could also improve IO utilization.
int
, default 4
The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions
, default None
Options specific to a particular scan and fragment type, which can change between different scans of the same dataset.
True
If enabled, then maximum parallelism will be used determined by the number of available CPU cores.
True
If enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool
, default None
For memory allocations, if required. If not specified, uses the default pool.
RecordBatch
Convert this Fragment into a Table.
Use this convenience utility with care. This will serially materialize the Scan result in memory before creating the Table.
Schema
, optional
Concrete schema to use for scanning.
list
of str
, default None
The columns to project. This can be a list of column names to include (order and duplicates will be preserved), or a dictionary with {new_column_name: expression} values for more advanced projections.
The list of columns or expressions may use the special fields __batch_index (the index of the batch within the fragment), __fragment_index (the index of the fragment within the dataset), __last_in_fragment (whether the batch is last in fragment), and __filename (the name of the source file or a description of the source fragment).
The columns will be passed down to Datasets and corresponding data fragments to avoid loading, copying, and deserializing columns that will not be required further down the compute chain. By default all of the available columns are projected. Raises an exception if any of the referenced column names does not exist in the datasetâs Schema.
Expression
, default None
Scan will return only the rows matching the filter. If possible the predicate will be pushed down to exploit the partition information or internal metadata found in the data source, e.g. Parquet statistics. Otherwise filters the loaded RecordBatches before yielding them.
int
, default 131_072
The maximum row count for scanned record batches. If scanned record batches are overflowing memory then this method can be called to reduce their size.
int
, default 16
The number of batches to read ahead in a file. This might not work for all file formats. Increasing this number will increase RAM usage but could also improve IO utilization.
int
, default 4
The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions
, default None
Options specific to a particular scan and fragment type, which can change between different scans of the same dataset.
True
If enabled, then maximum parallelism will be used determined by the number of available CPU cores.
True
If enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool
, default None
For memory allocations, if required. If not specified, uses the default pool.
Table
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4