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

Method Quarter

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

Source from the content-addressed store, hash-verified

206}
207
208IntVal TimestampFunctions::Quarter(FunctionContext* context, const TimestampVal& ts_val) {
209 if (ts_val.is_null) return IntVal::null();
210 const TimestampValue& ts_value = TimestampValue::FromTimestampVal(ts_val);
211 if (!ts_value.HasDate()) return IntVal::null();
212 int m = ts_value.date().month();
213 return IntVal((m - 1) / 3 + 1);
214}
215
216IntVal TimestampFunctions::DayOfWeek(FunctionContext* context,
217 const TimestampVal& ts_val) {

Callers

nothing calls this directly

Calls 3

IntValClass · 0.85
HasDateMethod · 0.80
monthMethod · 0.80

Tested by

no test coverage detected