cloud-fan commented on a change in pull request #30881:
URL: https://github.com/apache/spark/pull/30881#discussion_r549935749
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
##########
@@ -764,13 +765,13 @@ case class DescribeColumnCommand(
val colName = UnresolvedAttribute(colNameParts).name
val field = {
relation.resolve(colNameParts, resolver).getOrElse {
- throw new AnalysisException(s"Column $colName does not exist")
+ throw QueryCompilationErrors.columnDoesNotExistError(colName)
}
}
if (!field.isInstanceOf[Attribute]) {
// If the field is not an attribute after `resolve`, then it's a nested
field.
- throw new AnalysisException(
- s"DESC TABLE COLUMN command does not support nested data types:
$colName")
+ throw QueryCompilationErrors.commandNotSupportNestedColumnError(
+ "DESC TABLE COLUMN", toPrettySQL(field, removeAlias = true))
Review comment:
We won't hit this branch anymore, as we fail earlier in
`ResolveSessionCatalog`. We can simply use
`assert(field.isInstanceOf[Attribute])`
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]