Skip to content

Commit

Permalink
Make parquet schema index type consistent (#14256)
Browse files Browse the repository at this point in the history
While working on parquet schema issue I noticed that the parent and child index didn't match. Discussion ensued and `size_type` was decided.

Authors:
  - Mike Wilson (https://github.com/hyperbolic2346)

Approvers:
  - Vukasin Milovanovic (https://github.com/vuule)
  - MithunR (https://github.com/mythrocks)
  - Nghia Truong (https://github.com/ttnghia)

URL: #14256
  • Loading branch information
hyperbolic2346 authored Oct 10, 2023
1 parent b4fd77b commit 053da82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cpp/src/io/parquet/parquet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include "parquet_common.hpp"

#include <cudf/types.hpp>

#include <thrust/optional.h>

#include <cstdint>
Expand Down Expand Up @@ -152,8 +154,8 @@ struct SchemaElement {
// The following fields are filled in later during schema initialization
int max_definition_level = 0;
int max_repetition_level = 0;
int parent_idx = 0;
std::vector<size_t> children_idx;
size_type parent_idx = 0;
std::vector<size_type> children_idx;

bool operator==(SchemaElement const& other) const
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/io/parquet/reader_impl_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void metadata::sanitize_schema()
// add a struct child and move this element's children to the struct
schema_elem.converted_type = LIST;
schema_elem.repetition_type = OPTIONAL;
auto const struct_node_idx = schema.size();
auto const struct_node_idx = static_cast<size_type>(schema.size());

SchemaElement struct_elem;
struct_elem.name = "struct_node";
Expand Down

0 comments on commit 053da82

Please sign in to comment.