File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis
core/src/test/scala/org/apache/spark/sql/connector Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments