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

Function MakeBatchWithDictionaries

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

Source from the content-addressed store, hash-verified

3284 });
3285
3286Result<std::shared_ptr<RecordBatch>> MakeBatchWithDictionaries(const int length) {
3287 auto dict_type = dictionary(int32(), int32());
3288 auto schema_ = ::arrow::schema(
3289 {::arrow::field("i32", int32()), ::arrow::field("i32d", dict_type)});
3290 std::shared_ptr<Array> i32, i32d_values, i32d_indices;
3291 RETURN_NOT_OK(MakeRandomInt32Array(length, false, arrow::default_memory_pool(), &i32));
3292 RETURN_NOT_OK(
3293 MakeRandomInt32Array(length, false, arrow::default_memory_pool(), &i32d_values));
3294 RETURN_NOT_OK(MakeRandomInt32Array(length, false, arrow::default_memory_pool(),
3295 &i32d_indices, 0, 0, length));
3296 std::shared_ptr<Array> i32d =
3297 std::make_shared<DictionaryArray>(dict_type, i32d_indices, i32d_values);
3298 return RecordBatch::Make(std::move(schema_), length, {i32, i32d});
3299}
3300
3301Result<std::shared_ptr<io::RandomAccessFile>> MakeFileWithDictionaries(
3302 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