Skip to content

Commit 133c77c

Browse files
authored
Adds log statements when beginning to read and after finished reading Parquet files (#390)
1 parent a374ca5 commit 133c77c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/ygm/io/parquet_parser.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,8 @@ class parquet_parser {
513513
const stdfs::path &file_path, Function fn,
514514
const size_t max_num_rows_to_read,
515515
std::optional<std::vector<std::string>> columns_to_read = std::nullopt) {
516+
m_comm.log(log_level::info,
517+
std::string("Beginning to read file ") + file_path.string());
516518
size_t num_read_rows = 0;
517519
try {
518520
// Create a ParquetReader instance
@@ -632,7 +634,14 @@ class parquet_parser {
632634
++num_read_rows;
633635
}
634636
}
637+
std::string msg("Finished reading file ");
638+
m_comm.log(log_level::info, msg + file_path.string());
639+
// m_comm.log(log_level::info, "{}", msg);
635640
} catch (const std::exception &e) {
641+
std::string msg("Error while reading file ");
642+
m_comm.log(
643+
log_level::error,
644+
msg + file_path.string() + std::string(": ") + std::string(e.what()));
636645
// rethrow the exception
637646
std::cerr << "Error reading Parquet file: " << file_path << " "
638647
<< e.what() << std::endl;

0 commit comments

Comments
 (0)