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_r390739470
 
 

 ##########
 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 it's not a problem for date/timestamp?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to