imback82 commented on a change in pull request #30270:
URL: https://github.com/apache/spark/pull/30270#discussion_r518959583



##########
File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala
##########
@@ -496,7 +496,10 @@ private[hive] class TestHiveSparkSession(
   def getLoadedTables: collection.mutable.HashSet[String] = 
sharedState.loadedTables
 
   def loadTestTable(name: String): Unit = {
-    if (!sharedState.loadedTables.contains(name)) {
+    // LOAD DATA does not work on temporary views. Since temporary views are 
resolved first,
+    // skip loading if there exists a temporary view with the given name.
+    if (sessionState.catalog.getTempView(name).isEmpty &&
+        !sharedState.loadedTables.contains(name)) {
       // Marks the table as loaded first to prevent infinite mutually 
recursive table loading.

Review comment:
       Note that this `def` is called as follows:
   
https://github.com/apache/spark/blob/93ad26be01a47fb075310a26188e238d55110098/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala#L611-L619
   
   Before this PR, it was resolved to a table in the current database, but 
after this PR, it will be resolved to a temporary view (if exists).




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



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

Reply via email to