MCPcopy Create free account
hub / github.com/apache/arrow / MakeMapBatch

Function MakeMapBatch

cpp/src/arrow/ipc/generate_fuzz_corpus.cc:53–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53Result<std::shared_ptr<RecordBatch>> MakeMapBatch() {
54 std::shared_ptr<Array> array;
55 const char* json_input = R"(
56[
57 [[0, 1], [1, 1], [2, 2], [3, 3], [4, 5], [5, 8]],
58 null,
59 [[0, null], [1, null], [2, 0], [3, 1], [4, null], [5, 2]],
60 []
61 ]
62)";
63 ARROW_ASSIGN_OR_RAISE(array, ArrayFromJSONString(map(int16(), int32()), json_input));
64 auto schema = ::arrow::schema({field("f0", array->type())});
65 return RecordBatch::Make(schema, array->length(), {array});
66}
67
68Result<std::vector<std::shared_ptr<RecordBatch>>> Batches() {
69 std::vector<std::shared_ptr<RecordBatch>> batches;

Callers 1

BatchesFunction · 0.85

Calls 8

ArrayFromJSONStringFunction · 0.85
mapFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
schemaFunction · 0.70
fieldFunction · 0.50
MakeFunction · 0.50
typeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected