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

[GitHub] [spark] MaxGekk opened a new pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

MaxGekk opened a new pull request #32070:
URL: https://github.com/apache/spark/pull/32070


   ### What changes were proposed in this pull request?
   1. Added new method `toDayTimeIntervalString()` to `IntervalUtils` which converts a day-time interval as a number of microseconds to a string in the form **"INTERVAL '[sign]days hours:minutes:secondsWithFraction' DAY TO SECOND"**.
   2. Extended the `Cast` expression to support casting of `DayTimeIntervalType` to `StringType`.
   
   ### Why are the changes needed?
   To conform the ANSI SQL standard which requires to support such casting.
   
   ### Does this PR introduce _any_ user-facing change?
   Should not because new day-time interval has not been released yet.
   
   ### How was this patch tested?
   Added new tests for casting:
   ```
   $ build/sbt "testOnly *CastSuite*"
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


   **[Test build #136965 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136965/testReport)** for PR 32070 at commit [`b8bfa9f`](https://github.com/apache/spark/commit/b8bfa9f1d305793e36b6f251c20cce1f218d41df).
    * This patch **fails PySpark unit tests**.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


   **[Test build #137012 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137012/testReport)** for PR 32070 at commit [`688c71b`](https://github.com/apache/spark/commit/688c71ba8e32406d58554cce0c0fabea25296adf).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] MaxGekk commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


   @cloud-fan @gengliangwang @yaooqinn @AngersZhuuuu Could you review this PR, please.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] cloud-fan commented on a change in pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -818,6 +818,31 @@ abstract class CastSuiteBase extends SparkFunSuite with ExpressionEvalHelper {
     checkConsistencyBetweenInterpretedAndCodegen(
       (child: Expression) => Cast(child, StringType), YearMonthIntervalType)
   }
+
+  test("SPARK-34668: cast day-time interval to string") {
+    Seq(
+      Duration.ZERO -> "0 0:0:0",
+      Duration.of(1, ChronoUnit.MICROS) -> "0 0:0:0.000001",
+      Duration.ofMillis(-1) -> "-0 0:0:0.001",
+      Duration.ofMillis(1234) -> "0 0:0:1.234",
+      Duration.ofSeconds(-59).minus(999999, ChronoUnit.MICROS) -> "-0 0:0:59.999999",
+      Duration.ofMinutes(30).plusMillis(10) -> "0 0:30:0.01",
+      Duration.ofHours(-23).minusSeconds(59) -> "-0 23:0:59",

Review comment:
       For times, I think it's more common to always have 2 digits. Have we checked with other databases?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


   **[Test build #137020 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137020/testReport)** for PR 32070 at commit [`0bb44e3`](https://github.com/apache/spark/commit/0bb44e39ca3060d8217c81b72fdc6dee202a02c1).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] cloud-fan commented on a change in pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
##########
@@ -867,19 +867,20 @@ object IntervalUtils {
         // Especial handling of minimum `Long` value because negate op overflows `Long`.
         // seconds = 106751991 * (24 * 60 * 60) + 4 * 60 * 60 + 54 = 9223372036854
         // microseconds = -9223372036854000000L-775808 == Long.MinValue
-        return "INTERVAL '-106751991 4:0:54.775808' DAY TO SECOND"
+        return "INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND"
       } else {
         sign = "-"
         rest = -rest
       }
     }
     val seconds = rest % MICROS_PER_MINUTE
-    val secondStr = java.math.BigDecimal.valueOf(seconds, 6).stripTrailingZeros().toPlainString()
     rest /= MICROS_PER_MINUTE
     val minutes = rest % MINUTES_PER_HOUR
     rest /= MINUTES_PER_HOUR
     val hours = rest % HOURS_PER_DAY
     val days = rest / HOURS_PER_DAY
-    s"INTERVAL '$sign$days $hours:$minutes:$secondStr' DAY TO SECOND"
+    val leadSecZero = if (seconds < 10000000) "0" else ""

Review comment:
       nit: use MICROS_PER_SECONDS?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


   **[Test build #136965 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136965/testReport)** for PR 32070 at commit [`b8bfa9f`](https://github.com/apache/spark/commit/b8bfa9f1d305793e36b6f251c20cce1f218d41df).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] MaxGekk commented on a change in pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -818,6 +818,31 @@ abstract class CastSuiteBase extends SparkFunSuite with ExpressionEvalHelper {
     checkConsistencyBetweenInterpretedAndCodegen(
       (child: Expression) => Cast(child, StringType), YearMonthIntervalType)
   }
+
+  test("SPARK-34668: cast day-time interval to string") {
+    Seq(
+      Duration.ZERO -> "0 0:0:0",
+      Duration.of(1, ChronoUnit.MICROS) -> "0 0:0:0.000001",
+      Duration.ofMillis(-1) -> "-0 0:0:0.001",
+      Duration.ofMillis(1234) -> "0 0:0:1.234",
+      Duration.ofSeconds(-59).minus(999999, ChronoUnit.MICROS) -> "-0 0:0:59.999999",
+      Duration.ofMinutes(30).plusMillis(10) -> "0 0:30:0.01",
+      Duration.ofHours(-23).minusSeconds(59) -> "-0 23:0:59",

Review comment:
       > Have we checked with other databases?
   
   For example, Oracle doesn't prepend zero for hours, see the [doc](https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Literals.html#GUID-49FADC66-794D-4763-88C7-B81BB4F26D9E):
   ```
   INTERVAL '4 5:12:10.222' DAY TO SECOND
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] MaxGekk commented on a change in pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -818,6 +818,31 @@ abstract class CastSuiteBase extends SparkFunSuite with ExpressionEvalHelper {
     checkConsistencyBetweenInterpretedAndCodegen(
       (child: Expression) => Cast(child, StringType), YearMonthIntervalType)
   }
