peter-toth commented on a change in pull request #31218:
URL: https://github.com/apache/spark/pull/31218#discussion_r563265934
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmark.scala
##########
@@ -70,11 +67,13 @@ 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")
+ // Recover partitions but don't fail if a table is not partitioned.
+ Try(spark.sql(s"ALTER TABLE $tableName RECOVER PARTITIONS"))
Review comment:
Thanks, good idea. Added log in:
https://github.com/apache/spark/pull/31218/commits/7eda4693cde7c2a1a5870e8dab3a6347678019bf
----------------------------------------------------------------
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]