Skip to content

Commit fc2c5a3

Browse files
committed
update log message
1 parent db311fd commit fc2c5a3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ class Analyzer(
748748
* [[ResolveRelations]] still resolves v1 tables.
749749
*/
750750
object ResolveTables extends Rule[LogicalPlan] {
751+
import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._
752+
751753
def apply(plan: LogicalPlan): LogicalPlan = ResolveTempViews(plan).resolveOperatorsUp {
752754
case u: UnresolvedRelation =>
753755
lookupV2Relation(u.multipartIdentifier)
@@ -778,7 +780,7 @@ class Analyzer(
778780
}
779781
if (maybeTempView.isDefined) {
780782
throw new AnalysisException(
781-
s"A temp view '${unresolved.originalNameParts.head}' cannot be handled by V2 commands.")
783+
s"Invalid command: '${unresolved.originalNameParts.quoted}' is a view not a table.")
782784
}
783785

784786
CatalogV2Util.loadRelation(unresolved.catalog, unresolved.tableName)

sql/core/src/test/scala/org/apache/spark/sql/connector/TableResolutionSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class TableResolutionSuite extends QueryTest with SharedSparkSession with Before
5252
val ex = intercept[AnalysisException] {
5353
sql(command)
5454
}
55-
assert(ex.getMessage.contains("A temp view 't' cannot be handled"))
55+
assert(ex.getMessage.contains("Invalid command: 't' is a view not a table."))
5656
}
5757
}
5858
}

0 commit comments

Comments
 (0)