-
Notifications
You must be signed in to change notification settings - Fork 67
feat: writing/reading to parquet #1002
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
984b09f
feat: writing/reading to parquet
arnavdham 666127e
clang format
arnavdham 73dfaa5
arrow ->podioarrow
arnavdham 9c0d129
fix: arrow c++ compilation issues
arnavdham 1844767
fix: incomplete type error for FileWriter
arnavdham a8263a5
fix
arnavdham f5b264f
ci/cd fixes
arnavdham 2d4598a
pre commit and correct arrow version.
arnavdham 9dc1ee9
addressing comments
arnavdham ed1b853
resolving comments.
arnavdham cf788ef
pre test failures
arnavdham 057ca93
clang format
arnavdham a261740
small fix.
arnavdham adf00e8
whitespace
arnavdham efe75db
ENABLE_PARQUET
arnavdham bd06807
defaulkt off
arnavdham a939aa0
parquet to pre-commit
arnavdham 546cffe
enable parquet for dev*
arnavdham 86e1164
bug fix
arnavdham 6d0442a
Default compression changed,
arnavdham 6aa2d54
Resolving multiple comments
arnavdham 4e6e598
miss
arnavdham 2c41e15
fix
arnavdham 0a3eef6
documentation and podio_parquet
arnavdham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| #ifndef PODIO_ARROWREADER_H | ||
| #define PODIO_ARROWREADER_H | ||
|
|
||
| #include "podio/podioVersion.h" | ||
| #include "podio/utilities/ArrowFrameData.h" | ||
| #include "podio/utilities/ReaderCommon.h" | ||
|
|
||
| #include <cstddef> | ||
| #include <filesystem> | ||
| #include <map> | ||
| #include <memory> | ||
| #include <optional> | ||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| namespace arrow { | ||
| class Table; | ||
| } | ||
|
|
||
| namespace podio { | ||
|
|
||
| /// Arrow backend reader for PODIO | ||
| /// | ||
| /// Reads data from a directory structure containing one Parquet file per category | ||
| /// and a metadata.json file containing metadata for reading. | ||
| class ArrowReader : public ReaderCommon { | ||
| public: | ||
| /// Create an ArrowReader | ||
| ArrowReader(); | ||
|
|
||
| /// Open the passed directory for reading. | ||
| /// | ||
| /// @param directory The path to the directory to read from | ||
| void openFile(const std::string& directory); | ||
|
|
||
| ~ArrowReader() = default; | ||
|
|
||
| ArrowReader(const ArrowReader&) = delete; | ||
| ArrowReader& operator=(const ArrowReader&) = delete; | ||
| ArrowReader(ArrowReader&&) = delete; | ||
| ArrowReader& operator=(ArrowReader&&) = delete; | ||
|
|
||
| /// Read the next entry for the given category | ||
| std::unique_ptr<podio::ArrowFrameData> readNextEntry(std::string_view name, | ||
| const std::vector<std::string>& collsToRead = {}); | ||
|
|
||
| /// Read the specific entry for the given category | ||
| std::unique_ptr<podio::ArrowFrameData> readEntry(std::string_view name, size_t index, | ||
| const std::vector<std::string>& collsToRead = {}); | ||
|
|
||
| /// Get the number of entries for a category | ||
| size_t getEntries(std::string_view name) const; | ||
|
|
||
| private: | ||
| struct CategoryInfo { | ||
| std::string filePath{}; | ||
| size_t entries = 0; | ||
| size_t currentIndex = 0; | ||
| std::shared_ptr<arrow::Table> table{nullptr}; | ||
| }; | ||
|
|
||
| void loadCategoryTable(CategoryInfo& catInfo); | ||
|
|
||
| std::string m_directory{}; | ||
| std::map<std::string, CategoryInfo> m_categories{}; | ||
| }; | ||
|
|
||
| } // namespace podio | ||
|
|
||
| #endif // PODIO_ARROWREADER_H |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.