cloud-fan commented on a change in pull request #26214: [SPARK-29558][SQL]
ResolveTables and ResolveRelations should be order-insensitive
URL: https://github.com/apache/spark/pull/26214#discussion_r346276947
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
##########
@@ -764,6 +764,25 @@ class SessionCatalog(
}
}
+ def lookupTempView(table: String): Option[SubqueryAlias] = {
+ val formattedTable = formatTableName(table)
+ getTempView(formattedTable).map { view =>
+ SubqueryAlias(formattedTable, view)
+ }
+ }
+
+ def lookupGlobalTempView(db: String, table: String): Option[SubqueryAlias] =
{
Review comment:
The idea here is to clearly separate the resolution of temp view and v1/v2
table, so I'd like to avoid using `resolveRelation` which mixes things together.
These 2 methods mostly copy-paste code from `resolveRelation`. We can update
`resolveRelation` to only resolve v1 tables, but I'd like to do it later as
there are many tests calling `resolveRelation` and we need to update them as
well.
----------------------------------------------------------------
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]