+
+  test("SPARK-34668: cast day-time interval to string") {
+    Seq(
+      Duration.ZERO -> "0 0:0:0",
+      Duration.of(1, ChronoUnit.MICROS) -> "0 0:0:0.000001",
+      Duration.ofMillis(-1) -> "-0 0:0:0.001",
+      Duration.ofMillis(1234) -> "0 0:0:1.234",
+      Duration.ofSeconds(-59).minus(999999, ChronoUnit.MICROS) -> "-0 0:0:59.999999",
+      Duration.ofMinutes(30).plusMillis(10) -> "0 0:30:0.01",
+      Duration.ofHours(-23).minusSeconds(59) -> "-0 23:0:59",

Review comment:
       added leading zeros for time parts




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] cloud-fan commented on a change in pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -818,6 +818,31 @@ abstract class CastSuiteBase extends SparkFunSuite with ExpressionEvalHelper {
     checkConsistencyBetweenInterpretedAndCodegen(
       (child: Expression) => Cast(child, StringType), YearMonthIntervalType)
   }
+
+  test("SPARK-34668: cast day-time interval to string") {
+    Seq(
+      Duration.ZERO -> "0 0:0:0",
+      Duration.of(1, ChronoUnit.MICROS) -> "0 0:0:0.000001",
+      Duration.ofMillis(-1) -> "-0 0:0:0.001",
+      Duration.ofMillis(1234) -> "0 0:0:1.234",
+      Duration.ofSeconds(-59).minus(999999, ChronoUnit.MICROS) -> "-0 0:0:59.999999",
+      Duration.ofMinutes(30).plusMillis(10) -> "0 0:30:0.01",
+      Duration.ofHours(-23).minusSeconds(59) -> "-0 23:0:59",

Review comment:
       that's the literal syntax, which is supposed to be more flexible. How about the cast behavior?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] cloud-fan closed pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #32070:
URL: https://github.com/apache/spark/pull/32070


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] cloud-fan commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


   thanks, merging to master!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins commented on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] gengliangwang commented on a change in pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
##########
@@ -851,4 +851,36 @@ object IntervalUtils {
     }
     s"INTERVAL '$sign${absMonths / MONTHS_PER_YEAR}-${absMonths % MONTHS_PER_YEAR}' YEAR TO MONTH"
   }
+
+  /**
+   * Converts a day-time interval as a number of microseconds to its textual representation
+   * which conforms to the ANSI SQL standard.
+   *
+   * @param micros The number of microseconds, positive or negative
+   * @return Day-time interval string
+   */
+  def toDayTimeIntervalString(micros: Long): String = {
+    var sign = ""
+    var rest = micros
+    if (micros < 0) {
+      if (micros == Long.MinValue) {

Review comment:
       nice catch!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA removed a comment on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


   **[Test build #136965 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/136965/testReport)** for PR 32070 at commit [`b8bfa9f`](https://github.com/apache/spark/commit/b8bfa9f1d305793e36b6f251c20cce1f218d41df).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA removed a comment on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


   **[Test build #137020 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137020/testReport)** for PR 32070 at commit [`0bb44e3`](https://github.com/apache/spark/commit/0bb44e39ca3060d8217c81b72fdc6dee202a02c1).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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


[GitHub] [spark] SparkQA removed a comment on pull request #32070: [SPARK-34668][SQL] Support casting of day-time intervals to strings

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


   **[Test build #137012 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137012/testReport)** for PR 32070 at commit [`688c71b`](https://github.com/apache/spark/commit/688c71ba8e32406d58554cce0c0fabea25296adf).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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



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