bkietz commented on code in PR #46180:
URL: https://github.com/apache/arrow/pull/46180#discussion_r2073874808


##########
cpp/src/arrow/json/from_string.h:
##########
@@ -0,0 +1,88 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Implement a simple JSON representation format for arrays
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include <string_view>
+
+#include "arrow/status.h"
+#include "arrow/type_fwd.h"
+#include "arrow/util/visibility.h"
+
+namespace arrow {
+
+class Array;
+class DataType;
+
+namespace json {
+
+/// \defgroup array-from-json-string Helpers for constructing Arrays from JSON
+/// text
+///
+/// These helpers are intended to be used in examples, tests, or for quick
+/// prototyping and are not intended to be used where performance matters.
+///
+/// @{
+
+/// \brief Create an Array from a JSON string

Review Comment:
   It'd be nice if these included at least one usage example
   
   ```suggestion
   /// \brief Create an Array from a JSON string
   ///
   /// \code {.cpp}
   /// std::shared_ptr<Array> array = ArrayFromJSONString(
   ///   int64(), "[2, 3, 5, 7, 11]"
   /// ).ValueOrDie();
   /// \endcode
   ```
   
   



##########
docs/source/cpp/api/array.rst:
##########
@@ -110,3 +110,12 @@ Utilities
    :project: arrow_cpp
    :members:
    :undoc-members:
+
+.. _api-array-from-json-string:
+
+FromJSONString Helpers
+----------------------
+
+.. doxygengroup:: array-from-json-string
+   :content-only:

Review Comment:
   This omits the [group 
description](http://crossbow.voltrondata.com/pr_docs/46180/cpp/api/array.html#fromjsonstring-helpers);
 I think it'd be better to include the description rather than leave that blank
   ```suggestion
   ```
   
   alternatively/in addition this could link back to the explanation in 
`docs/source/cpp/arrays.rst`



##########
docs/source/cpp/arrays.rst:
##########
@@ -57,6 +57,10 @@ example a ``std::vector``.  Instead, several strategies can 
be used:
   subclasses help building up array data incrementally, without having to
   deal with details of the Arrow format yourself.
 
+.. note:: For cases where performance isn't important such as examples or 
tests,
+          you may prefer to use the ``*FromJSON`` helpers which can create

Review Comment:
   ```suggestion
             you may prefer to use the ``*FromJSONString`` helpers which can 
create
   ```



-- 
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

Reply via email to