Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei1949 committed Apr 19, 2024
1 parent c3aedf2 commit bf84fd5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions flex/engines/hqps_db/core/null_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ struct NullRecordCreator<TimeStamp> {
}
};

template <>
struct NullRecordCreator<Date> {
static inline Date GetNull() {
Date date;
date.from_u32(std::numeric_limits<int32_t>::max());
return date;
}
};

template <>
struct NullRecordCreator<Any> {
static inline Any GetNull() { return Any(); }
Expand Down
6 changes: 6 additions & 0 deletions flex/engines/hqps_db/core/operator/sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ void template_set_value(common::Value* value, gs::TimeStamp v) {
value->set_i64(v.milli_second);
}

template <typename T, typename std::enable_if<
(std::is_same_v<T, gs::Date>)>::type* = nullptr>
void template_set_value(common::Value* value, gs::Date v) {
value->set_i64(v.to_timestamp());
}

template <size_t Is = 0, typename... T>
void template_set_tuple_value_impl(results::Collection* collection,
const std::tuple<T...>& t) {
Expand Down
6 changes: 6 additions & 0 deletions flex/engines/hqps_db/core/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ struct DateTimeExtractor<Interval::YEAR> {
gmtime_r((time_t*) (&micro_second), &tm);
return tm.tm_year + 1900;
}

static int32_t extract(const Date& date) { return date.year(); }
};

template <>
Expand All @@ -405,6 +407,8 @@ struct DateTimeExtractor<Interval::MONTH> {
gmtime_r((time_t*) (&micro_second), &tm);
return tm.tm_mon + 1;
}

static int32_t extract(const Date& date) { return date.month(); }
};

template <>
Expand All @@ -415,6 +419,8 @@ struct DateTimeExtractor<Interval::DAY> {
gmtime_r((time_t*) (&micro_second), &tm);
return tm.tm_mday;
}

static int32_t extract(const Date& date) { return date.day(); }
};

template <>
Expand Down

0 comments on commit bf84fd5

Please sign in to comment.