vinodkc commented on code in PR #53370:
URL: https://github.com/apache/spark/pull/53370#discussion_r2604590028
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/timeExpressions.scala:
##########
@@ -753,43 +825,33 @@ case class TimeTrunc(unit: Expression, time: Expression)
}
abstract class IntegralToTimeBase
- extends UnaryExpression with ExpectsInputTypes with CodegenFallback {
+ extends UnaryExpression with ExpectsInputTypes with
TimeConversionErrorHandling {
protected def upScaleFactor: Long
+ def failOnError: Boolean = SQLConf.get.ansiEnabled
Review Comment:
Done
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/timeExpressions.scala:
##########
@@ -1029,7 +1085,14 @@ case class TimeToMillis(child: Expression)
case class TimeToMicros(child: Expression)
extends TimeToLongBase {
- override def scaleFactor: Long = NANOS_PER_MICROS
+ override def nullSafeEval(input: Any): Any = {
+ DateTimeUtils.timeToMicros(input.asInstanceOf[Number].longValue())
+ }
+
+ override protected def doGenCode(ctx: CodegenContext, ev: ExprCode):
ExprCode = {
Review Comment:
Yes, done
--
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]