| 2400 | } |
| 2401 | |
| 2402 | void 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 | |
| 2425 | void MakeSimpleListArray(int num_rows, int max_value_length, const std::string& item_name, |
| 2426 | std::shared_ptr<DataType>* out_type, |