Peng-Lei commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r665842085



##########
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:
       I really don't like this function `getShowDDL`. It just returns part of 
the `DDL` data instead of the complete `DDL` data. But it is named `getShowDDL`




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