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

Function MakeBatchWithDictionaries

cpp/src/arrow/ipc/read_write_test.cc:3282–3295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3280 });
3281
3282Result<std::shared_ptr<RecordBatch>> MakeBatchWithDictionaries(const int length) {
3283 auto dict_type = dictionary(int32(), int32());
3284 auto schema_ = ::arrow::schema(
3285 {::arrow::field("i32", int32()), ::arrow::field("i32d", dict_type)});
3286 std::shared_ptr<Array> i32, i32d_values, i32d_indices;
3287 RETURN_NOT_OK(MakeRandomInt32Array(length, false, arrow::default_memory_pool(), &i32));
3288 RETURN_NOT_OK(
3289 MakeRandomInt32Array(length, false, arrow::default_memory_pool(), &i32d_values));
3290 RETURN_NOT_OK(MakeRandomInt32Array(length, false, arrow::default_memory_pool(),
3291 &i32d_indices, 0, 0, length));
3292 std::shared_ptr<Array> i32d =
3293 std::make_shared<DictionaryArray>(dict_type, i32d_indices, i32d_values);
3294 return RecordBatch::Make(std::move(schema_), length, {i32, i32d});
3295}
3296
3297Result<std::shared_ptr<io::RandomAccessFile>> MakeFileWithDictionaries(
3298 const std::unique_ptr<TemporaryDir>& tempdir, int rows_per_batch, int num_batches) {

Callers

nothing calls this directly

Calls 6

MakeRandomInt32ArrayFunction · 0.85
default_memory_poolFunction · 0.85
schemaFunction · 0.70
dictionaryFunction · 0.50
fieldFunction · 0.50
MakeFunction · 0.50

Tested by

no test coverage detected