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/03/11 03:42:03 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #27867: [SPARK-31111][SQL][Tests] Fix interval output issue in ExtractBenchmark

cloud-fan commented on a change in pull request #27867: [SPARK-31111][SQL][Tests] Fix interval output issue in ExtractBenchmark
URL: https://github.com/apache/spark/pull/27867#discussion_r390730564
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ExtractBenchmark.scala
 ##########
 @@ -56,9 +56,11 @@ object ExtractBenchmark extends SqlBasedBenchmark {
     }
   }
 
-  private def castExpr(from: String): String = from match {
+  private def castExpr(from: String, toStr: Boolean = false): String = from match {
     case "timestamp" => "cast(id as timestamp)"
     case "date" => "cast(cast(id as timestamp) as date)"
+    case "interval" if toStr => "cast((cast(cast(id as timestamp) as date) - date'0001-01-01') + " +
 
 Review comment:
   why we need to cast to string?

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