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 2019/11/13 02:14:20 UTC

[GitHub] [spark] yaooqinn commented on a change in pull request #26418: [SPARK-29783][SQL] Support SQL Standard/ISO_8601 output style for interval type

yaooqinn commented on a change in pull request #26418: [SPARK-29783][SQL] Support SQL Standard/ISO_8601 output style for interval type
URL: https://github.com/apache/spark/pull/26418#discussion_r345540456
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala
 ##########
 @@ -97,7 +100,12 @@ object HiveResult {
     case (null, _) => "null"
     case (s: String, StringType) => "\"" + s + "\""
     case (decimal, DecimalType()) => decimal.toString
-    case (interval, CalendarIntervalType) => interval.toString
+    case (interval: CalendarInterval, CalendarIntervalType) =>
+      SQLConf.get.intervalOutputStyle match {
+        case SQL_STANDARD => toSqlStandardString(interval)
+        case ISO_8601 => toIso8601String(interval)
+        case _ => toMultiUnitsString(interval)
 
 Review comment:
   1. we may need to escape some tests for `ThriftServerQueryTestSuite`, does it worth to do it separately?
   2.  IMO, add a new config here is enough to be Hive compatible

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