You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement TimeType support - Time extraction (from TimeType to Int/Decimal) #4983
What is the problem the feature request solves?
This is #4288 sub-issue
These are the dedicated TimeType expressions from timeExpressions.scala. All are
RuntimeReplaceable and resolve to StaticInvoke(DateTimeUtils, methodName, ...).
They follow the same shim pattern as make_time.
Describe the potential solution
time extraction (from TimeType to Int/Decimal)
SQL
Spark expression
StaticInvoke method
Return type
extract(HOUR FROM t)
HoursOfTime
getHoursOfTime
IntegerType
extract(MINUTE FROM t)
MinutesOfTime
getMinutesOfTime
IntegerType
extract(SECOND FROM t)
SecondsOfTime
getSecondsOfTime
IntegerType
extract(SECOND FROM t) (with fraction)
SecondsOfTimeWithFraction
getSecondsOfTimeWithFraction
DecimalType
Shim pattern: Match StaticInvoke where staticObject == classOf[DateTimeUtils.type]
and functionName is one of the above.
Rust implementation: Simple arithmetic on nanoseconds since midnight:
Activity
YutaLin commentedon Jul 20, 2026
take