Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zouxxyy committed Dec 18, 2024
1 parent 8f2b660 commit 430b320
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.paimon.jdbc;

import org.apache.paimon.catalog.Catalog;
import org.apache.paimon.catalog.CatalogTestBase;
import org.apache.paimon.catalog.Identifier;
import org.apache.paimon.options.CatalogOptions;
Expand Down Expand Up @@ -95,7 +96,7 @@ public void testUpperCase() throws Exception {
Identifier.create("TEST_DB", "new_table"),
DEFAULT_TABLE_SCHEMA,
false))
.isInstanceOf(Exception.class)
.isInstanceOf(Catalog.DatabaseNotExistException.class)
.hasMessage("Database TEST_DB does not exist.");

catalog.createTable(Identifier.create("test_db", "new_TABLE"), DEFAULT_TABLE_SCHEMA, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,8 @@ public void testRenameTable() throws Exception {

// the target table name has upper case.
assertThatThrownBy(() -> tEnv.executeSql("ALTER TABLE t1 RENAME TO T1"))
.hasMessage("Table name [T1] cannot contain upper case in the catalog.");
.hasMessage(
"Could not execute ALTER TABLE my_hive.test_db.t1 RENAME TO my_hive.test_db.T1.");

tEnv.executeSql("ALTER TABLE t1 RENAME TO t3").await();

Expand Down Expand Up @@ -1168,7 +1169,8 @@ public void testUpperCase() {
tEnv.executeSql(
"CREATE TABLE tt ( A INT, b STRING, C STRING) WITH ( 'file.format' = 'avro' )")
.await())
.hasRootCauseMessage("Table test_db.tt already exists.");
.hasRootCauseMessage(
"Table (or view) test_db.tt already exists in Catalog my_hive.");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void testBuildWithHive(@TempDir java.nio.file.Path tempDir) {
+ " ('file.format'='avro')");

assertThat(spark.sql("SHOW NAMESPACES").collectAsList().stream().map(Object::toString))
.containsExactlyInAnyOrder("[default]", "[my_db]", "[my_db1]");
.containsExactlyInAnyOrder("[default]", "[my_db]");

assertThat(
spark.sql("SHOW TABLES").collectAsList().stream()
Expand Down

0 comments on commit 430b320

Please sign in to comment.