You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/22 09:52:59 UTC

[GitHub] [spark] linhongliu-db commented on a change in pull request #31606: [SPARK-34490][SQL] Analysis should fail if the view refers a dropped table

linhongliu-db commented on a change in pull request #31606:
URL: https://github.com/apache/spark/pull/31606#discussion_r580114213



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TableLookupCacheSuite.scala
##########
@@ -46,7 +48,12 @@ class TableLookupCacheSuite extends AnalysisTest with Matchers {
       ignoreIfExists = false)
     val v2Catalog = new InMemoryTableCatalog {
       override def loadTable(ident: Identifier): Table = {
-        V1Table(externalCatalog.getTable("default", ident.name))
+        val catalogTable = externalCatalog.getTable("default", ident.name)
+        new InMemoryTable(
+          catalogTable.identifier.table,
+          catalogTable.schema,
+          Array.empty,
+          Map.empty[String, String].asJava)

Review comment:
       change V1Table to V2Table here, because to lookup V1 table, the catalog will return `UnresolvedCatalogRelation` first and it needs `FindDataSourceTable` rule to resolve. But, `FindDataSourceTable` is in sql/core while the test is in sql/catalyst. So we need to use V2Table instead to avoid depending on `FindDataSourceTable`




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org