1
0

[HUDI-394] Provide a basic implementation of test suite

This commit is contained in:
Nishith Agarwal
2019-11-01 12:40:09 -07:00
committed by n3nash
parent d5b593b7d9
commit 2fc2b01d86
102 changed files with 8633 additions and 64 deletions

View File

@@ -112,6 +112,15 @@ public class HiveSyncTool {
+ " of type " + hoodieHiveClient.getTableType());
// Check if the necessary table exists
boolean tableExists = hoodieHiveClient.doesTableExist(tableName);
// check if the database exists else create it
try {
hoodieHiveClient.updateHiveSQL("create database if not exists " + cfg.databaseName);
} catch (Exception e) {
// this is harmless since table creation will fail anyways, creation of DB is needed for in-memory testing
LOG.warn("Unable to create database", e);
}
// Get the parquet schema for this table looking at the latest commit
MessageType schema = hoodieHiveClient.getDataSchema();
// Sync schema if needed

View File

@@ -572,4 +572,8 @@ public class HoodieHiveClient {
return new PartitionEvent(PartitionEventType.UPDATE, storagePartition);
}
}
public IMetaStoreClient getClient() {
return client;
}
}

View File

@@ -126,10 +126,21 @@ public class HiveTestService {
public void stop() {
resetSystemProperties();
if (tServer != null) {
tServer.stop();
try {
tServer.stop();
} catch (Exception e) {
LOG.error("Stop meta store failed", e);
}
}
if (hiveServer != null) {
hiveServer.stop();
try {
hiveServer.stop();
} catch (Exception e) {
LOG.error("Stop hive server failed", e);
}
}
if (executorService != null) {
executorService.shutdownNow();
}
LOG.info("Hive Minicluster service shut down.");
tServer = null;