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/02/21 18:23:32 UTC

[GitHub] [spark] yaooqinn opened a new pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

yaooqinn opened a new pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672
 
 
   
   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   The current behavior of interval multiply and divide follows the ANSI SQL standard when overflow, it is compatible with other operations when `spark.sql.ansi.enabled` is true, but not compatible when `spark.sql.ansi.enabled` is false.
   
   When `spark.sql.ansi.enabled` is false, as the factor is a double value, so it should use java's rounding or truncation behavior for casting double to integrals. when divided by zero, it returns `null`.  we also follow the natural rules for intervals as defined in the Gregorian calendar, so we do not add the month fraction to days but add days fraction to microseconds.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   Make interval multiply and divide's overflow behavior consistent with other interval operations
   
   
   ### Does this PR introduce any user-facing change?
   <!--
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If no, write 'No'.
   -->
   
   no, these are new features in 3.0
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   add uts

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590889363
 
 
   feel free to address https://github.com/apache/spark/pull/27672#discussion_r383719562 in your next PR :)

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589938454
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590876697
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590339078
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589775814
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590552311
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590422448
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

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


[GitHub] [spark] yaooqinn commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383154105
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
 ##########
 @@ -404,22 +404,44 @@ object IntervalUtils {
   }
 
   /**
-   * Makes an interval from months, days and micros with the fractional part by
-   * adding the month fraction to days and the days fraction to micros.
-   *
-   * @throws ArithmeticException if the result overflows any field value
+   * Makes an interval from months, days and micros with the fractional part.
+   * The overflow style here follows the way of ansi sql standard and the natural rules for
+   * intervals as defined in the Gregorian calendar. Thus, the days fraction will be added
+   * to microseconds but the months fraction will not be added to days, and it will throw
+   * exception if any part overflows.
    */
   private def fromDoubles(
       monthsWithFraction: Double,
       daysWithFraction: Double,
       microsWithFraction: Double): CalendarInterval = {
     val truncatedMonths = Math.toIntExact(monthsWithFraction.toLong)
-    val days = daysWithFraction + DAYS_PER_MONTH * (monthsWithFraction - truncatedMonths)
-    val truncatedDays = Math.toIntExact(days.toLong)
-    val micros = microsWithFraction + MICROS_PER_DAY * (days - truncatedDays)
+    val truncatedDays = Math.toIntExact(daysWithFraction.toLong)
+    val micros = microsWithFraction + MICROS_PER_DAY * (daysWithFraction - truncatedDays)
     new CalendarInterval(truncatedMonths, truncatedDays, micros.round)
   }
 
