yuchenhuo commented on a change in pull request #26957: [SPARK-30314] Add
identifier and catalog information to DataSourceV2Relation
URL: https://github.com/apache/spark/pull/26957#discussion_r366669365
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -809,22 +809,27 @@ class Analyzer(
.getOrElse(i)
case desc @ DescribeTable(u: UnresolvedV2Relation, _) =>
- CatalogV2Util.loadRelation(u.catalog, u.tableName)
- .map(rel => desc.copy(table = rel))
- .getOrElse(desc)
+ CatalogV2Util
+ .loadRelation(u.catalog,
catalogManager.catalogIdentifier(u.catalog), u.tableName)
Review comment:
Sure, I will do the refactoring.
However in terms of using `originalNameParts`, I think the major reason why
we are adding the two additional fields to DSV2 relation is that both
CatalogPlugin and Table implementation doesn't include the resolved unique
identifier for the table. Even though the originalNameParts don't have a
catalog name in it, it might point to some default catalog in which case we
would still want it to be in the resolved unique identifier. Otherwise, we
might have two V2Relations pointing to the same table but has different
identifiers which would be inconsistent and pretty confusing.
----------------------------------------------------------------
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]