cloud-fan commented on a change in pull request #33665:
URL: https://github.com/apache/spark/pull/33665#discussion_r687422062



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -2617,30 +2628,41 @@ case class MakeTimestamp(
       day.asInstanceOf[Int],
       hour.asInstanceOf[Int],
       min.asInstanceOf[Int],
-      sec.asInstanceOf[Decimal],
+      toDecimal(sec),
       zid)
   }
 
   override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
     val dtu = DateTimeUtils.getClass.getName.stripSuffix("$")
     val zid = ctx.addReferenceObj("zoneId", zoneId, classOf[ZoneId].getName)
     val d = Decimal.getClass.getName.stripSuffix("$")
+    val decimalValue = ctx.freshName("decimalValue")
     val failOnErrorBranch = if (failOnError) "throw e;" else s"${ev.isNull} = 
true;"
     nullSafeCodeGen(ctx, ev, (year, month, day, hour, min, secAndNanos, 
timezone) => {
       val zoneId = timezone.map(tz => 
s"$dtu.getZoneId(${tz}.toString())").getOrElse(zid)
       val toMicrosCode = if (dataType == TimestampType) {
         s"""
            |java.time.Instant instant = ldt.atZone($zoneId).toInstant();
            |${ev.value} = $dtu.instantToMicros(instant);
-           |""".stripMargin

Review comment:
       unnecessary change. Actually the previous code style is auto-generated 
by IDEA.




-- 
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]

Reply via email to