GitHub user rdblue opened a pull request:
https://github.com/apache/spark/pull/21978
SPARK-25006: Add CatalogTableIdentifier.
## What changes were proposed in this pull request?
This adds `CatalogTableIdentifier`, which is an identifier that consists of
a triple: catalog, database, and table. Catalog and database are optional.
The existing `TableIdentifier` class extends `CatalogTableIdentifier` and
is guarateed to have no defined catalog component. Classes that expect a
`TableIdentifier` will continue to use `TableIdentifier` to ensure that
catalogs are not leaked into code paths that do not support them.
This adds a parser rule, `catalogTableIdentifier`, that can parse
identifiers with a catalog. An identifier with only two components will match
database and table, leaving the catalog undefined. Only identifiers with three
components will have a defined catalog. In addition, rules must be re-written
to support `catalogTableIdentifier`. Existing rules will continue to use
`tableIdentifier` with no catalog.
## How was this patch tested?
Existing tests. This should not change any behavior.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rdblue/spark
SPARK-25006-add-catalog-to-table-identifier
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/21978.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #21978
----
commit d61e0f1ccdce630d65c81ee27a233a14759415ea
Author: Ryan Blue <blue@...>
Date: 2018-08-02T21:03:21Z
SPARK-25006: Add CatalogTableIdentifier.
This adds CatalogTableIdentifier, which is an identifier that consists
of a triple: catalog, database, and table. Catalog and database are
optional.
The existing TableIdentifier class extends CatalogTableIdentifier and is
guarateed to have no defined catalog component. Classes that expect a
TableIdentifier should continue to use TableIdentifier to ensure that
catalogs are not leaked into code paths that do not support them.
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]