Skip to content

Commit

Permalink
[GOBBLIN-1855] Metadata writer tests do not work in isolation after u…
Browse files Browse the repository at this point in the history
…pgrading to Iceberg 1.2.0 (#3718)
  • Loading branch information
homatthew committed Jul 19, 2023
1 parent a5274cd commit 4a9dd53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.Collections;

import org.apache.commons.io.FileUtils;
import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.hadoop.hive.metastore.api.Table;
Expand Down Expand Up @@ -66,7 +67,10 @@ public void clean() throws Exception {
@BeforeSuite
public void setup() throws Exception {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
startMetastore();
try {
startMetastore();
} catch (AlreadyExistsException ignored) { }

tmpDir = Files.createTempDir();
dbUri = String.format("%s/%s/%s", tmpDir.getAbsolutePath(),"metastore", dbName);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.metastore.IMetaStoreClient;
import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.hadoop.hive.serde.serdeConstants;
Expand Down Expand Up @@ -128,6 +129,10 @@ public void clean() throws Exception {
@BeforeSuite
public void setUp() throws Exception {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
try {
startMetastore();
} catch (AlreadyExistsException ignored) { }

State state = ConfigUtils.configToState(ConfigUtils.propertiesToConfig(hiveConf.getAllProperties()));
Optional<String> metastoreUri = Optional.fromNullable(state.getProperties().getProperty(HiveRegister.HIVE_METASTORE_URI_KEY));
hc = HiveMetastoreClientPool.get(state.getProperties(), metastoreUri);
Expand Down

0 comments on commit 4a9dd53

Please sign in to comment.