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

Function MakeMapOfDictionary

cpp/src/arrow/ipc/test_common.cc:930–946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

928}
929
930Status MakeMapOfDictionary(std::shared_ptr<RecordBatch>* out) {
931 // Exercises ARROW-9660
932 constexpr int64_t kNumRows = 3;
933 std::shared_ptr<Array> a0, a1;
934
935 auto key_array = DictArrayFromJSON(dictionary(int32(), utf8()), "[0, 1, 0, 2, 0, 3]",
936 R"(["k1", "k2", "k3", "k4"])");
937 auto item_array = ArrayFromJSON(int16(), "[0, -1, 2, -3, 4, null]");
938 RETURN_NOT_OK(MakeRandomMapArray(key_array, item_array, kNumRows,
939 /*include_nulls=*/false, default_memory_pool(), &a0));
940 RETURN_NOT_OK(MakeRandomMapArray(key_array, item_array, kNumRows,
941 /*include_nulls=*/true, default_memory_pool(), &a1));
942 auto f0 = field("f0", a0->type());
943 auto f1 = field("f1", a1->type());
944 *out = RecordBatch::Make(::arrow::schema({f0, f1}), kNumRows, {a0, a1});
945 return Status::OK();
946}
947
948Status MakeDates(std::shared_ptr<RecordBatch>* out) {
949 std::vector<bool> is_valid = {true, true, true, false, true, true, true};

Callers

nothing calls this directly

Calls 10

DictArrayFromJSONFunction · 0.85
ArrayFromJSONFunction · 0.85
MakeRandomMapArrayFunction · 0.85
default_memory_poolFunction · 0.85
schemaFunction · 0.70
dictionaryFunction · 0.50
fieldFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50
typeMethod · 0.45

Tested by

no test coverage detected