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

Method Unix

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

Source from the content-addressed store, hash-verified

96}
97
98BigIntVal TimestampFunctions::Unix(FunctionContext* context, const StringVal& string_val,
99 const StringVal& fmt) {
100 const TimestampVal& tv_val = ToTimestamp(context, string_val, fmt);
101 if (tv_val.is_null) return BigIntVal::null();
102 const TimestampValue& tv = TimestampValue::FromTimestampVal(tv_val);
103 const Timezone* tz = context->impl()->state()->time_zone_for_unix_time_conversions();
104 time_t result;
105 return (tv.ToUnixTime(tz, &result)) ? BigIntVal(result) : BigIntVal::null();
106}
107
108BigIntVal TimestampFunctions::Unix(FunctionContext* context, const TimestampVal& ts_val) {
109 if (ts_val.is_null) return BigIntVal::null();

Callers

nothing calls this directly

Calls 6

BigIntValClass · 0.85
implMethod · 0.80
ToUnixTimeMethod · 0.80
nowMethod · 0.80
stateMethod · 0.45

Tested by

no test coverage detected