| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/../generated/pyarrow.dataset.Fragment.html | [Back] [Original] |
Bases: _Weakrefable
Fragment of data from a Dataset.
Methods
|
|
|
Count rows matching the scanner filter. |
|
Load the first N rows of the fragment. |
|
Build a scan operation against the fragment. |
|
Select rows of data by index. |
|
Read the fragment as materialized record batches. |
|
Convert this Fragment into a Table. |
Attributes
An Expression which evaluates to true for all data viewed by this Fragment. |
|
Return the physical schema of this Fragment. |
Count rows matching the scanner filter.
Expression, default NoneScan 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_072The 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 16The 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 4The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions, default NoneOptions specific to a particular scan and fragment type, which can change between different scans of the same dataset.
TrueIf enabled, then maximum parallelism will be used determined by the number of available CPU cores.
TrueIf enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool, default NoneFor memory allocations, if required. If not specified, uses the default pool.
intLoad the first N rows of the fragment.
intThe number of rows to load.
list of str, default NoneThe 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 datasets Schema.
Expression, default NoneScan 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_072The 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 16The 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 4The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions, default NoneOptions specific to a particular scan and fragment type, which can change between different scans of the same dataset.
TrueIf enabled, then maximum parallelism will be used determined by the number of available CPU cores.
TrueIf enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool, default NoneFor memory allocations, if required. If not specified, uses the default pool.
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).
SchemaSchema to use for scanning. This is used to unify a Fragment to its Datasets schema. If not specified this will use the Fragments physical schema which might differ for each Fragment.
list of str, default NoneThe 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 datasets Schema.
Expression, default NoneScan 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_072The 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 16The 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 4The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions, default NoneOptions specific to a particular scan and fragment type, which can change between different scans of the same dataset.
TrueIf enabled, then maximum parallelism will be used determined by the number of available CPU cores.
TrueIf enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool, default NoneFor memory allocations, if required. If not specified, uses the default pool.
ScannerSelect rows of data by index.
Array or array-likeThe indices of row to select in the dataset.
list of str, default NoneThe 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 datasets Schema.
Expression, default NoneScan 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_072The 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 16The 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 4The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions, default NoneOptions specific to a particular scan and fragment type, which can change between different scans of the same dataset.
TrueIf enabled, then maximum parallelism will be used determined by the number of available CPU cores.
TrueIf enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool, default NoneFor memory allocations, if required. If not specified, uses the default pool.
Read the fragment as materialized record batches.
Schema, optionalConcrete schema to use for scanning.
list of str, default NoneThe 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 datasets Schema.
Expression, default NoneScan 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_072The 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 16The 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 4The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions, default NoneOptions specific to a particular scan and fragment type, which can change between different scans of the same dataset.
TrueIf enabled, then maximum parallelism will be used determined by the number of available CPU cores.
TrueIf enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool, default NoneFor memory allocations, if required. If not specified, uses the default pool.
RecordBatchConvert 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, optionalConcrete schema to use for scanning.
list of str, default NoneThe 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 datasets Schema.
Expression, default NoneScan 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_072The 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 16The 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 4The number of files to read ahead. Increasing this number will increase RAM usage but could also improve IO utilization.
FragmentScanOptions, default NoneOptions specific to a particular scan and fragment type, which can change between different scans of the same dataset.
TrueIf enabled, then maximum parallelism will be used determined by the number of available CPU cores.
TrueIf enabled, metadata may be cached when scanning to speed up repeated scans.
MemoryPool, default NoneFor memory allocations, if required. If not specified, uses the default pool.
Table| Web Proxy Viewer | New URL | Original Page |