diff --git a/cpp/src/io/json/json_column.cu b/cpp/src/io/json/json_column.cu index 10646fad354..6576d41dd72 100644 --- a/cpp/src/io/json/json_column.cu +++ b/cpp/src/io/json/json_column.cu @@ -674,6 +674,7 @@ void make_device_json_column(device_span input, reinitialize_as_string(old_col_id, col); // all its children (which are already inserted) are ignored later. } + col.forced_as_string_column = true; columns.try_emplace(this_col_id, columns.at(old_col_id)); continue; } @@ -915,6 +916,8 @@ std::pair, std::vector> device_json_co : "n/a"); #endif target_type = schema.value().type; + } else if (json_col.forced_as_string_column) { + target_type = data_type{type_id::STRING}; } // Infer column type, if we don't have an explicit type for it else { diff --git a/cpp/src/io/json/nested_json.hpp b/cpp/src/io/json/nested_json.hpp index f41b024bb1e..64fffdb27fc 100644 --- a/cpp/src/io/json/nested_json.hpp +++ b/cpp/src/io/json/nested_json.hpp @@ -160,6 +160,8 @@ struct device_json_column { std::vector column_order; // Counting the current number of items in this column row_offset_t num_rows = 0; + // Force as string column + bool forced_as_string_column{false}; /** * @brief Construct a new d json column object