-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add hybrid scan multifile reader basics #22616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
121bf9d
b763cdb
c9bf419
795f058
ec0b59e
f8b90ea
90aef61
8876f57
a575276
c7d7cb6
467a628
1909146
17fd247
0493395
e0319ab
bf25506
1916d99
620615d
3d04fb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,15 +19,13 @@ | |
| #include <utility> | ||
| #include <vector> | ||
|
|
||
| namespace CUDF_EXPORT cudf { | ||
| namespace io::parquet::experimental::detail { | ||
| namespace cudf::io::parquet::experimental::detail { | ||
| /** | ||
| * @brief Internal experimental Parquet reader optimized for highly selective filters, called a | ||
| * Hybrid Scan operation. | ||
| */ | ||
| class hybrid_scan_reader_impl; | ||
| } // namespace io::parquet::experimental::detail | ||
| } // namespace CUDF_EXPORT cudf | ||
| } // namespace cudf::io::parquet::experimental::detail | ||
|
|
||
| //! Using `byte_range_info` from cudf::io::text | ||
| using cudf::io::text::byte_range_info; | ||
|
|
@@ -344,7 +342,7 @@ class hybrid_scan_reader { | |
| * @param row_group_indices Input row groups indices | ||
| * @return Total number of top-level rows in the row groups | ||
| */ | ||
| [[nodiscard]] size_type total_rows_in_row_groups( | ||
| [[nodiscard]] std::size_t total_rows_in_row_groups( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the |
||
| cudf::host_span<size_type const> row_group_indices) const; | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <cudf/io/experimental/hybrid_scan.hpp> | ||
| #include <cudf/io/parquet.hpp> | ||
| #include <cudf/io/parquet_schema.hpp> | ||
| #include <cudf/io/text/byte_range_info.hpp> | ||
| #include <cudf/io/types.hpp> | ||
| #include <cudf/types.hpp> | ||
| #include <cudf/utilities/export.hpp> | ||
|
|
||
| #include <rmm/cuda_stream_view.hpp> | ||
| #include <rmm/resource_ref.hpp> | ||
|
|
||
| #include <memory> | ||
| #include <vector> | ||
|
|
||
| namespace cudf::io::parquet::experimental::detail { | ||
| /** | ||
| * @brief Internal experimental Parquet reader optimized for highly selective filters, called a | ||
| * Hybrid Scan operation. | ||
| */ | ||
| class hybrid_scan_reader_impl; | ||
| } // namespace cudf::io::parquet::experimental::detail | ||
|
|
||
| //! Using `byte_range_info` from cudf::io::text | ||
| using cudf::io::text::byte_range_info; | ||
|
|
||
| namespace CUDF_EXPORT cudf { | ||
| namespace io::parquet::experimental { | ||
| /** | ||
| * @addtogroup io_readers | ||
| * @{ | ||
| * @file | ||
| */ | ||
|
|
||
| /** | ||
| * @brief Multi-file variant of the experimental Hybrid Scan Parquet reader | ||
| * | ||
| * Vectorizes `hybrid_scan_reader` APIs to support multiple Parquet sources. Inputs and outputs are | ||
| * indexed by source order except for the row mask which is a single BOOL8 column spanning all rows | ||
| * from all sources concatenated in source order, then row-group order within a source. | ||
| * | ||
| * @note Detailed usage documentation will be added once all APIs are in place. This reader will | ||
| * eventually move to `hybrid_scan.hpp` and the existing single-file reader (`hybrid_scan_reader`) | ||
| * will become its subclass. Only keeping this separate here for now to reduce noise. | ||
| */ | ||
| class hybrid_scan_multifile { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am going to eventually remove this file, move this class to |
||
| public: | ||
| /** | ||
| * @brief Constructor for the multi-file experimental Parquet reader | ||
| * | ||
| * @param footer_bytes Host span of Parquet file footer byte spans, one per source | ||
| * @param options Parquet reader options | ||
| */ | ||
| explicit hybrid_scan_multifile(cudf::host_span<cudf::host_span<uint8_t const> const> footer_bytes, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mhaseeb123 can you please check #22560 to see if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update: We also gotta make sure that |
||
| parquet_reader_options const& options); | ||
|
|
||
| /** | ||
| * @brief Constructor for the multi-file experimental Parquet reader | ||
| * | ||
| * @param parquet_metadata Host span of pre-populated Parquet file metadata, one per source | ||
| * @param options Parquet reader options | ||
| */ | ||
| explicit hybrid_scan_multifile(cudf::host_span<FileMetaData const> parquet_metadata, | ||
| parquet_reader_options const& options); | ||
|
|
||
| /** | ||
| * @brief Destructor for the multi-file experimental Parquet reader | ||
| */ | ||
| ~hybrid_scan_multifile(); | ||
|
|
||
| /** | ||
| * @brief Get parquet metadatas for all sources | ||
| * | ||
| * @return Vector of parquet metadata, one per source | ||
| */ | ||
| [[nodiscard]] std::vector<FileMetaData> parquet_metadatas() const; | ||
|
mhaseeb123 marked this conversation as resolved.
|
||
|
|
||
| /** | ||
| * @brief Get byte ranges of the page index for all sources | ||
| * | ||
| * @return Vector of page index byte ranges, one per source | ||
| */ | ||
| [[nodiscard]] std::vector<byte_range_info> page_index_byte_ranges() const; | ||
|
|
||
| /** | ||
| * @brief Setup the per-source page index within each Parquet file metadata | ||
| * | ||
| * @param page_index_bytes Host span of Parquet page index buffer bytes, one per source | ||
| */ | ||
| void setup_page_indexes( | ||
| cudf::host_span<cudf::host_span<uint8_t const> const> page_index_bytes) const; | ||
|
|
||
| /** | ||
| * @brief Get all available per-source row group indices from the parquet files | ||
| * | ||
| * @param options Parquet reader options | ||
| * @return Vector of row group indices, one inner vector per source | ||
| */ | ||
| [[nodiscard]] std::vector<std::vector<size_type>> all_row_groups( | ||
| parquet_reader_options const& options) const; | ||
|
|
||
| /** | ||
| * @brief Get the total number of top-level rows in the per-source row groups | ||
| * | ||
| * @param row_group_indices Input per-source row group indices (one inner vector per source) | ||
| * @return Total number of top-level rows across all sources | ||
| */ | ||
| [[nodiscard]] size_type total_rows_in_row_groups( | ||
| cudf::host_span<std::vector<size_type> const> row_group_indices) const; | ||
|
|
||
| /** | ||
| * @brief Resets the current column selection | ||
| * | ||
| * Resets the current column selection state forcing column re-selection in subsequent filter, | ||
| * byte range, setup chunking and materialization APIs. This is useful if the filter expression | ||
| * has been cascaded (and-ed) to include new columns. | ||
| */ | ||
| void reset_column_selection() const; | ||
|
|
||
| private: | ||
| std::unique_ptr<detail::hybrid_scan_reader_impl> _impl; | ||
| }; | ||
|
|
||
| /** @} */ // end of group | ||
|
|
||
| } // namespace io::parquet::experimental | ||
| } // namespace CUDF_EXPORT cudf | ||
Uh oh!
There was an error while loading. Please reload this page.