Skip to content

Commit c85c3d0

Browse files
amoebakou
andauthored
GH-46439: [C++] Use result pattern for all FromJSONString Helpers (#46696)
### Rationale for this change #45908 brought these helpers into the public API but didn't consider changes to their API. This PR makes all the helpers use the standard Result-pattern to make them more ergonomic. We can do this now without a breaking change because this and #45908 will be part of Arrow 21. ### What changes are included in this PR? - Refactored all FromJSONString helpers to use the Result pattern (instead of using outparams) ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #46439 Lead-authored-by: Bryce Mecum <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 610c201 commit c85c3d0

File tree

6 files changed

+87
-115
lines changed

6 files changed

+87
-115
lines changed

cpp/examples/arrow/from_json_string_example.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ arrow::Status RunExample() {
6868
"[[11, 22], null, [null, 33]]"));
6969

7070
// ChunkedArrayFromJSONString
71-
std::shared_ptr<arrow::ChunkedArray> chunked_array;
72-
ARROW_RETURN_NOT_OK(ChunkedArrayFromJSONString(
73-
arrow::int32(), {"[5, 10]", "[null]", "[16]"}, &chunked_array));
71+
ARROW_ASSIGN_OR_RAISE(
72+
auto chunked_array,
73+
ChunkedArrayFromJSONString(arrow::int32(), {"[5, 10]", "[null]", "[16]"}));
7474

7575
// DictArrayFromJSONString
76-
std::shared_ptr<arrow::Array> dict_array;
77-
ARROW_RETURN_NOT_OK(DictArrayFromJSONString(
78-
dictionary(arrow::int32(), arrow::utf8()), "[0, 1, 0, 2, 0, 3]",
79-
R"(["k1", "k2", "k3", "k4"])", &dict_array));
76+
ARROW_ASSIGN_OR_RAISE(
77+
auto dict_array,
78+
DictArrayFromJSONString(dictionary(arrow::int32(), arrow::utf8()),
79+
"[0, 1, 0, 2, 0, 3]", R"(["k1", "k2", "k3", "k4"])"));
8080

8181
return arrow::Status::OK();
8282
}

cpp/src/arrow/json/from_string.cc

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,23 +1004,20 @@ Result<std::shared_ptr<Array>> ArrayFromJSONString(const std::shared_ptr<DataTyp
10041004
return ArrayFromJSONString(type, std::string_view(json_string));
10051005
}
10061006

