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 2021/03/27 07:30:35 UTC

[GitHub] [spark] AngersZhuuuu opened a new pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

AngersZhuuuu opened a new pull request #31978:
URL: https://github.com/apache/spark/pull/31978


   
   ### What changes were proposed in this pull request?
   Push ANSI interval binary expressions into into (if / case) branches
   
   ### Why are the changes needed?
   Support more binary expression to push into if/else and casewhen
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   Added UT
   


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41173/
   


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41173/
   


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   **[Test build #136589 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136589/testReport)** for PR 31978 at commit [`246c95d`](https://github.com/apache/spark/commit/246c95d3c2522a42d166877c307f12e2251f3612).


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41169/
   


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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






-- 
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 #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PushFoldableIntoBranchesSuite.scala
##########
@@ -259,6 +261,79 @@ class PushFoldableIntoBranchesSuite
       CaseWhen(Seq((a, FalseLiteral), (c, FalseLiteral)), None))
   }
 
+  test("SPARK-33848: Push down dateTimeExpression with binary expression through If/CaseWhen") {
+    val d = Date.valueOf("2021-01-01")
+    // If
+    assertEquivalent(AddMonths(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01"))))
+    assertEquivalent(DateAdd(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2021-01-02")), Literal(Date.valueOf("2021-01-03"))))
+    assertEquivalent(DateAddInterval(Literal(d),
+      If(a, Literal(new CalendarInterval(1, 1, 0)),
+        Literal(new CalendarInterval(1, 2, 0)))),
+      If(a, Literal(Date.valueOf("2021-02-02")), Literal(Date.valueOf("2021-02-03"))))
+    assertEquivalent(DateAddYMInterval(Literal(d),
+      If(a, Literal.create(Period.ofMonths(1), YearMonthIntervalType),
+        Literal.create(Period.ofMonths(2), YearMonthIntervalType))),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01"))))
+    assertEquivalent(DateDiff(Literal(d),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01")))),
+      If(a, Literal(-31), Literal(-59)))
+    assertEquivalent(DateSub(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2020-12-31")), Literal(Date.valueOf("2020-12-30"))))
+    assertEquivalent(TimestampAddYMInterval(Literal(d.getTime, TimestampType),

Review comment:
       `getTime()` returns milliseconds but `TimestampType` has microsecond resolution. Please, construct correct timestamp expression, here.

##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PushFoldableIntoBranchesSuite.scala
##########
@@ -259,6 +261,79 @@ class PushFoldableIntoBranchesSuite
       CaseWhen(Seq((a, FalseLiteral), (c, FalseLiteral)), None))
   }
 
+  test("SPARK-33848: Push down dateTimeExpression with binary expression through If/CaseWhen") {
+    val d = Date.valueOf("2021-01-01")
+    // If
+    assertEquivalent(AddMonths(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01"))))
+    assertEquivalent(DateAdd(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2021-01-02")), Literal(Date.valueOf("2021-01-03"))))
+    assertEquivalent(DateAddInterval(Literal(d),
+      If(a, Literal(new CalendarInterval(1, 1, 0)),
+        Literal(new CalendarInterval(1, 2, 0)))),
+      If(a, Literal(Date.valueOf("2021-02-02")), Literal(Date.valueOf("2021-02-03"))))
+    assertEquivalent(DateAddYMInterval(Literal(d),
+      If(a, Literal.create(Period.ofMonths(1), YearMonthIntervalType),
+        Literal.create(Period.ofMonths(2), YearMonthIntervalType))),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01"))))
+    assertEquivalent(DateDiff(Literal(d),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01")))),
+      If(a, Literal(-31), Literal(-59)))
+    assertEquivalent(DateSub(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2020-12-31")), Literal(Date.valueOf("2020-12-30"))))
+    assertEquivalent(TimestampAddYMInterval(Literal(d.getTime, TimestampType),
+      If(a, Literal.create(Period.ofMonths(1), YearMonthIntervalType),
+        Literal.create(Period.ofMonths(2), YearMonthIntervalType))),
+      If(a, Literal.create(Timestamp.valueOf("1970-02-19 07:04:48"), TimestampType),

Review comment:
       hmm, the result should be `2021-01-01` + 1 month = `2021-02-01`.




-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   **[Test build #136589 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136589/testReport)** for PR 31978 at commit [`246c95d`](https://github.com/apache/spark/commit/246c95d3c2522a42d166877c307f12e2251f3612).
    * 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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


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


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   **[Test build #136585 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136585/testReport)** for PR 31978 at commit [`e896072`](https://github.com/apache/spark/commit/e89607290756dbf16801bf77372bb3a76e30b814).
    * 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 commented on pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41169/
   


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   **[Test build #136585 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136585/testReport)** for PR 31978 at commit [`e896072`](https://github.com/apache/spark/commit/e89607290756dbf16801bf77372bb3a76e30b814).


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


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


-- 
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] AngersZhuuuu commented on pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on pull request #31978:
URL: https://github.com/apache/spark/pull/31978#issuecomment-808679531


   FYI @MaxGekk @cloud-fan @wangyum 


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


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


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #31978:
URL: https://github.com/apache/spark/pull/31978#issuecomment-808720402


   +1, LGTM. GA passed. Merging to master.
   Thank you @AngersZhuuuu 


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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






-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   **[Test build #136585 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136585/testReport)** for PR 31978 at commit [`e896072`](https://github.com/apache/spark/commit/e89607290756dbf16801bf77372bb3a76e30b814).


-- 
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] AngersZhuuuu commented on a change in pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PushFoldableIntoBranchesSuite.scala
##########
@@ -259,6 +261,79 @@ class PushFoldableIntoBranchesSuite
       CaseWhen(Seq((a, FalseLiteral), (c, FalseLiteral)), None))
   }
 
+  test("SPARK-33848: Push down dateTimeExpression with binary expression through If/CaseWhen") {
+    val d = Date.valueOf("2021-01-01")
+    // If
+    assertEquivalent(AddMonths(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01"))))
+    assertEquivalent(DateAdd(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2021-01-02")), Literal(Date.valueOf("2021-01-03"))))
+    assertEquivalent(DateAddInterval(Literal(d),
+      If(a, Literal(new CalendarInterval(1, 1, 0)),
+        Literal(new CalendarInterval(1, 2, 0)))),
+      If(a, Literal(Date.valueOf("2021-02-02")), Literal(Date.valueOf("2021-02-03"))))
+    assertEquivalent(DateAddYMInterval(Literal(d),
+      If(a, Literal.create(Period.ofMonths(1), YearMonthIntervalType),
+        Literal.create(Period.ofMonths(2), YearMonthIntervalType))),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01"))))
+    assertEquivalent(DateDiff(Literal(d),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01")))),
+      If(a, Literal(-31), Literal(-59)))
+    assertEquivalent(DateSub(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2020-12-31")), Literal(Date.valueOf("2020-12-30"))))
+    assertEquivalent(TimestampAddYMInterval(Literal(d.getTime, TimestampType),
+      If(a, Literal.create(Period.ofMonths(1), YearMonthIntervalType),
+        Literal.create(Period.ofMonths(2), YearMonthIntervalType))),
+      If(a, Literal.create(Timestamp.valueOf("1970-02-19 07:04:48"), TimestampType),

Review comment:
       > hmm, the result should be `2021-01-01` + 1 month = `2021-02-01`.
   
   Fix it

##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/PushFoldableIntoBranchesSuite.scala
##########
@@ -259,6 +261,79 @@ class PushFoldableIntoBranchesSuite
       CaseWhen(Seq((a, FalseLiteral), (c, FalseLiteral)), None))
   }
 
+  test("SPARK-33848: Push down dateTimeExpression with binary expression through If/CaseWhen") {
+    val d = Date.valueOf("2021-01-01")
+    // If
+    assertEquivalent(AddMonths(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01"))))
+    assertEquivalent(DateAdd(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2021-01-02")), Literal(Date.valueOf("2021-01-03"))))
+    assertEquivalent(DateAddInterval(Literal(d),
+      If(a, Literal(new CalendarInterval(1, 1, 0)),
+        Literal(new CalendarInterval(1, 2, 0)))),
+      If(a, Literal(Date.valueOf("2021-02-02")), Literal(Date.valueOf("2021-02-03"))))
+    assertEquivalent(DateAddYMInterval(Literal(d),
+      If(a, Literal.create(Period.ofMonths(1), YearMonthIntervalType),
+        Literal.create(Period.ofMonths(2), YearMonthIntervalType))),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01"))))
+    assertEquivalent(DateDiff(Literal(d),
+      If(a, Literal(Date.valueOf("2021-02-01")), Literal(Date.valueOf("2021-03-01")))),
+      If(a, Literal(-31), Literal(-59)))
+    assertEquivalent(DateSub(Literal(d),
+      If(a, Literal(1), Literal(2))),
+      If(a, Literal(Date.valueOf("2020-12-31")), Literal(Date.valueOf("2020-12-30"))))
+    assertEquivalent(TimestampAddYMInterval(Literal(d.getTime, TimestampType),

Review comment:
       > `getTime()` returns milliseconds but `TimestampType` has microsecond resolution. Please, construct correct timestamp expression, here.
   
   Changed




-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


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


-- 
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 pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

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


   **[Test build #136589 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136589/testReport)** for PR 31978 at commit [`246c95d`](https://github.com/apache/spark/commit/246c95d3c2522a42d166877c307f12e2251f3612).


-- 
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 closed pull request #31978: [SPARK-34841][SQL] Push ANSI interval binary expressions into into (if/else) branches

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #31978:
URL: https://github.com/apache/spark/pull/31978


   


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