cloud-fan commented on a change in pull request #35204:
URL: https://github.com/apache/spark/pull/35204#discussion_r784507786
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowCreateTableExec.scala
##########
@@ -71,19 +75,39 @@ case class ShowCreateTableExec(
builder: StringBuilder,
tableOptions: Map[String, String]): Unit = {
if (tableOptions.nonEmpty) {
- val props = tableOptions.toSeq.sortBy(_._1).map { case (key, value) =>
- s"'${escapeSingleQuotedString(key)}' =
'${escapeSingleQuotedString(value)}'"
+ val props =
SQLConf.get.redactOptions(tableOptions).toSeq.sortBy(_._1).map {
+ case (key, value) =>
+ s"'${escapeSingleQuotedString(key)}' =
'${escapeSingleQuotedString(value)}'"
}
builder ++= "OPTIONS "
builder ++= concatByMultiLines(props)
}
}
private def showTablePartitioning(table: Table, builder: StringBuilder):
Unit = {
- if (!table.partitioning.isEmpty) {
- val transforms = new ArrayBuffer[String]
- table.partitioning.foreach(t => transforms += t.describe())
- builder ++= s"PARTITIONED BY ${transforms.mkString("(", ", ", ")")}\n"
+ table match {
+ case V1Table(t) =>
Review comment:
We don't need to special-case v1 table. We should recognize these
special partition transforms (`bucket` and `sorted_bucket`) and generate the
CLUSTERED BY syntax for them.
@huaxingao have we unified this part? We discussed this before and the
parser should generate partition transforms for bucket spec already, instead of
`BucketSpec`
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]