Github user yhuai commented on a diff in the pull request: https://github.com/apache/spark/pull/16233#discussion_r93898653 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala --- @@ -551,17 +551,26 @@ class SessionCatalog( * * If a database is specified in `name`, this will return the table/view from that database. * If no database is specified, this will first attempt to return a temporary table/view with - * the same name, then, if that does not exist, return the table/view from the current database. + * the same name, then, if that does not exist, and defaultDatabase is defined, return the + * table/view from the defaultDatabase, else return the table/view from the catalog.currentDb. * * Note that, the global temp view database is also valid here, this will return the global temp * view matching the given name. * - * If the relation is a view, the relation will be wrapped in a [[SubqueryAlias]] which will - * track the name of the view. + * If the relation is a view, we generate a [[View]] operator from the view description, and + * wrap the logical plan in a [[SubqueryAlias]] which will track the name of the view. + * + * @param name The name of the table/view that we lookup. + * @param alias The alias name of the table/view that we lookup. + * @param defaultDatabase The database name we should use to lookup the table/view, if the + * database part of [[TableIdentifier]] is not defined. --- End diff -- Let's also explain the precedence (db name in the table identifier -> default db -> current db).
--- 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