Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/19883#discussion_r155222959
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
---
@@ -444,11 +444,11 @@ case class DayOfWeek(child: Expression) extends
UnaryExpression with ImplicitCas
val cal = classOf[Calendar].getName
val c = ctx.freshName("cal")
val dtu = DateTimeUtils.getClass.getName.stripSuffix("$")
- ctx.addMutableState(cal, c, s"""$c =
$cal.getInstance($dtu.getTimeZone("UTC"));""")
--- End diff --
yea it's done for each expression, but each expression is evaluated many
times.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]