cloud-fan commented on a change in pull request #26921: [SPARK-30282][SQL]
Integrate V2 commands with UnresolvedV2Relation into new resolution framework
URL: https://github.com/apache/spark/pull/26921#discussion_r364569290
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala
##########
@@ -201,22 +201,21 @@ class ResolveSessionCatalog(
case RenameTableStatement(SessionCatalogAndTable(_, oldName),
newNameParts, isView) =>
AlterTableRenameCommand(oldName.asTableIdentifier,
newNameParts.asTableIdentifier, isView)
- case DescribeTableStatement(
- nameParts @ SessionCatalogAndTable(catalog, tbl), partitionSpec,
isExtended) =>
- loadTable(catalog, tbl.asIdentifier).collect {
- case v1Table: V1Table =>
- DescribeTableCommand(tbl.asTableIdentifier, partitionSpec,
isExtended)
- }.getOrElse {
- // The v1 `DescribeTableCommand` can describe view as well.
- if (isView(tbl)) {
- DescribeTableCommand(tbl.asTableIdentifier, partitionSpec,
isExtended)
- } else {
- if (partitionSpec.nonEmpty) {
- throw new AnalysisException("DESCRIBE TABLE does not support
partition for v2 tables.")
+ case d @ DescribeTable(SessionCatalogAndResolvedTable(resolved),
partitionSpec, isExtended) =>
+ resolved.table match {
+ case _: V1Table =>
+ DescribeTableCommand(getTableIdentifier(resolved), partitionSpec,
isExtended)
+ case _ =>
+ // The v1 `DescribeTableCommand` can describe view as well.
+ if (isView(resolved.identifier.asMultipartIdentifier)) {
Review comment:
same for presto: https://prestodb.io/docs/current/sql/describe.html
----------------------------------------------------------------
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]