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 04:09:09 UTC

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

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


##########
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:
   The table names in the request work as filters only, and they don't determine the result set order. So, it's not a bug to me.



-- 
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