MCPcopy Create free account
hub / github.com/apache/arrow / MakeTimestamps

Function MakeTimestamps

cpp/src/arrow/ipc/test_common.cc:967–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

965}
966
967Status MakeTimestamps(std::shared_ptr<RecordBatch>* out) {
968 std::vector<bool> is_valid = {true, true, true, false, true, true, true};
969 auto f0 = field("f0", timestamp(TimeUnit::MILLI));
970 auto f1 = field("f1", timestamp(TimeUnit::NANO, "America/New_York"));
971 auto f2 = field("f2", timestamp(TimeUnit::SECOND));
972 auto schema = ::arrow::schema({f0, f1, f2});
973
974 std::vector<int64_t> ts_values = {1489269000000, 1489270000000, 1489271000000,
975 1489272000000, 1489272000000, 1489273000000};
976
977 std::shared_ptr<Array> a0, a1, a2;
978 ArrayFromVector<TimestampType, int64_t>(f0->type(), is_valid, ts_values, &a0);
979 ArrayFromVector<TimestampType, int64_t>(f1->type(), is_valid, ts_values, &a1);
980 ArrayFromVector<TimestampType, int64_t>(f2->type(), is_valid, ts_values, &a2);
981
982 *out = RecordBatch::Make(schema, a0->length(), {a0, a1, a2});
983 return Status::OK();
984}
985
986Status MakeIntervals(std::shared_ptr<RecordBatch>* out) {
987 std::vector<bool> is_valid = {true, true, true, false, true, true, true};

Callers 1

BatchesFunction · 0.85

Calls 7

schemaFunction · 0.70
fieldFunction · 0.50
timestampFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50
typeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected