| 1013 | } |
| 1014 | |
| 1015 | Status MakeTimes(std::shared_ptr<RecordBatch>* out) { |
| 1016 | std::vector<bool> is_valid = {true, true, true, false, true, true, true}; |
| 1017 | auto f0 = field("f0", time32(TimeUnit::MILLI)); |
| 1018 | auto f1 = field("f1", time64(TimeUnit::NANO)); |
| 1019 | auto f2 = field("f2", time32(TimeUnit::SECOND)); |
| 1020 | auto f3 = field("f3", time64(TimeUnit::NANO)); |
| 1021 | auto schema = ::arrow::schema({f0, f1, f2, f3}); |
| 1022 | |
| 1023 | std::vector<int32_t> t32_values = {14896, 14897, 14892, 1489272000, 14893, 14895}; |
| 1024 | std::vector<int64_t> t64_values = {1489269000000, 1489270000000, 1489271000000, |
| 1025 | 1489272000000, 1489272000000, 1489273000000}; |
| 1026 | |
| 1027 | std::shared_ptr<Array> a0, a1, a2, a3; |
| 1028 | ArrayFromVector<Time32Type, int32_t>(f0->type(), is_valid, t32_values, &a0); |
| 1029 | ArrayFromVector<Time64Type, int64_t>(f1->type(), is_valid, t64_values, &a1); |
| 1030 | ArrayFromVector<Time32Type, int32_t>(f2->type(), is_valid, t32_values, &a2); |
| 1031 | ArrayFromVector<Time64Type, int64_t>(f3->type(), is_valid, t64_values, &a3); |
| 1032 | |
| 1033 | *out = RecordBatch::Make(schema, a0->length(), {a0, a1, a2, a3}); |
| 1034 | return Status::OK(); |
| 1035 | } |
| 1036 | |
| 1037 | template <typename BuilderType, typename T> |
| 1038 | static void AppendValues(const std::vector<bool>& is_valid, const std::vector<T>& values, |