| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/pyarrow.dataset.ParquetFileFragment.html | [Back] [Original] |
Bases: FileFragment
A Fragment representing a parquet file.
Methods
|
|
|
Count rows matching the scanner filter. |
|
Ensure that all metadata (statistics, physical schema, ...) have been read and cached in this fragment. |
|
Load the first N rows of the fragment. |
|
Open a NativeFile of the buffer or file viewed by this fragment. |
|
Build a scan operation against the fragment. |
|
Split the fragment into multiple fragments. |
|
Create a subset of the fragment (viewing a subset of the row groups). |
|
Select rows of data by index. |
|
Read the fragment as materialized record batches. |
|
Convert this Fragment into a Table. |
Attributes
The buffer viewed by this fragment, if it views a buffer. |
|
The FileSystem containing the data file viewed by this fragment, if it views a file. |
|
The format of the data file viewed by this fragment. |
|
Return the number of row groups viewed by this fragment (not the number of row groups in the origin file). |
|
An Expression which evaluates to true for all data viewed by this Fragment. |
|
The path of the data file viewed by this fragment, if it views a file. |
|
Return the physical schema of this Fragment. |
|
The buffer viewed by this fragment, if it views a buffer. If instead it views a file, this will be None.
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.
intEnsure that all metadata (statistics, physical schema, ) have been read and cached in this fragment.
The FileSystem containing the data file viewed by this fragment, if it views a file. If instead it views a buffer, this will be None.
The format of the data file viewed by this fragment.
Load 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.
Return the number of row groups viewed by this fragment (not the number of row groups in the origin file).
Open a NativeFile of the buffer or file viewed by this fragment.
An Expression which evaluates to true for all data viewed by this Fragment.
The path of the data file viewed by this fragment, if it views a file. If instead it views a buffer, this will be <Buffer>.
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.
ScannerSplit the fragment into multiple fragments.
Yield a Fragment wrapping each row group in this ParquetFileFragment. Row groups will be excluded whose metadata contradicts the optional filter.
Expression, default NoneOnly include the row groups which satisfy this predicate (using the Parquet RowGroup statistics).
Schema, default NoneSchema to use when filtering row groups. Defaults to the Fragments physical schema
A list of FragmentsCreate a subset of the fragment (viewing a subset of the row groups).
Subset can be specified by either a filter predicate (with optional schema) or by a list of row group IDs. Note that when using a filter, the resulting fragment can be empty (viewing no row groups).
Expression, default NoneOnly include the row groups which satisfy this predicate (using the Parquet RowGroup statistics).
Schema, default NoneSchema to use when filtering row groups. Defaults to the Fragments physical schema
list of intsThe row group IDs to include in the subset. Can only be specified if filter is None.
Select 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 |