| 946 | } |
| 947 | |
| 948 | Status MakeDates(std::shared_ptr<RecordBatch>* out) { |
| 949 | std::vector<bool> is_valid = {true, true, true, false, true, true, true}; |
| 950 | auto f0 = field("f0", date32()); |
| 951 | auto f1 = field("f1", date64()); |
| 952 | auto schema = ::arrow::schema({f0, f1}); |
| 953 | |
| 954 | std::vector<int32_t> date32_values = {0, 1, 2, 3, 4, 5, 6}; |
| 955 | std::shared_ptr<Array> date32_array; |
| 956 | ArrayFromVector<Date32Type, int32_t>(is_valid, date32_values, &date32_array); |
| 957 | |
| 958 | std::vector<int64_t> date64_values = {86400000, 172800000, 259200000, 1489272000000, |
| 959 | 345600000, 432000000, 518400000}; |
| 960 | std::shared_ptr<Array> date64_array; |
| 961 | ArrayFromVector<Date64Type, int64_t>(is_valid, date64_values, &date64_array); |
| 962 | |
| 963 | *out = RecordBatch::Make(schema, date32_array->length(), {date32_array, date64_array}); |
| 964 | return Status::OK(); |
| 965 | } |
| 966 | |
| 967 | Status MakeTimestamps(std::shared_ptr<RecordBatch>* out) { |
| 968 | std::vector<bool> is_valid = {true, true, true, false, true, true, true}; |