YutaLin opened a new issue, #4983: URL: https://github.com/apache/datafusion-comet/issues/4983
### What is the problem the feature request solves? What is the problem the feature request solves? This is https://github.com/apache/datafusion-comet/issues/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: - hours = nanos / NANOS_PER_HOUR - minutes = (nanos % NANOS_PER_HOUR) / NANOS_PER_MINUTE - seconds = (nanos % NANOS_PER_MINUTE) / NANOS_PER_SECOND ### Additional context _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
