Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14897#discussion_r80280674
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
 ---
    @@ -453,7 +532,11 @@ class SessionCatalog(
           val db = formatDatabaseName(name.database.getOrElse(currentDb))
           val table = formatTableName(name.table)
           val relationAlias = alias.getOrElse(table)
    -      if (name.database.isDefined || !tempTables.contains(table)) {
    +      if (db == globalTempDB) {
    +        globalTempViews.get(table).map { viewDef =>
    +          SubqueryAlias(relationAlias, viewDef, Some(name))
    +        }.getOrElse(throw new NoSuchTableException(db, table))
    +      } else if (name.database.isDefined || !tempTables.contains(table)) {
    --- End diff --
    
    We should probably update the ScalaDoc to mention the lookup order.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to