Skip to content

Commit f34b5c6

Browse files
lianchengrxin
authored andcommitted
[SQL][MINOR] Fix minor formatting issues in SHOW CREATE TABLE output
## What changes were proposed in this pull request? This PR fixes two minor formatting issues appearing in `SHOW CREATE TABLE` output. Before: ``` CREATE EXTERNAL TABLE ... ... WITH SERDEPROPERTIES ('serialization.format' = '1' ) ... TBLPROPERTIES ('avro.schema.url' = '/tmp/avro/test.avsc', 'transient_lastDdlTime' = '1466638180') ``` After: ``` CREATE EXTERNAL TABLE ... ... WITH SERDEPROPERTIES ( 'serialization.format' = '1' ) ... TBLPROPERTIES ( 'avro.schema.url' = '/tmp/avro/test.avsc', 'transient_lastDdlTime' = '1466638180' ) ``` ## How was this patch tested? Manually tested. Author: Cheng Lian <lian@databricks.com> Closes apache#13864 from liancheng/show-create-table-format-fix.
1 parent 925884a commit f34b5c6

File tree

1 file changed

+2
-2
lines changed
  • sql/core/src/main/scala/org/apache/spark/sql/execution/command

1 file changed

+2
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ case class ShowCreateTableCommand(table: TableIdentifier) extends RunnableComman
830830
s"'${escapeSingleQuotedString(key)}' = '${escapeSingleQuotedString(value)}'"
831831
}
832832

833-
builder ++= serdeProps.mkString("WITH SERDEPROPERTIES (", ",\n ", "\n)\n")
833+
builder ++= serdeProps.mkString("WITH SERDEPROPERTIES (\n ", ",\n ", "\n)\n")
834834
}
835835

836836
if (storage.inputFormat.isDefined || storage.outputFormat.isDefined) {
@@ -864,7 +864,7 @@ case class ShowCreateTableCommand(table: TableIdentifier) extends RunnableComman
864864
}
865865

866866
if (props.nonEmpty) {
867-
builder ++= props.mkString("TBLPROPERTIES (", ",\n ", ")\n")
867+
builder ++= props.mkString("TBLPROPERTIES (\n ", ",\n ", "\n)\n")
868868
}
869869
}
870870
}

0 commit comments

Comments
 (0)