Github user ueshin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16308#discussion_r92962120
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala
 ---
    @@ -41,13 +43,16 @@ object ReplaceExpressions extends Rule[LogicalPlan] {
      */
     object ComputeCurrentTime extends Rule[LogicalPlan] {
       def apply(plan: LogicalPlan): LogicalPlan = {
    -    val dateExpr = CurrentDate()
    +    val currentDates = mutable.Map.empty[String, Literal]
         val timeExpr = CurrentTimestamp()
    -    val currentDate = Literal.create(dateExpr.eval(EmptyRow), 
dateExpr.dataType)
         val currentTime = Literal.create(timeExpr.eval(EmptyRow), 
timeExpr.dataType)
     
         plan transformAllExpressions {
    -      case CurrentDate() => currentDate
    +      case CurrentDate(tz) =>
    +        currentDates.getOrElseUpdate(tz, {
    +          val dateExpr = CurrentDate(tz)
    +          Literal.create(dateExpr.eval(EmptyRow), dateExpr.dataType)
    --- End diff --
    
    Good catch, I'll modify this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to