1007-
Status ChunkedArrayFromJSONString(const std::shared_ptr<DataType>& type,
1008-
const std::vector<std::string>& json_strings,
1009-
std::shared_ptr<ChunkedArray>* out) {
1007+
Result<std::shared_ptr<ChunkedArray>> ChunkedArrayFromJSONString(
1008+
const std::shared_ptr<DataType>& type, const std::vector<std::string>& json_strings) {
10101009
ArrayVector out_chunks;
10111010
out_chunks.reserve(json_strings.size());
10121011
for (const std::string& chunk_json : json_strings) {
10131012
out_chunks.emplace_back();
10141013
ARROW_ASSIGN_OR_RAISE(out_chunks.back(), ArrayFromJSONString(type, chunk_json));
10151014
}
1016-
*out = std::make_shared<ChunkedArray>(std::move(out_chunks), type);
1017-
return Status::OK();
1015+
return std::make_shared<ChunkedArray>(std::move(out_chunks), type);
10181016
}
10191017

1020-
Status DictArrayFromJSONString(const std::shared_ptr<DataType>& type,
1021-
std::string_view indices_json,
1022-
std::string_view dictionary_json,
1023-
std::shared_ptr<Array>* out) {
1018+
Result<std::shared_ptr<Array>> DictArrayFromJSONString(
1019+
const std::shared_ptr<DataType>& type, std::string_view indices_json,
1020+
std::string_view dictionary_json) {
10241021
if (type->id() != Type::DICTIONARY) {
10251022
return Status::TypeError("DictArrayFromJSON requires dictionary type, got ", *type);
10261023
}
@@ -1031,13 +1028,11 @@ Status DictArrayFromJSONString(const std::shared_ptr<DataType>& type,
10311028
ArrayFromJSONString(dictionary_type.index_type(), indices_json));
10321029
ARROW_ASSIGN_OR_RAISE(auto dictionary, ArrayFromJSONString(dictionary_type.value_type(),
10331030
dictionary_json));
1034-
1035-
return DictionaryArray::FromArrays(type, std::move(indices), std::move(dictionary))
1036-
.Value(out);
1031+
return DictionaryArray::FromArrays(type, std::move(indices), std::move(dictionary));
10371032
}
10381033

1039-
Status ScalarFromJSONString(const std::shared_ptr<DataType>& type,
1040-
std::string_view json_string, std::shared_ptr<Scalar>* out) {
1034+
Result<std::shared_ptr<Scalar>> ScalarFromJSONString(
1035+
const std::shared_ptr<DataType>& type, std::string_view json_string) {
10411036
std::shared_ptr<JSONConverter> converter;
10421037
RETURN_NOT_OK(GetConverter(type, &converter));
10431038

@@ -1052,28 +1047,26 @@ Status ScalarFromJSONString(const std::shared_ptr<DataType>& type,
10521047
RETURN_NOT_OK(converter->AppendValue(json_doc));
10531048
RETURN_NOT_OK(converter->Finish(&array));
10541049
DCHECK_EQ(array->length(), 1);
1055-
return array->GetScalar(0).Value(out);
1050+
return array->GetScalar(0);
10561051
}
10571052

1058-
Status DictScalarFromJSONString(const std::shared_ptr<DataType>& type,
1059-
std::string_view index_json,
1060-
std::string_view dictionary_json,
1061-
std::shared_ptr<Scalar>* out) {
1053+
Result<std::shared_ptr<Scalar>> DictScalarFromJSONString(
1054+
const std::shared_ptr<DataType>& type, std::string_view index_json,
1055+
std::string_view dictionary_json) {
10621056
if (type->id() != Type::DICTIONARY) {
10631057
return Status::TypeError("DictScalarFromJSONString requires dictionary type, got ",
10641058
*type);
10651059
}
10661060

10671061
const auto& dictionary_type = checked_cast<const DictionaryType&>(*type);
10681062

1069-
std::shared_ptr<Scalar> index;
10701063
std::shared_ptr<Array> dictionary;
1071-
RETURN_NOT_OK(ScalarFromJSONString(dictionary_type.index_type(), index_json, &index));
1064+
ARROW_ASSIGN_OR_RAISE(auto index,
1065+
ScalarFromJSONString(dictionary_type.index_type(), index_json));
10721066
ARROW_ASSIGN_OR_RAISE(
10731067
dictionary, ArrayFromJSONString(dictionary_type.value_type(), dictionary_json));
10741068

1075-
*out = DictionaryScalar::Make(std::move(index), std::move(dictionary));
1076-
return Status::OK();
1069+
return DictionaryScalar::Make(std::move(index), std::move(dictionary));
10771070
}
10781071

10791072
} // namespace json

cpp/src/arrow/json/from_string.h

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ namespace json {
4747
/// \brief Create an Array from a JSON string
4848
///
4949
/// \code {.cpp}
50-
/// std::shared_ptr<Array> array = ArrayFromJSONString(
51-
/// int64(), "[2, 3, null, 7, 11]"
52-
/// ).ValueOrDie();
50+
/// Result<std::shared_ptr<Array>> maybe_array =
51+
/// ArrayFromJSONString(int64(), "[2, 3, null, 7, 11]");
5352
/// \endcode
5453
ARROW_EXPORT
5554
Result<std::shared_ptr<Array>> ArrayFromJSONString(const std::shared_ptr<DataType>&,
@@ -68,52 +67,44 @@ Result<std::shared_ptr<Array>> ArrayFromJSONString(const std::shared_ptr<DataTyp
6867
/// \brief Create a ChunkedArray from a JSON string
6968
///
7069
/// \code {.cpp}
71-
/// std::shared_ptr<ChunkedArray> chunked_array;
72-
/// ChunkedArrayFromJSONString(
73-
/// int64(), {R"([5, 10])", R"([null])", R"([16])"}, &chunked_array
74-
/// );
70+
/// Result<std::shared_ptr<ChunkedArray>> maybe_chunked_array =
71+
/// ChunkedArrayFromJSONString(int64(), {R"([5, 10])", R"([null])", R"([16])"});
7572
/// \endcode
7673
ARROW_EXPORT
77-
Status ChunkedArrayFromJSONString(const std::shared_ptr<DataType>& type,
78-
const std::vector<std::string>& json_strings,
79-
std::shared_ptr<ChunkedArray>* out);
74+
Result<std::shared_ptr<ChunkedArray>> ChunkedArrayFromJSONString(
75+
const std::shared_ptr<DataType>& type, const std::vector<std::string>& json_strings);
8076

8177
/// \brief Create a DictionaryArray from a JSON string
8278
///
8379
/// \code {.cpp}
84-
/// std::shared_ptr<Array> array;
85-
/// DictArrayFromJSONString(
86-
/// dictionary(int32(), utf8()),
87-
/// "[0, 1, 0, 2, 0, 3]", R"(["k1", "k2", "k3", "k4"])",
88-
/// &array
89-
/// );
80+
/// Result<std::shared_ptr<Array>> maybe_dict_array =
81+
/// DictArrayFromJSONString(dictionary(int32(), utf8()), "[0, 1, 0, 2, 0, 3]",
82+
/// R"(["k1", "k2", "k3", "k4"])");
9083
/// \endcode
9184
ARROW_EXPORT
92-
Status DictArrayFromJSONString(const std::shared_ptr<DataType>&,
93-
std::string_view indices_json,
94-
std::string_view dictionary_json,
95-
std::shared_ptr<Array>* out);
85+
Result<std::shared_ptr<Array>> DictArrayFromJSONString(const std::shared_ptr<DataType>&,
86+
std::string_view indices_json,
87+
std::string_view dictionary_json);
9688

9789
/// \brief Create a Scalar from a JSON string
9890
/// \code {.cpp}
99-
/// std::shared_ptr<Scalar> scalar;
100-
/// ScalarFromJSONString(float64(), "42", &scalar);
91+
/// Result<std::shared_ptr<Scalar>> maybe_scalar =
92+
/// ScalarFromJSONString(float64(), "42", &scalar);
10193
/// \endcode
10294
ARROW_EXPORT
103-
Status ScalarFromJSONString(const std::shared_ptr<DataType>&, std::string_view json,
104-
std::shared_ptr<Scalar>* out);
95+
Result<std::shared_ptr<Scalar>> ScalarFromJSONString(const std::shared_ptr<DataType>&,
96+
std::string_view json);
10597

10698
/// \brief Create a DictionaryScalar from a JSON string
10799
/// \code {.cpp}
108-
/// std::shared_ptr<Scalar> scalar;
109-
/// DictScalarFromJSONString(dictionary(int32(), utf8()), "3", R"(["k1", "k2", "k3",
110-
/// "k4"])", &scalar);
100+
/// Result<std::shared_ptr<Scalar>> maybe_dict_scalar =
101+
/// DictScalarFromJSONString(dictionary(int32(), utf8()), "3", R"(["k1", "k2", "k3",
102+
/// "k4"])", &scalar);
111103
/// \endcode
112104
ARROW_EXPORT
113-
Status DictScalarFromJSONString(const std::shared_ptr<DataType>&,
114-
std::string_view index_json,
115-
std::string_view dictionary_json,
116-
std::shared_ptr<Scalar>* out);
105+
Result<std::shared_ptr<Scalar>> DictScalarFromJSONString(
106+
const std::shared_ptr<DataType>&, std::string_view index_json,
107+
std::string_view dictionary_json);
117108

118109
/// @}
119110

cpp/src/arrow/json/from_string_test.cc

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ template <typename T, typename C_TYPE = typename T::c_type>
149149
void AssertJSONScalar(const std::shared_ptr<DataType>& type, const std::string& json,
150150
const bool is_valid, const C_TYPE value) {
151151
SCOPED_TRACE(json);
152-
std::shared_ptr<Scalar> actual, expected;
152+
std::shared_ptr<Scalar> expected;
153153

154-
ASSERT_OK(ScalarFromJSONString(type, json, &actual));
154+
ASSERT_OK_AND_ASSIGN(auto actual, ScalarFromJSONString(type, json));
155155
if (is_valid) {
156156
ASSERT_OK_AND_ASSIGN(expected, MakeScalar(type, value));
157157
} else {
@@ -1471,35 +1471,33 @@ TEST(TestDictArrayFromJSON, Basics) {
14711471

14721472
TEST(TestDictArrayFromJSON, Errors) {
14731473
auto type = dictionary(int32(), utf8());
1474-
std::shared_ptr<Array> array;
14751474

1476-
ASSERT_RAISES(Invalid, DictArrayFromJSONString(type, "[\"not a valid index\"]",
1477-
"[\"\"]", &array));
1478-
ASSERT_RAISES(Invalid, DictArrayFromJSONString(type, "[0, 1]", "[1]",
1479-
&array)); // dict value isn't string
1475+
ASSERT_RAISES(Invalid,
1476+
DictArrayFromJSONString(type, "[\"not a valid index\"]", "[\"\"]"));
1477+
ASSERT_RAISES(Invalid, DictArrayFromJSONString(type, "[0, 1]",
1478+
"[1]")); // dict value isn't string
14801479
}
14811480

14821481
TEST(TestChunkedArrayFromJSON, Basics) {
14831482
auto type = int32();
1484-
std::shared_ptr<ChunkedArray> chunked_array;
1485-
ASSERT_OK(ChunkedArrayFromJSONString(type, {}, &chunked_array));
1483+
ASSERT_OK_AND_ASSIGN(auto chunked_array, ChunkedArrayFromJSONString(type, {}));
14861484
ASSERT_OK(chunked_array->ValidateFull());
14871485
ASSERT_EQ(chunked_array->num_chunks(), 0);
14881486
AssertTypeEqual(type, chunked_array->type());
14891487

1490-
ASSERT_OK(ChunkedArrayFromJSONString(type, {"[1, 2]", "[3, null, 4]"}, &chunked_array));
1491-
ASSERT_OK(chunked_array->ValidateFull());
1492-
ASSERT_EQ(chunked_array->num_chunks(), 2);
1488+
ASSERT_OK_AND_ASSIGN(auto chunked_array_two,
1489+
ChunkedArrayFromJSONString(type, {"[1, 2]", "[3, null, 4]"}));
1490+
ASSERT_OK(chunked_array_two->ValidateFull());
1491+
ASSERT_EQ(chunked_array_two->num_chunks(), 2);
14931492
std::shared_ptr<Array> expected_chunk;
14941493
ASSERT_OK_AND_ASSIGN(expected_chunk, ArrayFromJSONString(type, "[1, 2]"));
1495-
AssertArraysEqual(*expected_chunk, *chunked_array->chunk(0), /*verbose=*/true);
1494+
AssertArraysEqual(*expected_chunk, *chunked_array_two->chunk(0), /*verbose=*/true);
14961495
ASSERT_OK_AND_ASSIGN(expected_chunk, ArrayFromJSONString(type, "[3, null, 4]"));
1497-
AssertArraysEqual(*expected_chunk, *chunked_array->chunk(1), /*verbose=*/true);
1496+
AssertArraysEqual(*expected_chunk, *chunked_array_two->chunk(1), /*verbose=*/true);
14981497
}
14991498

15001499
TEST(TestScalarFromJSON, Basics) {
15011500
// Sanity check for common types (not exhaustive)
1502-
std::shared_ptr<Scalar> scalar;
15031501
AssertJSONScalar<Int64Type>(int64(), "4", true, 4);
15041502
AssertJSONScalar<Int64Type>(int64(), "null", false, 0);
15051503
AssertJSONScalar<StringType, std::shared_ptr<Buffer>>(utf8(), R"("")", true,
@@ -1516,25 +1514,22 @@ TEST(TestScalarFromJSON, Basics) {
15161514
AssertJSONScalar<BooleanType, bool>(boolean(), "1", true, true);
15171515
AssertJSONScalar<DoubleType>(float64(), "1.0", true, 1.0);
15181516
AssertJSONScalar<DoubleType>(float64(), "-0.0", true, -0.0);
1519-
ASSERT_OK(ScalarFromJSONString(float64(), "NaN", &scalar));
1520-
ASSERT_TRUE(std::isnan(checked_cast<DoubleScalar&>(*scalar).value));
1521-
ASSERT_OK(ScalarFromJSONString(float64(), "Inf", &scalar));
1522-
ASSERT_TRUE(std::isinf(checked_cast<DoubleScalar&>(*scalar).value));
1517+
ASSERT_OK_AND_ASSIGN(auto nan_scalar, ScalarFromJSONString(float64(), "NaN"));
1518+
ASSERT_TRUE(std::isnan(checked_cast<DoubleScalar&>(*nan_scalar).value));
1519+
ASSERT_OK_AND_ASSIGN(auto inf_scalar, ScalarFromJSONString(float64(), "Inf"));
1520+
ASSERT_TRUE(std::isinf(checked_cast<DoubleScalar&>(*inf_scalar).value));
15231521
}
15241522

15251523
TEST(TestScalarFromJSON, Errors) {
1526-
std::shared_ptr<Scalar> scalar;
1527-
ASSERT_RAISES(Invalid, ScalarFromJSONString(int64(), "[0]", &scalar));
1528-
ASSERT_RAISES(Invalid, ScalarFromJSONString(int64(), "[9223372036854775808]", &scalar));
1529-
ASSERT_RAISES(Invalid,
1530-
ScalarFromJSONString(int64(), "[-9223372036854775809]", &scalar));
1531-
ASSERT_RAISES(Invalid,
1532-
ScalarFromJSONString(uint64(), "[18446744073709551616]", &scalar));
1533-
ASSERT_RAISES(Invalid, ScalarFromJSONString(uint64(), "[-1]", &scalar));
1534-
ASSERT_RAISES(Invalid, ScalarFromJSONString(binary(), "0", &scalar));
1535-
ASSERT_RAISES(Invalid, ScalarFromJSONString(binary(), "[]", &scalar));
1536-
ASSERT_RAISES(Invalid, ScalarFromJSONString(boolean(), "0.0", &scalar));
1537-
ASSERT_RAISES(Invalid, ScalarFromJSONString(boolean(), "\"true\"", &scalar));
1524+
ASSERT_RAISES(Invalid, ScalarFromJSONString(int64(), "[0]"));
1525+
ASSERT_RAISES(Invalid, ScalarFromJSONString(int64(), "[9223372036854775808]"));
1526+
ASSERT_RAISES(Invalid, ScalarFromJSONString(int64(), "[-9223372036854775809]"));
1527+
ASSERT_RAISES(Invalid, ScalarFromJSONString(uint64(), "[18446744073709551616]"));
1528+
ASSERT_RAISES(Invalid, ScalarFromJSONString(uint64(), "[-1]"));
1529+
ASSERT_RAISES(Invalid, ScalarFromJSONString(binary(), "0"));
1530+
ASSERT_RAISES(Invalid, ScalarFromJSONString(binary(), "[]"));
1531+
ASSERT_RAISES(Invalid, ScalarFromJSONString(boolean(), "0.0"));
1532+
ASSERT_RAISES(Invalid, ScalarFromJSONString(boolean(), "\"true\""));
15381533
}
15391534

15401535
TEST(TestDictScalarFromJSONString, Basics) {
@@ -1553,12 +1548,11 @@ TEST(TestDictScalarFromJSONString, Basics) {
15531548

15541549
TEST(TestDictScalarFromJSONString, Errors) {
15551550
auto type = dictionary(int32(), utf8());
1556-
std::shared_ptr<Scalar> scalar;
15571551

1558-
ASSERT_RAISES(Invalid, DictScalarFromJSONString(type, "\"not a valid index\"", "[\"\"]",
1559-
&scalar));
1560-
ASSERT_RAISES(Invalid, DictScalarFromJSONString(type, "0", "[1]",
1561-
&scalar)); // dict value isn't string
1552+
ASSERT_RAISES(Invalid,
1553+
DictScalarFromJSONString(type, "\"not a valid index\"", "[\"\"]"));
1554+
ASSERT_RAISES(Invalid,
1555+
DictScalarFromJSONString(type, "0", "[1]")); // dict value isn't string
15621556
}
15631557

15641558
} // namespace json

cpp/src/arrow/testing/gtest_util.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,14 @@ std::shared_ptr<Array> ArrayFromJSON(const std::shared_ptr<DataType>& type,
387387
std::shared_ptr<Array> DictArrayFromJSON(const std::shared_ptr<DataType>& type,
388388
std::string_view indices_json,
389389
std::string_view dictionary_json) {
390-
std::shared_ptr<Array> out;
391-
ABORT_NOT_OK(json::DictArrayFromJSONString(type, indices_json, dictionary_json, &out));
390+
EXPECT_OK_AND_ASSIGN(
391+
auto out, json::DictArrayFromJSONString(type, indices_json, dictionary_json));
392392
return out;
393393
}
394394

395395
std::shared_ptr<ChunkedArray> ChunkedArrayFromJSON(const std::shared_ptr<DataType>& type,
396396
const std::vector<std::string>& json) {
397-
std::shared_ptr<ChunkedArray> out;
398-
ABORT_NOT_OK(json::ChunkedArrayFromJSONString(type, json, &out));
397+
EXPECT_OK_AND_ASSIGN(auto out, json::ChunkedArrayFromJSONString(type, json));
399398
return out;
400399
}
401400

@@ -411,16 +410,15 @@ std::shared_ptr<RecordBatch> RecordBatchFromJSON(const std::shared_ptr<Schema>&
411410

412411
std::shared_ptr<Scalar> ScalarFromJSON(const std::shared_ptr<DataType>& type,
413412
std::string_view json) {
414-
std::shared_ptr<Scalar> out;
415-
ABORT_NOT_OK(json::ScalarFromJSONString(type, json, &out));
413+
EXPECT_OK_AND_ASSIGN(auto out, json::ScalarFromJSONString(type, json));
416414
return out;
417415
}
418416

419417
std::shared_ptr<Scalar> DictScalarFromJSON(const std::shared_ptr<DataType>& type,
420418
std::string_view index_json,
421419
std::string_view dictionary_json) {
422-
std::shared_ptr<Scalar> out;
423-
ABORT_NOT_OK(json::DictScalarFromJSONString(type, index_json, dictionary_json, &out));
420+
EXPECT_OK_AND_ASSIGN(auto out,
421+
json::DictScalarFromJSONString(type, index_json, dictionary_json));
424422
return out;
425423
}
426424

python/pyarrow/src/arrow/python/gdb.cc

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,8 @@ void TestSession() {
363363
ExtensionScalar extension_scalar_null{extension_scalar.value, extension_scalar_type,
364364
/*is_valid=*/false};
365365

366-
std::shared_ptr<Scalar> heap_map_scalar;
367-
ARROW_CHECK_OK(ScalarFromJSONString(map(utf8(), int32()), R"([["a", 5], ["b", 6]])",
368-
&heap_map_scalar));
366+
auto heap_map_scalar =
367+
*ScalarFromJSONString(map(utf8(), int32()), R"([["a", 5], ["b", 6]])");
369368
auto heap_map_scalar_null = MakeNullScalar(heap_map_scalar->type);
370369

371370
// Array and ArrayData
@@ -479,13 +478,10 @@ void TestSession() {
479478
key_value_metadata({"key1", "key2", "key3"}, {"value1", "value2", "value3"}));
480479

481480
// Table
482-
ChunkedArrayVector table_columns{2};
483-
ARROW_CHECK_OK(
484-
ChunkedArrayFromJSONString(int32(), {"[1, 2, 3]", "[4, 5]"}, &table_columns[0]));
485-
ARROW_CHECK_OK(ChunkedArrayFromJSONString(
486-
utf8(), {R"(["abc", null])", R"(["def"])", R"(["ghi", "jkl"])"},
487-
&table_columns[1]));
488-
auto table = Table::Make(batch_schema, table_columns);
481+
auto col1 = ChunkedArrayFromJSONString(int32(), {"[1, 2, 3]", "[4, 5]"});
482+
auto col2 = ChunkedArrayFromJSONString(
483+
utf8(), {R"(["abc", null])", R"(["def"])", R"(["ghi", "jkl"])"});
484+
auto table = Table::Make(batch_schema, {*col1, *col2});
489485

490486
// Datum
491487
Datum empty_datum{};

0 commit comments

Comments
 (0)