amoeba commented on code in PR #46696: URL: https://github.com/apache/arrow/pull/46696#discussion_r2125115586
########## cpp/src/arrow/json/from_string.h: ########## @@ -68,52 +68,45 @@ Result<std::shared_ptr<Array>> ArrayFromJSONString(const std::shared_ptr<DataTyp /// \brief Create a ChunkedArray from a JSON string /// /// \code {.cpp} -/// std::shared_ptr<ChunkedArray> chunked_array; -/// ChunkedArrayFromJSONString( -/// int64(), {R"([5, 10])", R"([null])", R"([16])"}, &chunked_array -/// ); +/// std::shared_ptr<ChunkedArray> chunked_array = +/// ChunkedArrayFromJSONString(int64(), {R"([5, 10])", R"([null])", R"([16])"}) +/// .ValueOrDie(); /// \endcode ARROW_EXPORT -Status ChunkedArrayFromJSONString(const std::shared_ptr<DataType>& type, - const std::vector<std::string>& json_strings, - std::shared_ptr<ChunkedArray>* out); +Result<std::shared_ptr<ChunkedArray>> ChunkedArrayFromJSONString( + const std::shared_ptr<DataType>& type, const std::vector<std::string>& json_strings); /// \brief Create a DictionaryArray from a JSON string /// /// \code {.cpp} -/// std::shared_ptr<Array> array; -/// DictArrayFromJSONString( -/// dictionary(int32(), utf8()), -/// "[0, 1, 0, 2, 0, 3]", R"(["k1", "k2", "k3", "k4"])", -/// &array -/// ); +/// std::shared_ptr<Array> dict_array = +/// DictArrayFromJSONString(dictionary(int32(), utf8()), "[0, 1, 0, 2, 0, 3]", +/// R"(["k1", "k2", "k3", "k4"])"); Review Comment: Thanks, sorry for not catching that. Now that I look at it again, I'm not sure if the variables here should be named `array` or something like `array_result` or `maybe_array`. We use `maybe_x` in a fair number of places already. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org