Skip to content

Commit 4fe3e69

Browse files
committed
address comments
1 parent 72b3307 commit 4fe3e69

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,8 @@ class Analyzer(
817817

818818
case alter @ AlterTable(_, _, u: UnresolvedV2Relation, _) =>
819819
CatalogV2Util.loadRelation(u.catalog, u.tableName)
820-
.map(rel => alter.copy(table = rel))
821-
.getOrElse(alter)
820+
.map(rel => alter.copy(table = rel))
821+
.getOrElse(alter)
822822

823823
case u: UnresolvedV2Relation =>
824824
CatalogV2Util.loadRelation(u.catalog, u.tableName).getOrElse(u)

sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ class ResolveSessionCatalog(
485485
replace,
486486
viewType)
487487

488-
case ShowTableProperties(SessionCatalogAndResolvedTable(resolved), propertyKey) =>
489-
ShowTablePropertiesCommand(getTableIdentifier(resolved), propertyKey)
488+
case ShowTableProperties(r: ResolvedTable, propertyKey) if isSessionCatalog(r.catalog) =>
489+
ShowTablePropertiesCommand(r.identifier.asTableIdentifier, propertyKey)
490490

491491
case DescribeFunctionStatement(CatalogAndIdentifier(catalog, ident), extended) =>
492492
val functionIdent =
@@ -581,16 +581,6 @@ class ResolveSessionCatalog(
581581
}
582582
}
583583

584-
object SessionCatalogAndResolvedTable {
585-
def unapply(resolved: ResolvedTable): Option[ResolvedTable] = {
586-
if (isSessionCatalog(resolved.catalog)) {
587-
Some(resolved)
588-
} else {
589-
None
590-
}
591-
}
592-
}
593-
594584
object SessionCatalogAndNamespace {
595585
def unapply(resolved: ResolvedNamespace): Option[(SupportsNamespaces, Seq[String])] =
596586
if (isSessionCatalog(resolved.catalog)) {
@@ -600,11 +590,6 @@ class ResolveSessionCatalog(
600590
}
601591
}
602592

603-
private def getTableIdentifier(resolved: ResolvedTable): TableIdentifier = {
604-
assert(resolved.identifier.namespace.length < 2)
605-
TableIdentifier(resolved.identifier.name, resolved.identifier.namespace.headOption)
606-
}
607-
608593
private def assertTopLevelColumn(colName: Seq[String], command: String): Unit = {
609594
if (colName.length > 1) {
610595
throw new AnalysisException(s"$command does not support nested column: ${colName.quoted}")

0 commit comments

Comments
 (0)