Ngone51 commented on a change in pull request #26736: [SPARK-30098][SQL] Use 
default datasource as provider for CREATE TABLE syntax
URL: https://github.com/apache/spark/pull/26736#discussion_r354080505
 
 

 ##########
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala
 ##########
 @@ -44,9 +44,16 @@ class HiveMetastoreCatalogSuite extends TestHiveSingleton 
with SQLTestUtils {
   }
 
   test("duplicated metastore relations") {
-    val df = spark.sql("SELECT * FROM src")
-    logInfo(df.queryExecution.toString)
-    df.as('a).join(df.as('b), $"a.key" === $"b.key")
+    val originalCreateHiveTable = TestHive.conf.createHiveTableByDefaultEnabled
+    try {
+      
TestHive.conf.setConf(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT_ENABLED, true)
+      val df = spark.sql("SELECT * FROM src")
 
 Review comment:
   Instead of modifying the query, how about setting legacy mode for the 
`TestHiveContext` ?
   
https://github.com/apache/spark/blob/abba53e78b5556016a9d6935cfc65a9299a78977/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala#L52-L73
   
   Those queries are migrated from hive directly, so, I think it might be 
better not to change it ?
   
   > I believe many changes can be reverted if we fix TestHive.
   
   Yeah, I think so. At the beginning I'm not sure whether it has side affects 
for other tests if we modify the query directly, so I fixed them one by one. If 
we could fix them in a centralize place, it would be better.
   
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to