| 2536 | } |
| 2537 | |
| 2538 | void 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 | |
| 2561 | void MakeSimpleListArray(int num_rows, int max_value_length, const std::string& item_name, |
| 2562 | std::shared_ptr<DataType>* out_type, |