You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/04/22 04:13:36 UTC

[GitHub] [spark] xuanyuanking opened a new pull request #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

xuanyuanking opened a new pull request #28288:
URL: https://github.com/apache/spark/pull/28288


   ### What changes were proposed in this pull request?
   Override the canonicalized fields with respect to the result of `needsTimeZone`.
   
   
   ### Why are the changes needed?
   The current approach breaks sematic equal of two cast expressions that don't relate with datetime type. If we don't need to use `timeZone` information casting `from` type to `to` type, then the timeZoneId should not influence the canonicalize result. 
   
   
   ### Does this PR introduce any user-facing change?
   No.
   
   
   ### How was this patch tested?
   New UT added.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617573835


   Merged build finished. Test FAILed.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618184980






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617962988






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618115365


   **[Test build #121641 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121641/testReport)** for PR 28288 at commit [`73f4694`](https://github.com/apache/spark/commit/73f4694e5cee1aa2f256a90b03d1fb09ee5a295d).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618115675






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
maropu commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618187901


   Thanks, all! Merged to master/3.0


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617798737


   **[Test build #121614 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121614/testReport)** for PR 28288 at commit [`95102cc`](https://github.com/apache/spark/commit/95102cc80cbf1d7d1d0c6661d16fa3a56b6f2bfe).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617538573






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #28288:
URL: https://github.com/apache/spark/pull/28288#discussion_r412944568



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Canonicalize.scala
##########
@@ -46,6 +47,15 @@ object Canonicalize {
     case _ => e
   }
 
+  /** Remove TimeZoneId for Cast if needsTimeZone return false. */
+  private[expressions] def ignoreTimeZone(e: Expression): Expression = e match {
+    case a: AnsiCast if !a.needsTimeZone && a.timeZoneId.nonEmpty =>
+      a.copy(timeZoneId = None)
+    case c: Cast if !c.needsTimeZone && c.timeZoneId.nonEmpty =>
+      c.copy(timeZoneId = None)

Review comment:
       `CastBase` is not a case class and can't call `copy`




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617573835






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617962997


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/121629/
   Test FAILed.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618184359


   **[Test build #121641 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121641/testReport)** for PR 28288 at commit [`73f4694`](https://github.com/apache/spark/commit/73f4694e5cee1aa2f256a90b03d1fb09ee5a295d).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617661760


   **[Test build #121614 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121614/testReport)** for PR 28288 at commit [`95102cc`](https://github.com/apache/spark/commit/95102cc80cbf1d7d1d0c6661d16fa3a56b6f2bfe).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617814740


   **[Test build #121629 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121629/testReport)** for PR 28288 at commit [`73f4694`](https://github.com/apache/spark/commit/73f4694e5cee1aa2f256a90b03d1fb09ee5a295d).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618115365


   **[Test build #121641 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121641/testReport)** for PR 28288 at commit [`73f4694`](https://github.com/apache/spark/commit/73f4694e5cee1aa2f256a90b03d1fb09ee5a295d).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617962988


   Merged build finished. Test FAILed.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617661760


   **[Test build #121614 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121614/testReport)** for PR 28288 at commit [`95102cc`](https://github.com/apache/spark/commit/95102cc80cbf1d7d1d0c6661d16fa3a56b6f2bfe).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617684183


   cc @hvanhovell 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617540272


   **[Test build #121605 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121605/testReport)** for PR 28288 at commit [`4961eb3`](https://github.com/apache/spark/commit/4961eb39e282d6b98ca00cc7e4aa49380948ed73).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617810537






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] maropu commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
maropu commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618114183


   retest this please


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617662475






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617538573






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on a change in pull request #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #28288:
URL: https://github.com/apache/spark/pull/28288#discussion_r412928167



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Canonicalize.scala
##########
@@ -46,6 +47,15 @@ object Canonicalize {
     case _ => e
   }
 
+  /** Remove TimeZoneId for Cast if needsTimeZone return false. */
+  private[expressions] def ignoreTimeZone(e: Expression): Expression = e match {
+    case a: AnsiCast if !a.needsTimeZone && a.timeZoneId.nonEmpty =>
+      a.copy(timeZoneId = None)
+    case c: Cast if !c.needsTimeZone && c.timeZoneId.nonEmpty =>
+      c.copy(timeZoneId = None)

Review comment:
       ```scala
   case c: CastBase if c.timeZoneId.nonEmpty && !c.needsTimeZone =>
         c.copy(timeZoneId = None)
   ```
   No need to call `needsTimeZone` twice.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617800107






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] xuanyuanking commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
xuanyuanking commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618223616


   Thanks for the review!


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617573595


   **[Test build #121605 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121605/testReport)** for PR 28288 at commit [`4961eb3`](https://github.com/apache/spark/commit/4961eb39e282d6b98ca00cc7e4aa49380948ed73).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617960878


   **[Test build #121629 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121629/testReport)** for PR 28288 at commit [`73f4694`](https://github.com/apache/spark/commit/73f4694e5cee1aa2f256a90b03d1fb09ee5a295d).
    * This patch **fails Spark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on a change in pull request #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #28288:
URL: https://github.com/apache/spark/pull/28288#discussion_r412964845



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Canonicalize.scala
##########
@@ -46,6 +47,15 @@ object Canonicalize {
     case _ => e
   }
 
+  /** Remove TimeZoneId for Cast if needsTimeZone return false. */
+  private[expressions] def ignoreTimeZone(e: Expression): Expression = e match {
+    case a: AnsiCast if !a.needsTimeZone && a.timeZoneId.nonEmpty =>
+      a.copy(timeZoneId = None)
+    case c: Cast if !c.needsTimeZone && c.timeZoneId.nonEmpty =>
+      c.copy(timeZoneId = None)

Review comment:
       hmm, ok:
   ```scala
       case c: CastBase if c.timeZoneId.nonEmpty && !c.needsTimeZone => c.withTimeZone(null)
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617540272


   **[Test build #121605 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121605/testReport)** for PR 28288 at commit [`4961eb3`](https://github.com/apache/spark/commit/4961eb39e282d6b98ca00cc7e4aa49380948ed73).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618184980






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617810537






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617800107






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617573841


   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/121605/
   Test FAILed.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] xuanyuanking commented on a change in pull request #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
xuanyuanking commented on a change in pull request #28288:
URL: https://github.com/apache/spark/pull/28288#discussion_r413027198



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Canonicalize.scala
##########
@@ -46,6 +47,15 @@ object Canonicalize {
     case _ => e
   }
 
+  /** Remove TimeZoneId for Cast if needsTimeZone return false. */
+  private[expressions] def ignoreTimeZone(e: Expression): Expression = e match {
+    case a: AnsiCast if !a.needsTimeZone && a.timeZoneId.nonEmpty =>
+      a.copy(timeZoneId = None)
+    case c: Cast if !c.needsTimeZone && c.timeZoneId.nonEmpty =>
+      c.copy(timeZoneId = None)

Review comment:
       Thanks, done in 73f4694.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617662475






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-617814740


   **[Test build #121629 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121629/testReport)** for PR 28288 at commit [`73f4694`](https://github.com/apache/spark/commit/73f4694e5cee1aa2f256a90b03d1fb09ee5a295d).


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #28288: [SPARK-31515][SQL] Canonicalize Cast should consider the value of needTimeZone

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28288:
URL: https://github.com/apache/spark/pull/28288#issuecomment-618115675






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org