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

Function MakeDoubleTable

cpp/src/parquet/arrow/arrow_reader_writer_test.cc:2538–2559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2536}
2537
2538void MakeDoubleTable(int num_columns, int num_rows, int nchunks,
2539 std::shared_ptr<Table>* out) {
2540 std::vector<std::shared_ptr<::arrow::ChunkedArray>> columns(num_columns);
2541 std::vector<std::shared_ptr<::arrow::Field>> fields(num_columns);
2542
2543 for (int i = 0; i < num_columns; ++i) {
2544 std::vector<std::shared_ptr<Array>> arrays;
2545 std::shared_ptr<Array> values;
2546 ASSERT_OK(NullableArray<::arrow::DoubleType>(num_rows, num_rows / 10,
2547 static_cast<uint32_t>(i), &values));
2548 std::stringstream ss;
2549 ss << "col" << i;
2550
2551 for (int j = 0; j < nchunks; ++j) {
2552 arrays.push_back(values);
2553 }
2554 columns[i] = std::make_shared<ChunkedArray>(arrays);
2555 fields[i] = ::arrow::field(ss.str(), values->type());
2556 }
2557 auto schema = std::make_shared<::arrow::Schema>(fields);
2558 *out = Table::Make(schema, columns, num_rows);
2559}
2560
2561void MakeSimpleListArray(int num_rows, int max_value_length, const std::string& item_name,
2562 std::shared_ptr<DataType>* out_type,

Callers 2

TESTFunction · 0.85
TestGetRecordBatchReaderFunction · 0.85

Calls 5

push_backMethod · 0.80
strMethod · 0.80
fieldFunction · 0.70
MakeFunction · 0.50
typeMethod · 0.45

Tested by

no test coverage detected