This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 2160dc5  [SPARK-33015][SQL][FOLLOWUP][3.0] Use millisToDays() in the 
ComputeCurrentTime rule
2160dc5 is described below

commit 2160dc52163f017bc164ad18ca6ebe6868070402
Author: Max Gekk <max.g...@gmail.com>
AuthorDate: Tue Sep 29 19:34:43 2020 +0900

    [SPARK-33015][SQL][FOLLOWUP][3.0] Use millisToDays() in the 
ComputeCurrentTime rule
    
    ### What changes were proposed in this pull request?
    Use `millisToDays()` instead of `microsToDays()` because the former one is 
not available in `branch-3.0`.
    
    ### Why are the changes needed?
    To fix the build failure:
    ```
    [ERROR] [Error] 
/home/jenkins/workspace/spark-branch-3.0-maven-snapshots/spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala:85:
 value microsToDays is not a member of object 
org.apache.spark.sql.catalyst.util.DateTimeUtils
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    By running `./build/sbt clean package` and `ComputeCurrentTimeSuite`.
    
    Closes #29901 from MaxGekk/fix-current_date-3.0.
    
    Authored-by: Max Gekk <max.g...@gmail.com>
    Signed-off-by: HyukjinKwon <gurwls...@apache.org>
---
 .../scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala
index 09e0118..ba7e852 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/finishAnalysis.scala
@@ -82,7 +82,7 @@ object ComputeCurrentTime extends Rule[LogicalPlan] {
       case currentDate @ CurrentDate(Some(timeZoneId)) =>
         currentDates.getOrElseUpdate(timeZoneId, {
           Literal.create(
-            DateTimeUtils.microsToDays(timestamp, currentDate.zoneId),
+            DateTimeUtils.millisToDays(DateTimeUtils.toMillis(timestamp), 
currentDate.zoneId),
             DateType)
         })
       case CurrentTimestamp() | Now() => currentTime


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to