Github user hvanhovell commented on the issue:
https://github.com/apache/spark/pull/16233
@nsyca we actually support a 2-part name (look at TableIdentifier). You
don't have to define the database. We have the concept of a `currentDatabase`
in the `SessionCatalog`, and use that to resolve non-temporary objects
(functions/tables/views). For the new view approach
(non-cannocalizing/non-materializing ~> lazy), we need to capture the current
database when the view is created (simple), and use that when the view is
resolve (hard).
You are correctly describing the issue at hand, and the solution also works
(it is much like the second solution I previously posted). The major issue with
this solution, is that it assumes session isolation. For performance reasons we
allow users to share a session in thrift server (this is hidden behind a flag),
if they do, this solution might cause some really odd bugs if two or more users
have their queries analyzed at the same time.
BTW: We will probably change to an 3-part/n-part name as soon as Catalog
federation comes into play.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]