viirya commented on a change in pull request #27187: [SPARK-30497][SQL]
migrate DESCRIBE TABLE to the new framework
URL: https://github.com/apache/spark/pull/27187#discussion_r366167726
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -900,6 +902,18 @@ class Analyzer(
}
case _ => u
}
+
+ case u @ UnresolvedTableOrView(identifier) =>
+ expandRelationName(identifier) match {
+ case SessionCatalogAndIdentifier(catalog, ident) =>
+ CatalogV2Util.loadTable(catalog, ident) match {
+ // We don't support view in v2 catalog yet. Here we treat v1
view as table and use
+ // `ResolvedTable` to carry it.
+ case Some(table) => ResolvedTable(catalog.asTableCatalog, ident,
table)
Review comment:
Do you mean to add a case?
```
CatalogV2Util.loadTable(catalog, ident) match {
case Some(v1Table: V1Table) if v1Table.v1Table.tableType ==
CatalogTableType.VIEW =>
...
}
```
Otherwise I'm not sure why `case Some(table) =>` is for v1 view.
----------------------------------------------------------------
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]