dongjoon-hyun commented on a change in pull request #31218:
URL: https://github.com/apache/spark/pull/31218#discussion_r559246825
##########
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:
Since this is a non-trivial, could you add a comment about the reason
why we need `Try` here?
----------------------------------------------------------------
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]