| 2363 | } |
| 2364 | |
| 2365 | void 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 | |
| 2388 | void MakeSimpleListArray(int num_rows, int max_value_length, const std::string& item_name, |
| 2389 | std::shared_ptr<DataType>* out_type, |