Skip to content

Commit

Permalink
fix CI failures
Browse files Browse the repository at this point in the history
  • Loading branch information
yunfengzhou-hub committed Jul 25, 2024
1 parent 85df0d2 commit 63a067a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testAlterTable() throws Exception {
tEnv.executeSql(
"INSERT INTO t VALUES (1, 10, 'apple'), (1, 20, 'banana'), (2, 10, 'cat'), (2, 20, 'dog')")
.await();
tEnv.executeSql("CALL sys.create_branch('default.t', 'test', 1)");
tEnv.executeSql("CALL sys.create_branch('default.t', 'test', '', 1)");
tEnv.executeSql("INSERT INTO t VALUES (1, 10, 'APPLE'), (2, 20, 'DOG'), (2, 30, 'horse')")
.await();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.function.Executable;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.junit.rules.TemporaryFolder;
import org.junit.rules.TestRule;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -1210,9 +1208,17 @@ public void testMarkDone() throws Exception {
insertSql.getJobClient().get().cancel();
}

@ParameterizedTest
@ValueSource(booleans = {true, false})
public void testRepairDatabasesOrTables(boolean isNamedArgument) throws Exception {
@Test
public void testRepairDatabasesOrTables() throws Exception {
testRepairDatabasesOrTables(false);
}

@Test
public void testRepairDatabasesOrTablesWithNamedArgument() throws Exception {
testRepairDatabasesOrTables(true);
}

private void testRepairDatabasesOrTables(boolean isNamedArgument) throws Exception {
TableEnvironment fileCatalog = useFileCatalog("test_db");
TableEnvironment fileCatalog01 = useFileCatalog("test_db_01");
// Database test_db exists in hive metastore
Expand Down Expand Up @@ -1267,9 +1273,17 @@ public void testRepairDatabasesOrTables(boolean isNamedArgument) throws Exceptio
.containsExactlyInAnyOrder("dt=2020-01-02/hh=09", "dt=2020-01-03/hh=10");
}

@ParameterizedTest
@ValueSource(booleans = {true, false})
public void testRepairTable(boolean isNamedArgument) throws Exception {
@Test
public void testRepairTable() throws Exception {
testRepairTable(false);
}

@Test
public void testRepairTableWithNamedArgument() throws Exception {
testRepairTable(true);
}

private void testRepairTable(boolean isNamedArgument) throws Exception {
TableEnvironment fileCatalog = useFileCatalog("test_db");
// Database test_db exists in hive metastore
hiveShell.execute("use test_db");
Expand Down Expand Up @@ -1300,9 +1314,17 @@ public void testRepairTable(boolean isNamedArgument) throws Exception {
.containsExactlyInAnyOrder("dt=2020-01-02/hh=09", "dt=2020-01-03/hh=10");
}

@ParameterizedTest
@ValueSource(booleans = {true, false})
public void testRepairTableWithCustomLocation(boolean isNamedArgument) throws Exception {
@Test
public void testRepairTableWithCustomLocation() throws Exception {
testRepairTableWithCustomLocation(false);
}

@Test
public void testRepairTableWithCustomLocationAndNamedArgument() throws Exception {
testRepairTableWithCustomLocation(true);
}

private void testRepairTableWithCustomLocation(boolean isNamedArgument) throws Exception {
TableEnvironment fileCatalog = useFileCatalog("test_db");
// Database exists in hive metastore and uses custom location.
String databaseLocation = path + "test_db.db";
Expand Down

0 comments on commit 63a067a

Please sign in to comment.