From d6c0eaeb349d2243385f3911fa7ecbc73f84dacd Mon Sep 17 00:00:00 2001 From: Karthikeyan Natarajan Date: Mon, 2 Dec 2024 20:37:37 +0000 Subject: [PATCH] add num_rows to metadata in json reader --- cpp/src/io/json/json_column.cu | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/src/io/json/json_column.cu b/cpp/src/io/json/json_column.cu index 30a154fdda2..53ab849f91b 100644 --- a/cpp/src/io/json/json_column.cu +++ b/cpp/src/io/json/json_column.cu @@ -582,7 +582,8 @@ table_with_metadata device_parse_nested_json(device_span d_input, // Zero row entries if (data_root.type == json_col_t::ListColumn && data_root.child_columns.empty()) { - return table_with_metadata{std::make_unique(std::vector>{})}; + return table_with_metadata{std::make_unique
(std::vector>{}), + {{}, {0}}}; } // Verify that we were in fact given a list of structs (or in JSON speech: an array of objects) @@ -706,7 +707,8 @@ table_with_metadata device_parse_nested_json(device_span d_input, } } - return table_with_metadata{std::make_unique
(std::move(out_columns)), {out_column_names}}; + return table_with_metadata{std::make_unique
(std::move(out_columns)), + {out_column_names, {static_cast(root_col_size)}}}; } } // namespace cudf::io::json::detail