| 1455 | } // namespace random |
| 1456 | |
| 1457 | void rand_day_millis(int64_t N, std::vector<DayTimeIntervalType::DayMilliseconds>* out) { |
| 1458 | const int random_seed = 0; |
| 1459 | arrow::random::pcg32 gen(random_seed); |
| 1460 | std::uniform_int_distribution<int32_t> d(std::numeric_limits<int32_t>::min(), |
| 1461 | std::numeric_limits<int32_t>::max()); |
| 1462 | out->resize(N, {}); |
| 1463 | std::generate(out->begin(), out->end(), [&d, &gen] { |
| 1464 | DayTimeIntervalType::DayMilliseconds tmp; |
| 1465 | tmp.days = d(gen); |
| 1466 | tmp.milliseconds = d(gen); |
| 1467 | return tmp; |
| 1468 | }); |
| 1469 | } |
| 1470 | |
| 1471 | void rand_month_day_nanos(int64_t N, |
| 1472 | std::vector<MonthDayNanoIntervalType::MonthDayNanos>* out) { |