MCPcopy Create free account
hub / github.com/apache/impala / LastDay

Method LastDay

be/src/exprs/timestamp-functions-ir.cc:628–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628TimestampVal TimestampFunctions::LastDay(FunctionContext* context,
629 const TimestampVal& ts) {
630 if (ts.is_null) return TimestampVal::null();
631 const TimestampValue& timestamp = TimestampValue::FromTimestampVal(ts);
632 if (!timestamp.HasDate()) return TimestampVal::null();
633 TimestampValue tsv(timestamp.date().end_of_month(), time_duration(0,0,0,0));
634 TimestampVal rt_date;
635 tsv.ToTimestampVal(&rt_date);
636 return rt_date;
637}
638
639IntVal TimestampFunctions::IntMonthsBetween(FunctionContext* context,
640 const TimestampVal& ts1, const TimestampVal& ts2) {

Callers

nothing calls this directly

Calls 3

time_durationClass · 0.85
HasDateMethod · 0.80
ToTimestampValMethod · 0.80

Tested by

no test coverage detected