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 2022/08/01 03:50:17 UTC

[GitHub] [spark] wangyum commented on a diff in pull request #37347: [SPARK-39503][SQL][FOLLOWUP] InMemoryCatalog should keep the catalog field when renaming tables

wangyum commented on code in PR #37347:
URL: https://github.com/apache/spark/pull/37347#discussion_r934117161


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogSuite.scala:
##########
@@ -278,8 +278,18 @@ abstract class ExternalCatalogSuite extends SparkFunSuite {
   }
 
   test("get tables by name") {
-    assert(newBasicCatalog().getTablesByName("db2", Seq("tbl1", "tbl2"))
-      .map(_.identifier.table) == Seq("tbl1", "tbl2"))
+    val catalog = newBasicCatalog()
+    val tables = catalog.getTablesByName("db2", Seq("tbl1", "tbl2"))
+    assert(tables.map(_.identifier.table) == Seq("tbl1", "tbl2"))
+    assert(tables.forall(_.identifier.catalog.isDefined))
+
+    // After renaming a table, the identifier should still be qualified with catalog.
+    catalog.renameTable("db2", "tbl1", "tblone")
+    // TODO: HMS seems to have a bug and the order of returned tables do not match the order of
+    //       table names. You can reproduce the bug by passing `Seq("tblone", "tbl2")` here.

Review Comment:
   Yes. HMS can't guarantee of ordering of the returned tables:
   https://github.com/apache/hive/blob/rel/release-2.3.9/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java#L383



-- 
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: reviews-unsubscribe@spark.apache.org

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