huaxingao commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r665107266



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala
##########
@@ -182,6 +183,27 @@ abstract class ShowCreateTableSuite extends QueryTest with 
SQLTestUtils {
     }
   }
 
+  test("SPARK-36012: Add NULL flag when SHOW CREATE TABLE") {
+    val t = "SPARK_36012"
+    withTable(t) {
+      sql(
+        s"""
+           |CREATE TABLE $t (
+           |  a bigint NOT NULL,
+           |  b bigint
+           |)
+           |USING ${classOf[SimpleInsertSource].getName}
+        """.stripMargin)
+      val showDDL = sql(s"SHOW CREATE TABLE $t").head().getString(0)
+        .split("\n").map(_.trim)
+      assert(showDDL === Array(
+        "CREATE TABLE `default`.`SPARK_36012` (",
+        "`a` BIGINT NOT NULL,",
+        "`b` BIGINT)",
+        "USING org.apache.spark.sql.sources.SimpleInsertSource"))

Review comment:
       super nit and you don't have to change: I think you can modify 
`getShowDDL` a bit and reuse it, and make this code structure the same as 
`test("SPARK-24911: keep quotes for nested fields")`




-- 
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]

Reply via email to