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

Method DayOfWeek

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

Source from the content-addressed store, hash-verified

214}
215
216IntVal TimestampFunctions::DayOfWeek(FunctionContext* context,
217 const TimestampVal& ts_val) {
218 if (ts_val.is_null) return IntVal::null();
219 const TimestampValue& ts_value = TimestampValue::FromTimestampVal(ts_val);
220 if (!ts_value.HasDate()) return IntVal::null();
221 // Sql has the result in [1,7] where 1 = Sunday. Boost has 0 = Sunday.
222 return IntVal(ts_value.date().day_of_week() + 1);
223}
224
225IntVal TimestampFunctions::DayOfMonth(FunctionContext* context,
226 const TimestampVal& ts_val) {

Callers

nothing calls this directly

Calls 2

IntValClass · 0.85
HasDateMethod · 0.80

Tested by

no test coverage detected