+  /**
+   * Makes an interval from months, days and micros with the fractional part.
+   * The overflow style here follows the way of casting [[java.lang.Double]] to integrals and the
+   * natural rules for intervals as defined in the Gregorian calendar. Thus, the days fraction
+   * will be added to microseconds but the months fraction will not be added to days, and there may
+   * be rounding or truncation in months(or day and microseconds) part.
+   */
+  private def safeFromDoubles(
+      monthsWithFraction: Double,
+      daysWithFraction: Double,
+      microsWithFraction: Double): CalendarInterval = {
+    val truncatedDays = if (daysWithFraction > Int.MaxValue) {
+      Int.MaxValue
+    } else if (daysWithFraction < Int.MinValue) {
+      Int.MinValue
+    } else {
+      daysWithFraction.toInt
 
 Review comment:
   OK

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590741377
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736076
 
 
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383713039
 
 

 ##########
 File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/IntervalUtilsSuite.scala
 ##########
 @@ -267,35 +267,47 @@ class IntervalUtilsSuite extends SparkFunSuite with SQLHelper {
   }
 
   test("multiply by num") {
-    var interval = new CalendarInterval(0, 0, 0)
-    assert(interval === multiplyExact(interval, 0))
-    interval = new CalendarInterval(123, 456, 789)
-    assert(new CalendarInterval(123 * 42, 456 * 42, 789 * 42) === multiplyExact(interval, 42))
-    interval = new CalendarInterval(-123, -456, -789)
-    assert(new CalendarInterval(-123 * 42, -456 * 42, -789 * 42) === multiplyExact(interval, 42))
-    assert(new CalendarInterval(1, 22, 12 * MICROS_PER_HOUR) ===
-      multiplyExact(new CalendarInterval(1, 5, 0), 1.5))
-    assert(new CalendarInterval(2, 14, 12 * MICROS_PER_HOUR) ===
-      multiplyExact(new CalendarInterval(2, 2, 2 * MICROS_PER_HOUR), 1.2))
+    Seq[(CalendarInterval, Double) => CalendarInterval](multiply, multiplyExact).foreach { func =>
+      var interval = new CalendarInterval(0, 0, 0)
+      assert(interval === func(interval, 0))
+      interval = new CalendarInterval(123, 456, 789)
+      assert(new CalendarInterval(123 * 42, 456 * 42, 789 * 42) === func(interval, 42))
+      interval = new CalendarInterval(-123, -456, -789)
+      assert(new CalendarInterval(-123 * 42, -456 * 42, -789 * 42) === func(interval, 42))
+      interval = new CalendarInterval(1, 5, 0)
+      assert(new CalendarInterval(1, 7, 12 * MICROS_PER_HOUR) === func(interval, 1.5))
+      interval = new CalendarInterval(2, 2, 2 * MICROS_PER_HOUR)
+      assert(new CalendarInterval(2, 2, 12 * MICROS_PER_HOUR) === func(interval, 1.2))
+    }
 
+    val interval = new CalendarInterval(2, 0, 0)
+    assert(multiply(interval, Integer.MAX_VALUE) === new CalendarInterval(Int.MaxValue, 0, 0))
     try {
-      multiplyExact(new CalendarInterval(2, 0, 0), Integer.MAX_VALUE)
+      multiplyExact(interval, Integer.MAX_VALUE)
       fail("Expected to throw an exception on months overflow")
     } catch {
       case e: ArithmeticException => assert(e.getMessage.contains("overflow"))
     }
   }
 
   test("divide by num") {
-    var interval = new CalendarInterval(0, 0, 0)
-    assert(interval === divideExact(interval, 10))
-    interval = new CalendarInterval(1, 3, 30 * MICROS_PER_SECOND)
-    assert(new CalendarInterval(0, 16, 12 * MICROS_PER_HOUR + 15 * MICROS_PER_SECOND) ===
-      divideExact(interval, 2))
-    assert(new CalendarInterval(2, 6, MICROS_PER_MINUTE) === divideExact(interval, 0.5))
-    interval = new CalendarInterval(-1, 0, -30 * MICROS_PER_SECOND)
-    assert(new CalendarInterval(0, -15, -15 * MICROS_PER_SECOND) === divideExact(interval, 2))
-    assert(new CalendarInterval(-2, 0, -1 * MICROS_PER_MINUTE) === divideExact(interval, 0.5))
+    Seq[(CalendarInterval, Double) => CalendarInterval](divide, divideExact).foreach { func =>
+      var interval = new CalendarInterval(0, 0, 0)
+      assert(interval === func(interval, 10))
+      interval = new CalendarInterval(1, 3, 30 * MICROS_PER_SECOND)
+      assert(new CalendarInterval(0, 1, 12 * MICROS_PER_HOUR + 15 * MICROS_PER_SECOND) ===
+        func(interval, 2))
+      assert(new CalendarInterval(2, 6, MICROS_PER_MINUTE) === func(interval, 0.5))
+      interval = new CalendarInterval(-1, 0, -30 * MICROS_PER_SECOND)
+      assert(new CalendarInterval(0, 0, -15 * MICROS_PER_SECOND) === func(interval, 2))
+      assert(new CalendarInterval(-2, 0, -MICROS_PER_MINUTE) === func(interval, 0.5))
+    }
+
+    assert(divide(new CalendarInterval(Int.MaxValue, Int.MaxValue, 0), 0.9) ===
 
 Review comment:
   we should test `divideExact` as well.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590876708
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118910/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590345456
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118860/
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590690982
 
 
   **[Test build #118898 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118898/testReport)** for PR 27672 at commit [`7ece786`](https://github.com/apache/spark/commit/7ece78649d5c808ed00cc15dc9d9cd8bcc7813dd).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736399
 
 
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590889100
 
 
   thanks, merging 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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590875718
 
 
   **[Test build #118910 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118910/testReport)** for PR 27672 at commit [`9db1f37`](https://github.com/apache/spark/commit/9db1f370107b14e6d5f772441455b6f89afc6070).
    * 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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590410021
 
 
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590691316
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589938454
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383651177
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
 ##########
 @@ -113,12 +114,14 @@ object ExtractIntervalPart {
 abstract class IntervalNumOperation(
     interval: Expression,
     num: Expression,
-    operation: (CalendarInterval, Double) => CalendarInterval,
-    operationName: String)
+    val checkOverflow: Boolean = SQLConf.get.ansiEnabled)
 
 Review comment:
   hey wait. Does it mean this value can change when we transform/copy `MultiplyInterval`/`DivideInterval`?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589774786
 
 
   **[Test build #118803 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118803/testReport)** for PR 27672 at commit [`ae9869c`](https://github.com/apache/spark/commit/ae9869c0a4d6eb1162ab56a76da272378d78ed95).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383330000
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ##########
 @@ -308,12 +308,12 @@ class Analyzer(
           case _ => s
         }
         case m @ Multiply(l, r) if m.childrenResolved => (l.dataType, r.dataType) match {
-          case (CalendarIntervalType, _) => MultiplyInterval(l, r)
-          case (_, CalendarIntervalType) => MultiplyInterval(r, l)
+          case (CalendarIntervalType, _) => MultiplyInterval(l, r, conf.ansiEnabled)
 
 Review comment:
   `SQLConf.get` is reliable now. Let's follow other PRs and use the default parameter value.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590732134
 
 
   **[Test build #118906 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118906/testReport)** for PR 27672 at commit [`1a67228`](https://github.com/apache/spark/commit/1a67228f902652cc163c65429acbe4e4a31fe24e).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589957855
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118814/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590691316
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590740757
 
 
   **[Test build #118910 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118910/testReport)** for PR 27672 at commit [`9db1f37`](https://github.com/apache/spark/commit/9db1f370107b14e6d5f772441455b6f89afc6070).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590344440
 
 
   **[Test build #118860 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118860/testReport)** for PR 27672 at commit [`0c82efe`](https://github.com/apache/spark/commit/0c82efeed9a4bb8f007f676d8edeceea3684d222).
    * This patch **fails SparkR 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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590732473
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23655/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590339092
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23620/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590345440
 
 
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383153661
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
 ##########
 @@ -404,22 +404,44 @@ object IntervalUtils {
   }
 
   /**
-   * Makes an interval from months, days and micros with the fractional part by
-   * adding the month fraction to days and the days fraction to micros.
-   *
-   * @throws ArithmeticException if the result overflows any field value
+   * Makes an interval from months, days and micros with the fractional part.
+   * The overflow style here follows the way of ansi sql standard and the natural rules for
+   * intervals as defined in the Gregorian calendar. Thus, the days fraction will be added
+   * to microseconds but the months fraction will not be added to days, and it will throw
+   * exception if any part overflows.
    */
   private def fromDoubles(
       monthsWithFraction: Double,
       daysWithFraction: Double,
       microsWithFraction: Double): CalendarInterval = {
     val truncatedMonths = Math.toIntExact(monthsWithFraction.toLong)
-    val days = daysWithFraction + DAYS_PER_MONTH * (monthsWithFraction - truncatedMonths)
-    val truncatedDays = Math.toIntExact(days.toLong)
-    val micros = microsWithFraction + MICROS_PER_DAY * (days - truncatedDays)
+    val truncatedDays = Math.toIntExact(daysWithFraction.toLong)
+    val micros = microsWithFraction + MICROS_PER_DAY * (daysWithFraction - truncatedDays)
     new CalendarInterval(truncatedMonths, truncatedDays, micros.round)
   }
 
+  /**
+   * Makes an interval from months, days and micros with the fractional part.
+   * The overflow style here follows the way of casting [[java.lang.Double]] to integrals and the
+   * natural rules for intervals as defined in the Gregorian calendar. Thus, the days fraction
+   * will be added to microseconds but the months fraction will not be added to days, and there may
+   * be rounding or truncation in months(or day and microseconds) part.
+   */
+  private def safeFromDoubles(
+      monthsWithFraction: Double,
+      daysWithFraction: Double,
+      microsWithFraction: Double): CalendarInterval = {
+    val truncatedDays = if (daysWithFraction > Int.MaxValue) {
+      Int.MaxValue
+    } else if (daysWithFraction < Int.MinValue) {
+      Int.MinValue
+    } else {
+      daysWithFraction.toInt
 
 Review comment:
   what if we just call `daysWithFraction.toInt`?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590690982
 
 
   **[Test build #118898 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118898/testReport)** for PR 27672 at commit [`7ece786`](https://github.com/apache/spark/commit/7ece78649d5c808ed00cc15dc9d9cd8bcc7813dd).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590741391
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23659/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736037
 
 
   **[Test build #118898 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118898/testReport)** for PR 27672 at commit [`7ece786`](https://github.com/apache/spark/commit/7ece78649d5c808ed00cc15dc9d9cd8bcc7813dd).
    * This patch **fails due to an unknown error code, -9**.
    * 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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736407
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118898/
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589869235
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118803/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590256747
 
 
   LGTM except one comment

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590339078
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383713490
 
 

 ##########
 File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/IntervalExpressionsSuite.scala
 ##########
 @@ -219,17 +224,23 @@ class IntervalExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
     check("1 year 1 second", 0.5, "6 months 500 milliseconds")
     check("-100 years -1 millisecond", 0.5, "-50 years -500 microseconds")
     check("2 months 4 seconds", -0.5, "-1 months -2 seconds")
-    check("1 month 2 microseconds", 1.5, "1 months 15 days 3 microseconds")
-    check("2 months", Int.MaxValue, "integer overflow")
+    check("1 month 2 microseconds", 1.5, "1 months 3 microseconds")
+    check("2 months", Int.MaxValue, "integer overflow", Some(true))
+    check("2 months", Int.MaxValue, Int.MaxValue + " months", Some(false))
   }
 
   test("divide") {
-    def check(interval: String, num: Double, expected: String): Unit = {
-      val expr = DivideInterval(Literal(stringToInterval(interval)), Literal(num))
+    def check(
+        interval: String,
+        num: Double,
+        expected: String,
+        isAnsi: Option[Boolean] = None): Unit = {
       val expectedRes = safeStringToInterval(expected)
-      Seq("true", "false").foreach { v =>
+      val configs = if (isAnsi.isEmpty) { Seq("true", "false") } else isAnsi.map(_.toString).toSeq
 
 Review comment:
   super nit: `{ Seq("true", "false") }` -> `Seq("true", "false")`

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590426278
 
 
   **[Test build #118878 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118878/testReport)** for PR 27672 at commit [`e96135f`](https://github.com/apache/spark/commit/e96135f8c8e3a22cea06f9da8eec673f86ddc4fa).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590409532
 
 
   **[Test build #118865 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118865/testReport)** for PR 27672 at commit [`2bf07a3`](https://github.com/apache/spark/commit/2bf07a3c3f17979e3501034cd06d71850570228a).
    * 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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736076
 
 
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590426278
 
 
   **[Test build #118878 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118878/testReport)** for PR 27672 at commit [`e96135f`](https://github.com/apache/spark/commit/e96135f8c8e3a22cea06f9da8eec673f86ddc4fa).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590691320
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23647/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589869235
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118803/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383691399
 
 

 ##########
 File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/IntervalUtilsSuite.scala
 ##########
 @@ -267,35 +267,43 @@ class IntervalUtilsSuite extends SparkFunSuite with SQLHelper {
   }
 
   test("multiply by num") {
-    var interval = new CalendarInterval(0, 0, 0)
-    assert(interval === multiplyExact(interval, 0))
-    interval = new CalendarInterval(123, 456, 789)
-    assert(new CalendarInterval(123 * 42, 456 * 42, 789 * 42) === multiplyExact(interval, 42))
-    interval = new CalendarInterval(-123, -456, -789)
-    assert(new CalendarInterval(-123 * 42, -456 * 42, -789 * 42) === multiplyExact(interval, 42))
-    assert(new CalendarInterval(1, 22, 12 * MICROS_PER_HOUR) ===
-      multiplyExact(new CalendarInterval(1, 5, 0), 1.5))
-    assert(new CalendarInterval(2, 14, 12 * MICROS_PER_HOUR) ===
-      multiplyExact(new CalendarInterval(2, 2, 2 * MICROS_PER_HOUR), 1.2))
+    Seq[(CalendarInterval, Double) => CalendarInterval](multiply, multiplyExact).foreach { func =>
+      var interval = new CalendarInterval(0, 0, 0)
+      assert(interval === func(interval, 0))
+      interval = new CalendarInterval(123, 456, 789)
+      assert(new CalendarInterval(123 * 42, 456 * 42, 789 * 42) === func(interval, 42))
+      interval = new CalendarInterval(-123, -456, -789)
+      assert(new CalendarInterval(-123 * 42, -456 * 42, -789 * 42) === func(interval, 42))
+      interval = new CalendarInterval(1, 5, 0)
+      assert(new CalendarInterval(1, 7, 12 * MICROS_PER_HOUR) === func(interval, 1.5))
+      interval = new CalendarInterval(2, 2, 2 * MICROS_PER_HOUR)
+      assert(new CalendarInterval(2, 2, 12 * MICROS_PER_HOUR) === func(interval, 1.2))
+    }
 
+    val interval = new CalendarInterval(2, 0, 0)
+    assert(multiply(interval, Integer.MAX_VALUE) === new CalendarInterval(Int.MaxValue, 0, 0))
     try {
-      multiplyExact(new CalendarInterval(2, 0, 0), Integer.MAX_VALUE)
+      multiplyExact(interval, Integer.MAX_VALUE)
       fail("Expected to throw an exception on months overflow")
     } catch {
       case e: ArithmeticException => assert(e.getMessage.contains("overflow"))
     }
   }
 
   test("divide by num") {
-    var interval = new CalendarInterval(0, 0, 0)
-    assert(interval === divideExact(interval, 10))
-    interval = new CalendarInterval(1, 3, 30 * MICROS_PER_SECOND)
-    assert(new CalendarInterval(0, 16, 12 * MICROS_PER_HOUR + 15 * MICROS_PER_SECOND) ===
-      divideExact(interval, 2))
-    assert(new CalendarInterval(2, 6, MICROS_PER_MINUTE) === divideExact(interval, 0.5))
-    interval = new CalendarInterval(-1, 0, -30 * MICROS_PER_SECOND)
-    assert(new CalendarInterval(0, -15, -15 * MICROS_PER_SECOND) === divideExact(interval, 2))
-    assert(new CalendarInterval(-2, 0, -1 * MICROS_PER_MINUTE) === divideExact(interval, 0.5))
+    Seq[(CalendarInterval, Double) => CalendarInterval](divide, divideExact).foreach { func =>
+      var interval = new CalendarInterval(0, 0, 0)
+      assert(interval === func(interval, 10))
+      interval = new CalendarInterval(1, 3, 30 * MICROS_PER_SECOND)
+      assert(new CalendarInterval(0, 1, 12 * MICROS_PER_HOUR + 15 * MICROS_PER_SECOND) ===
+        func(interval, 2))
+      assert(new CalendarInterval(2, 6, MICROS_PER_MINUTE) === func(interval, 0.5))
+      interval = new CalendarInterval(-1, 0, -30 * MICROS_PER_SECOND)
+      assert(new CalendarInterval(0, 0, -15 * MICROS_PER_SECOND) === func(interval, 2))
+      assert(new CalendarInterval(-2, 0, -MICROS_PER_MINUTE) === func(interval, 0.5))
+    }
+    assert(divide(new CalendarInterval(123, 456, 789), 0) === null)
 
 Review comment:
   can we test one more case that `divide` returns Int.Max when overflow?

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


With regards,
Apache Git Services

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


[GitHub] [spark] yaooqinn commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383656155
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
 ##########
 @@ -113,12 +114,14 @@ object ExtractIntervalPart {
 abstract class IntervalNumOperation(
     interval: Expression,
     num: Expression,
-    operation: (CalendarInterval, Double) => CalendarInterval,
-    operationName: String)
+    val checkOverflow: Boolean = SQLConf.get.ansiEnabled)
 
 Review comment:
   Isn't  `SQLConf.get`  thread-safe? or `set command` can take effect across spark sessions? 

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590300838
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23614/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590422458
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23626/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383691814
 
 

 ##########
 File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/IntervalExpressionsSuite.scala
 ##########
 @@ -198,11 +198,15 @@ class IntervalExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
   }
 
   test("multiply") {
-    def check(interval: String, num: Double, expected: String): Unit = {
-      val expr = MultiplyInterval(Literal(stringToInterval(interval)), Literal(num))
+    def check(
+        interval: String,
+        num: Double,
+        expected: String,
+        configs: Seq[String] = Seq("true", "false")): Unit = {
 
 Review comment:
   nit: `isAnsi: Option[Boolean]`? If it's None then we test both configs.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590422448
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590300408
 
 
   **[Test build #118865 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118865/testReport)** for PR 27672 at commit [`2bf07a3`](https://github.com/apache/spark/commit/2bf07a3c3f17979e3501034cd06d71850570228a).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590484721
 
 
   **[Test build #118871 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118871/testReport)** for PR 27672 at commit [`ebb0011`](https://github.com/apache/spark/commit/ebb00112aef3579a070545d4493e4da8b7bfb954).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `case class MultiplyInterval(`
     * `case class DivideInterval(`

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589957855
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118814/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590422458
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23626/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590300833
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589957853
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590732467
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590345456
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118860/
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590691320
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23647/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590485556
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590300833
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590485556
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589869233
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383184398
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
 ##########
 @@ -137,10 +139,22 @@ abstract class IntervalNumOperation(
 }
 
 case class MultiplyInterval(interval: Expression, num: Expression)
-  extends IntervalNumOperation(interval, num, multiplyExact, "multiplyExact")
+  extends IntervalNumOperation(interval, num) {
+
+  override protected val operation: (CalendarInterval, Double) => CalendarInterval =
+    (interval, num) => if (checkOverflow) multiplyExact(interval, num) else multiply(interval, num)
+
+  override protected def operationName: String = if (checkOverflow) "multiplyExact" else "multiply"
+}
 
 case class DivideInterval(interval: Expression, num: Expression)
-  extends IntervalNumOperation(interval, num, divideExact, "divideExact")
+  extends IntervalNumOperation(interval, num) {
+
+  override protected val operation: (CalendarInterval, Double) => CalendarInterval =
+    (interval, num) => if (checkOverflow) divideExact(interval, num) else divide(interval, num)
 
 Review comment:
   ditto

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590410036
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118865/
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589775826
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23553/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590339092
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23620/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590732473
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23655/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736407
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118898/
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590300838
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23614/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589938369
 
 
   **[Test build #118814 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118814/testReport)** for PR 27672 at commit [`a05af57`](https://github.com/apache/spark/commit/a05af57179adc2b0812841e71d04b9c818665d84).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590236380
 
 
   **[Test build #118860 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118860/testReport)** for PR 27672 at commit [`0c82efe`](https://github.com/apache/spark/commit/0c82efeed9a4bb8f007f676d8edeceea3684d222).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590741391
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23659/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590552319
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118878/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589938457
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23564/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589775826
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23553/
   Test PASSed.

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


With regards,
Apache Git Services

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


[GitHub] [spark] yaooqinn commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383656155
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
 ##########
 @@ -113,12 +114,14 @@ object ExtractIntervalPart {
 abstract class IntervalNumOperation(
     interval: Expression,
     num: Expression,
-    operation: (CalendarInterval, Double) => CalendarInterval,
-    operationName: String)
+    val checkOverflow: Boolean = SQLConf.get.ansiEnabled)
 
 Review comment:
   Isn't  `SQLConf.get`  thread-safe? or `set command` can take effect across spark sessions? 

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590342435
 
 
   **[Test build #118871 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118871/testReport)** for PR 27672 at commit [`ebb0011`](https://github.com/apache/spark/commit/ebb00112aef3579a070545d4493e4da8b7bfb954).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590552311
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590300408
 
 
   **[Test build #118865 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118865/testReport)** for PR 27672 at commit [`2bf07a3`](https://github.com/apache/spark/commit/2bf07a3c3f17979e3501034cd06d71850570228a).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590552319
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118878/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590410036
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118865/
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590236380
 
 
   **[Test build #118860 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118860/testReport)** for PR 27672 at commit [`0c82efe`](https://github.com/apache/spark/commit/0c82efeed9a4bb8f007f676d8edeceea3684d222).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590345440
 
 
   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


With regards,
Apache Git Services

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


[GitHub] [spark] yaooqinn commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590157090
 
 
   cc @cloud-fan @gatorsmile, thanks for reviewing.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736050
 
 
   **[Test build #118906 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118906/testReport)** for PR 27672 at commit [`1a67228`](https://github.com/apache/spark/commit/1a67228f902652cc163c65429acbe4e4a31fe24e).
    * This patch **fails due to an unknown error code, -9**.
    * 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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590551487
 
 
   **[Test build #118878 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118878/testReport)** for PR 27672 at commit [`e96135f`](https://github.com/apache/spark/commit/e96135f8c8e3a22cea06f9da8eec673f86ddc4fa).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `abstract class IntervalNumOperation(`

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590741377
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590485565
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118871/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383146083
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
 ##########
 @@ -137,10 +139,23 @@ abstract class IntervalNumOperation(
 }
 
 case class MultiplyInterval(interval: Expression, num: Expression)
-  extends IntervalNumOperation(interval, num, multiplyExact, "multiplyExact")
+  extends IntervalNumOperation(interval, num) {
+
+  override protected def operation(interval: CalendarInterval, num: Double): CalendarInterval = {
+    if (checkOverflow) multiplyExact(interval, num) else multiply(interval, num)
 
 Review comment:
   we should define `operation` as a val: `val operation: (CalendarInterval, Double) => CalendarInterval`

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383145088
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
 ##########
 @@ -137,10 +139,23 @@ abstract class IntervalNumOperation(
 }
 
 case class MultiplyInterval(interval: Expression, num: Expression)
-  extends IntervalNumOperation(interval, num, multiplyExact, "multiplyExact")
+  extends IntervalNumOperation(interval, num) {
+
+  override protected def operation(interval: CalendarInterval, num: Double): CalendarInterval = {
+    if (checkOverflow) multiplyExact(interval, num) else multiply(interval, num)
 
 Review comment:
   we shouldn't check the ansi flag for each row.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589957710
 
 
   **[Test build #118814 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118814/testReport)** for PR 27672 at commit [`a05af57`](https://github.com/apache/spark/commit/a05af57179adc2b0812841e71d04b9c818665d84).
    * 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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590236879
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23609/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590876708
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118910/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589775814
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736084
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118906/
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590732134
 
 
   **[Test build #118906 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118906/testReport)** for PR 27672 at commit [`1a67228`](https://github.com/apache/spark/commit/1a67228f902652cc163c65429acbe4e4a31fe24e).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736084
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118906/
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590485565
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/118871/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590236879
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23609/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590342435
 
 
   **[Test build #118871 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118871/testReport)** for PR 27672 at commit [`ebb0011`](https://github.com/apache/spark/commit/ebb00112aef3579a070545d4493e4da8b7bfb954).

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


With regards,
Apache Git Services

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


[GitHub] [spark] cloud-fan closed pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672
 
 
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589869233
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590236871
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589938369
 
 
   **[Test build #118814 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118814/testReport)** for PR 27672 at commit [`a05af57`](https://github.com/apache/spark/commit/a05af57179adc2b0812841e71d04b9c818665d84).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590740757
 
 
   **[Test build #118910 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118910/testReport)** for PR 27672 at commit [`9db1f37`](https://github.com/apache/spark/commit/9db1f370107b14e6d5f772441455b6f89afc6070).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383719562
 
 

 ##########
 File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/IntervalUtilsSuite.scala
 ##########
 @@ -267,37 +267,56 @@ class IntervalUtilsSuite extends SparkFunSuite with SQLHelper {
   }
 
   test("multiply by num") {
-    var interval = new CalendarInterval(0, 0, 0)
-    assert(interval === multiplyExact(interval, 0))
-    interval = new CalendarInterval(123, 456, 789)
-    assert(new CalendarInterval(123 * 42, 456 * 42, 789 * 42) === multiplyExact(interval, 42))
-    interval = new CalendarInterval(-123, -456, -789)
-    assert(new CalendarInterval(-123 * 42, -456 * 42, -789 * 42) === multiplyExact(interval, 42))
-    assert(new CalendarInterval(1, 22, 12 * MICROS_PER_HOUR) ===
-      multiplyExact(new CalendarInterval(1, 5, 0), 1.5))
-    assert(new CalendarInterval(2, 14, 12 * MICROS_PER_HOUR) ===
-      multiplyExact(new CalendarInterval(2, 2, 2 * MICROS_PER_HOUR), 1.2))
+    Seq[(CalendarInterval, Double) => CalendarInterval](multiply, multiplyExact).foreach { func =>
+      var interval = new CalendarInterval(0, 0, 0)
+      assert(interval === func(interval, 0))
+      interval = new CalendarInterval(123, 456, 789)
+      assert(new CalendarInterval(123 * 42, 456 * 42, 789 * 42) === func(interval, 42))
+      interval = new CalendarInterval(-123, -456, -789)
+      assert(new CalendarInterval(-123 * 42, -456 * 42, -789 * 42) === func(interval, 42))
+      interval = new CalendarInterval(1, 5, 0)
+      assert(new CalendarInterval(1, 7, 12 * MICROS_PER_HOUR) === func(interval, 1.5))
+      interval = new CalendarInterval(2, 2, 2 * MICROS_PER_HOUR)
+      assert(new CalendarInterval(2, 2, 12 * MICROS_PER_HOUR) === func(interval, 1.2))
+    }
 
+    val interval = new CalendarInterval(2, 0, 0)
+    assert(multiply(interval, Integer.MAX_VALUE) === new CalendarInterval(Int.MaxValue, 0, 0))
     try {
-      multiplyExact(new CalendarInterval(2, 0, 0), Integer.MAX_VALUE)
+      multiplyExact(interval, Integer.MAX_VALUE)
       fail("Expected to throw an exception on months overflow")
     } catch {
       case e: ArithmeticException => assert(e.getMessage.contains("overflow"))
     }
   }
 
   test("divide by num") {
-    var interval = new CalendarInterval(0, 0, 0)
-    assert(interval === divideExact(interval, 10))
-    interval = new CalendarInterval(1, 3, 30 * MICROS_PER_SECOND)
-    assert(new CalendarInterval(0, 16, 12 * MICROS_PER_HOUR + 15 * MICROS_PER_SECOND) ===
-      divideExact(interval, 2))
-    assert(new CalendarInterval(2, 6, MICROS_PER_MINUTE) === divideExact(interval, 0.5))
-    interval = new CalendarInterval(-1, 0, -30 * MICROS_PER_SECOND)
-    assert(new CalendarInterval(0, -15, -15 * MICROS_PER_SECOND) === divideExact(interval, 2))
-    assert(new CalendarInterval(-2, 0, -1 * MICROS_PER_MINUTE) === divideExact(interval, 0.5))
+    Seq[(CalendarInterval, Double) => CalendarInterval](divide, divideExact).foreach { func =>
+      var interval = new CalendarInterval(0, 0, 0)
+      assert(interval === func(interval, 10))
+      interval = new CalendarInterval(1, 3, 30 * MICROS_PER_SECOND)
+      assert(new CalendarInterval(0, 1, 12 * MICROS_PER_HOUR + 15 * MICROS_PER_SECOND) ===
+        func(interval, 2))
+      assert(new CalendarInterval(2, 6, MICROS_PER_MINUTE) === func(interval, 0.5))
+      interval = new CalendarInterval(-1, 0, -30 * MICROS_PER_SECOND)
+      assert(new CalendarInterval(0, 0, -15 * MICROS_PER_SECOND) === func(interval, 2))
+      assert(new CalendarInterval(-2, 0, -MICROS_PER_MINUTE) === func(interval, 0.5))
+    }
+
+    var interval = new CalendarInterval(Int.MaxValue, Int.MaxValue, 0)
+    assert(divide(interval, 0.9) === new CalendarInterval(Int.MaxValue, Int.MaxValue,
+      ((Int.MaxValue / 9.0) * MICROS_PER_DAY).round))
+    try {
+      divideExact(interval, 0.9)
 
 Review comment:
   we should use `intercept` to assert a failure. I'm OK to leave it as we already use `try-catch` in this test case.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383183969
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
 ##########
 @@ -137,10 +139,22 @@ abstract class IntervalNumOperation(
 }
 
 case class MultiplyInterval(interval: Expression, num: Expression)
-  extends IntervalNumOperation(interval, num, multiplyExact, "multiplyExact")
+  extends IntervalNumOperation(interval, num) {
+
+  override protected val operation: (CalendarInterval, Double) => CalendarInterval =
+    (interval, num) => if (checkOverflow) multiplyExact(interval, num) else multiply(interval, num)
 
 Review comment:
   This still checks overflow per-row...
   
   ```
   if (checkOverflow) multiplyExact else multiply
   ```

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590876697
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589957853
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590736399
 
 
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590732467
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589868574
 
 
   **[Test build #118803 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118803/testReport)** for PR 27672 at commit [`ae9869c`](https://github.com/apache/spark/commit/ae9869c0a4d6eb1162ab56a76da272378d78ed95).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `abstract class IntervalNumOperation(interval: Expression, num: Expression)`

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590236871
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589938457
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/23564/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383261515
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
 ##########
 @@ -110,15 +111,16 @@ object ExtractIntervalPart {
   }
 }
 
-abstract class IntervalNumOperation(
-    interval: Expression,
-    num: Expression,
-    operation: (CalendarInterval, Double) => CalendarInterval,
-    operationName: String)
+abstract class IntervalNumOperation(interval: Expression, num: Expression)
   extends BinaryExpression with ImplicitCastInputTypes with Serializable {
   override def left: Expression = interval
   override def right: Expression = num
 
+  protected val checkOverflow: Boolean = SQLConf.get.ansiEnabled
 
 Review comment:
   can we follow https://github.com/apache/spark/pull/27683/files#diff-1516b10738479bbe190fb4e239258473R36 and make it a parameter?

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


With regards,
Apache Git Services

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


[GitHub] [spark] yaooqinn commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#discussion_r383151893
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/intervalExpressions.scala
 ##########
 @@ -137,10 +139,23 @@ abstract class IntervalNumOperation(
 }
 
 case class MultiplyInterval(interval: Expression, num: Expression)
-  extends IntervalNumOperation(interval, num, multiplyExact, "multiplyExact")
+  extends IntervalNumOperation(interval, num) {
+
+  override protected def operation(interval: CalendarInterval, num: Double): CalendarInterval = {
+    if (checkOverflow) multiplyExact(interval, num) else multiply(interval, num)
 
 Review comment:
   ah, thanks

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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-590410021
 
 
   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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27672: [SPARK-30919][SQL] Make interval multiply and divide's overflow behavior consistent with other operations
URL: https://github.com/apache/spark/pull/27672#issuecomment-589774786
 
 
   **[Test build #118803 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/118803/testReport)** for PR 27672 at commit [`ae9869c`](https://github.com/apache/spark/commit/ae9869c0a4d6eb1162ab56a76da272378d78ed95).

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


With regards,
Apache Git Services

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