peter-toth commented on a change in pull request #31218:
URL: https://github.com/apache/spark/pull/31218#discussion_r559410293



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmark.scala
##########
@@ -70,11 +67,12 @@ object TPCDSQueryBenchmark extends SqlBasedBenchmark with 
Logging {
 
   def setupTables(dataLocation: String, createTempView: Boolean): Map[String, 
Long] = {
     tables.map { tableName =>
-      val df = spark.read.parquet(s"$dataLocation/$tableName")
       if (createTempView) {
-        df.createOrReplaceTempView(tableName)
+        
spark.read.parquet(s"$dataLocation/$tableName").createOrReplaceTempView(tableName)
       } else {
-        df.write.saveAsTable(tableName)
+        spark.sql(s"DROP TABLE IF EXISTS $tableName")
+        spark.catalog.createTable(tableName, s"$dataLocation/$tableName", 
"parquet")
+        Try(spark.sql(s"ALTER TABLE $tableName RECOVER PARTITIONS"))

Review comment:
       Sure, added a comment in 
https://github.com/apache/spark/pull/31218/commits/976b19bf5a2c09dcc902d85d197cdde81e45f477.




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



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

Reply via email to