wangyum commented on pull request #31243:
URL: https://github.com/apache/spark/pull/31243#issuecomment-762744325
The actual change is:
```diff
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala
b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala
index 9f420cac97..2fe79b273d 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala
@@ -271,6 +271,41 @@ trait TPCDSBase extends SharedSparkSession {
""".stripMargin
)
+ private val tablePartitionColumns = Map(
+ "catalog_sales" -> Seq("cs_sold_date_sk"),
+ "catalog_returns" -> Seq("cr_returned_date_sk"),
+ "inventory" -> Seq("inv_date_sk"),
+ "store_sales" -> Seq("ss_sold_date_sk"),
+ "store_returns" -> Seq("sr_returned_date_sk"),
+ "web_sales" -> Seq("ws_sold_date_sk"),
+ "web_returns" -> Seq("wr_returned_date_sk"),
+ "call_center" -> Seq.empty[String],
+ "catalog_page" -> Seq.empty[String],
+ "customer" -> Seq.empty[String],
+ "customer_address" -> Seq.empty[String],
+ "customer_demographics" -> Seq.empty[String],
+ "date_dim" -> Seq.empty[String],
+ "household_demographics" -> Seq.empty[String],
+ "income_band" -> Seq.empty[String],
+ "item" -> Seq.empty[String],
+ "promotion" -> Seq.empty[String],
+ "reason" -> Seq.empty[String],
+ "ship_mode" -> Seq.empty[String],
+ "store" -> Seq.empty[String],
+ "time_dim" -> Seq.empty[String],
+ "warehouse" -> Seq.empty[String],
+ "web_page" -> Seq.empty[String],
+ "web_site" -> Seq.empty[String]
+ )
+
+ private def partitionedByClause(tableName: String) = {
+ if (tablePartitionColumns(tableName).nonEmpty) {
+ s"PARTITIONED BY (${tablePartitionColumns(tableName).mkString(", ")})"
+ } else {
+ ""
+ }
+ }
+
val tableNames: Iterable[String] = tableColumns.keys
def createTable(
@@ -282,6 +317,7 @@ trait TPCDSBase extends SharedSparkSession {
s"""
|CREATE TABLE `$tableName` (${tableColumns(tableName)})
|USING $format
+ |${partitionedByClause(tableName)}
|${options.mkString("\n")}
""".stripMargin)
}
```
----------------------------------------------------------------
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]