-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from LLNL/master
Preparing v0.6 Release (LLNL#200)
- Loading branch information
Showing
89 changed files
with
5,741 additions
and
2,365 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -1,10 +1,21 @@ | ||
# Copyright 2019-2021 Lawrence Livermore National Security, LLC and other YGM | ||
# Copyright 2019-2023 Lawrence Livermore National Security, LLC and other YGM | ||
# Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
if (Arrow_FOUND AND Parquet_FOUND) | ||
add_ygm_example(arrow_parquet_stream_reader) | ||
target_link_libraries(arrow_parquet_stream_reader PUBLIC arrow_shared parquet_shared) | ||
endif() | ||
target_link_libraries(arrow_parquet_stream_reader PUBLIC | ||
Arrow::arrow_shared Parquet::parquet_shared) | ||
|
||
add_ygm_example(arrow_parquet_stream_reader_variant) | ||
target_link_libraries(arrow_parquet_stream_reader_variant PUBLIC | ||
Arrow::arrow_shared Parquet::parquet_shared) | ||
|
||
if (Boost_FOUND) | ||
add_ygm_example(arrow_parquet_stream_reader_json) | ||
target_include_directories(arrow_parquet_stream_reader_json PUBLIC ${Boost_INCLUDE_DIRS}) | ||
target_link_libraries(arrow_parquet_stream_reader_json PUBLIC | ||
Arrow::arrow_shared Parquet::parquet_shared) | ||
endif() | ||
endif() |
This file contains 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,53 @@ | ||
// Copyright 2019-2023 Lawrence Livermore National Security, LLC and other YGM | ||
// Project Developers. See the top-level COPYRIGHT file for details. | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
// Usage: | ||
// cd /ygm/build/dir | ||
// mpirun -np 2 ./arrow_parquet_stream_reader_json \ | ||
// [(option) /path/to/parquet/file/or/dir] | ||
|
||
#include <algorithm> | ||
#include <cassert> | ||
#include <cstdint> | ||
#include <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
||
#include <boost/json/src.hpp> | ||
|
||
#include <ygm/comm.hpp> | ||
#include <ygm/detail/cereal_boost_json.hpp> | ||
#include <ygm/io/detail/arrow_parquet_json_converter.hpp> | ||
|
||
int main(int argc, char** argv) { | ||
ygm::comm world(&argc, &argv); | ||
|
||
world.cout0() | ||
<< "Arrow Parquet file parser example (reads data as JSON objects)" | ||
<< std::endl; | ||
|
||
// assuming the build directory is inside the YGM root directory | ||
std::string dir_name = "../test/data/parquet_files_json/"; | ||
if (argc == 2) { | ||
dir_name = argv[1]; | ||
} | ||
|
||
ygm::io::arrow_parquet_parser parquetp(world, {dir_name}); | ||
|
||
world.cout0() << "Schema:\n" << parquetp.schema_to_string() << std::endl; | ||
|
||
world.cout0() << "Read data as JSON:" << std::endl; | ||
const auto& schema = parquetp.schema(); | ||
parquetp.for_all([&schema, &world](auto& stream_reader, const auto&) { | ||
// obj's type is boost::json::object | ||
const auto obj = | ||
ygm::io::detail::read_parquet_as_json(stream_reader, schema); | ||
|
||
world.async( | ||
0, [](auto, const auto& obj) { std::cout << obj << std::endl; }, obj); | ||
}); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.