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

Function MakeDoubleTable

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

Source from the content-addressed store, hash-verified

2400}
2401
2402void MakeDoubleTable(int num_columns, int num_rows, int nchunks,
2403 std::shared_ptr<Table>* out) {
2404 std::vector<std::shared_ptr<::arrow::ChunkedArray>> columns(num_columns);
2405 std::vector<std::shared_ptr<::arrow::Field>> fields(num_columns);
2406
2407 for (int i = 0; i < num_columns; ++i) {
2408 std::vector<std::shared_ptr<Array>> arrays;
2409 std::shared_ptr<Array> values;
2410 ASSERT_OK(NullableArray<::arrow::DoubleType>(num_rows, num_rows / 10,
2411 static_cast<uint32_t>(i), &values));
2412 std::stringstream ss;
2413 ss << "col" << i;
2414
2415 for (int j = 0; j < nchunks; ++j) {
2416 arrays.push_back(values);
2417 }
2418 columns[i] = std::make_shared<ChunkedArray>(arrays);
2419 fields[i] = ::arrow::field(ss.str(), values->type());
2420 }
2421 auto schema = std::make_shared<::arrow::Schema>(fields);
2422 *out = Table::Make(schema, columns, num_rows);
2423}
2424
2425void MakeSimpleListArray(int num_rows, int max_value_length, const std::string& item_name,
2426 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