Skip to content

Commit

Permalink
Rename aggregate_metadata in writer to fix name collision (#9938)
Browse files Browse the repository at this point in the history
  • Loading branch information
devavret authored Jan 5, 2022
1 parent b1ae789 commit f7cc6a0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions cpp/src/io/parquet/reader_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ struct metadata : public FileMetaData {
}
};

class aggregate_metadata {
class aggregate_reader_metadata {
std::vector<metadata> const per_file_metadata;
std::map<std::string, std::string> const agg_keyval_map;
size_type const num_rows;
Expand Down Expand Up @@ -357,7 +357,7 @@ class aggregate_metadata {
}

public:
aggregate_metadata(std::vector<std::unique_ptr<datasource>> const& sources)
aggregate_reader_metadata(std::vector<std::unique_ptr<datasource>> const& sources)
: per_file_metadata(metadatas_from_sources(sources)),
agg_keyval_map(merge_keyval_metadata()),
num_rows(calc_num_rows()),
Expand Down Expand Up @@ -822,7 +822,7 @@ class aggregate_metadata {
*/
void generate_depth_remappings(std::map<int, std::pair<std::vector<int>, std::vector<int>>>& remap,
int src_col_schema,
aggregate_metadata const& md)
aggregate_reader_metadata const& md)
{
// already generated for this level
if (remap.find(src_col_schema) != remap.end()) { return; }
Expand Down Expand Up @@ -1587,7 +1587,7 @@ reader::impl::impl(std::vector<std::unique_ptr<datasource>>&& sources,
: _mr(mr), _sources(std::move(sources))
{
// Open and parse the source dataset metadata
_metadata = std::make_unique<aggregate_metadata>(_sources);
_metadata = std::make_unique<aggregate_reader_metadata>(_sources);

// Override output timestamp resolution if requested
if (options.get_timestamp_type().id() != type_id::EMPTY) {
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/io/parquet/reader_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ using namespace cudf::io::parquet;
using namespace cudf::io;

// Forward declarations
class aggregate_metadata;
class aggregate_reader_metadata;

/**
* @brief Implementation for Parquet reader
Expand Down Expand Up @@ -199,7 +199,7 @@ class reader::impl {
private:
rmm::mr::device_memory_resource* _mr = nullptr;
std::vector<std::unique_ptr<datasource>> _sources;
std::unique_ptr<aggregate_metadata> _metadata;
std::unique_ptr<aggregate_reader_metadata> _metadata;

// input columns to be processed
std::vector<input_column_info> _input_columns;
Expand Down
14 changes: 7 additions & 7 deletions cpp/src/io/parquet/writer_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ parquet::Compression to_parquet_compression(compression_type compression)

} // namespace

struct aggregate_metadata {
aggregate_metadata(std::vector<partition_info> const& partitions,
size_type num_columns,
std::vector<SchemaElement> schema,
statistics_freq stats_granularity,
std::vector<std::map<std::string, std::string>> const& kv_md)
struct aggregate_writer_metadata {
aggregate_writer_metadata(std::vector<partition_info> const& partitions,
size_type num_columns,
std::vector<SchemaElement> schema,
statistics_freq stats_granularity,
std::vector<std::map<std::string, std::string>> const& kv_md)
: version(1), schema(std::move(schema)), files(partitions.size())
{
for (size_t i = 0; i < partitions.size(); ++i) {
Expand Down Expand Up @@ -1226,7 +1226,7 @@ void writer::impl::write(table_view const& table, std::vector<partition_info> co
std::vector<SchemaElement> this_table_schema(schema_tree.begin(), schema_tree.end());

if (!md) {
md = std::make_unique<aggregate_metadata>(
md = std::make_unique<aggregate_writer_metadata>(
partitions, num_columns, std::move(this_table_schema), stats_granularity_, kv_md);
} else {
// verify the user isn't passing mismatched tables
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/io/parquet/writer_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace detail {
namespace parquet {
// Forward internal classes
struct parquet_column_view;
struct aggregate_metadata;
struct aggregate_writer_metadata;

using namespace cudf::io::parquet;
using namespace cudf::io;
Expand Down Expand Up @@ -214,7 +214,7 @@ class writer::impl {
statistics_freq stats_granularity_ = statistics_freq::STATISTICS_NONE;
bool int96_timestamps = false;
// Overall file metadata. Filled in during the process and written during write_chunked_end()
std::unique_ptr<aggregate_metadata> md;
std::unique_ptr<aggregate_writer_metadata> md;
// File footer key-value metadata. Written during write_chunked_end()
std::vector<std::map<std::string, std::string>> kv_md;
// optional user metadata
Expand Down

0 comments on commit f7cc6a0

Please sign in to comment.