cloud-fan commented on a change in pull request #27946: 
[SPARK-31181][SQL][TESTS] Remove the default value assumption on CREATE TABLE 
test cases
URL: https://github.com/apache/spark/pull/27946#discussion_r395018018
 
 

 ##########
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala
 ##########
 @@ -1520,13 +1520,15 @@ class StatisticsSuite extends 
StatisticsCollectionTestBase with TestHiveSingleto
     val ext_tbl = "SPARK_30269_external"
     withTempDir { dir =>
       withTable(tbl, ext_tbl) {
-        sql(s"CREATE TABLE $tbl (key INT, value STRING, ds STRING) PARTITIONED 
BY (ds)")
-        sql(
-          s"""
-             | CREATE TABLE $ext_tbl (key INT, value STRING, ds STRING)
-             | PARTITIONED BY (ds)
-             | LOCATION '${dir.toURI}'
-           """.stripMargin)
+        withSQLConf(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT_ENABLED.key -> 
"false") {
+          sql(s"CREATE TABLE $tbl (key INT, value STRING, ds STRING) 
PARTITIONED BY (ds)")
+          sql(
+            s"""
+               | CREATE TABLE $ext_tbl (key INT, value STRING, ds STRING)
+               | PARTITIONED BY (ds)
 
 Review comment:
   `PARTITIONED BY (ds)` implicitly indicates data source table, maybe just add 
USING?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to