yaooqinn 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_r390757478
########## 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: good advice, 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org