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

Function MakeDoubleTable

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

Source from the content-addressed store, hash-verified

2363}
2364
2365void MakeDoubleTable(int num_columns, int num_rows, int nchunks,
2366 std::shared_ptr<Table>* out) {
2367 std::vector<std::shared_ptr<::arrow::ChunkedArray>> columns(num_columns);
2368 std::vector<std::shared_ptr<::arrow::Field>> fields(num_columns);
2369
2370 for (int i = 0; i < num_columns; ++i) {
2371 std::vector<std::shared_ptr<Array>> arrays;
2372 std::shared_ptr<Array> values;
2373 ASSERT_OK(NullableArray<::arrow::DoubleType>(num_rows, num_rows / 10,
2374 static_cast<uint32_t>(i), &values));
2375 std::stringstream ss;
2376 ss << "col" << i;
2377
2378 for (int j = 0; j < nchunks; ++j) {
2379 arrays.push_back(values);
2380 }
2381 columns[i] = std::make_shared<ChunkedArray>(arrays);
2382 fields[i] = ::arrow::field(ss.str(), values->type());
2383 }
2384 auto schema = std::make_shared<::arrow::Schema>(fields);
2385 *out = Table::Make(schema, columns, num_rows);
2386}
2387
2388void MakeSimpleListArray(int num_rows, int max_value_length, const std::string& item_name,
2389 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