cloud-fan commented on code in PR #42824:
URL: https://github.com/apache/spark/pull/42824#discussion_r1324614861
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -1124,34 +1124,33 @@ class Analyzer(override val catalogManager:
CatalogManager) extends RuleExecutor
if timestamp.forall(ts => ts.resolved &&
!SubqueryExpression.hasSubquery(ts)) =>
resolveRelation(u, TimeTravelSpec.create(timestamp, version,
conf)).getOrElse(r)
- case u @ UnresolvedTable(identifier, cmd, relationTypeMismatchHint) =>
+ case u @ UnresolvedTable(identifier, cmd, suggestAlternative) =>
lookupTableOrView(identifier).map {
case v: ResolvedPersistentView =>
val nameParts = v.catalog.name() +:
v.identifier.asMultipartIdentifier
- throw QueryCompilationErrors.expectTableNotViewError(
- nameParts, isTemp = false, cmd, true, u)
+ throw QueryCompilationErrors.unsupportedViewOperationError(
+ nameParts, cmd, suggestAlternative, u)
case _: ResolvedTempView =>
- throw QueryCompilationErrors.expectTableNotViewError(
- identifier, isTemp = true, cmd, true, u)
+ throw QueryCompilationErrors.unsupportedViewOperationError(
+ identifier, cmd, suggestAlternative, u)
case table => table
}.getOrElse(u)
- case u @ UnresolvedView(identifier, cmd, allowTemp, hint) =>
+ case u @ UnresolvedView(identifier, cmd, allowTemp, suggestAlternative)
=>
lookupTableOrView(identifier, viewOnly = true).map {
case _: ResolvedTempView if !allowTemp =>
- throw
QueryCompilationErrors.expectViewNotTempViewError(identifier, cmd, u)
+ throw
QueryCompilationErrors.unsupportedViewOperationError(identifier, cmd, false, u)
case t: ResolvedTable =>
val nameParts = t.catalog.name() +:
t.identifier.asMultipartIdentifier
throw QueryCompilationErrors.expectViewNotTableError(
Review Comment:
nit: for consistency, shall we name this method
`unsupportedTableOperationError`?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]