1
0

[MINOR] hive sync checks for table after creating db if auto create is true (#2591)

This commit is contained in:
Ankush Kanungo
2021-02-23 10:35:14 -08:00
committed by GitHub
parent d2f360f5dd
commit 3b8d0f3b1f

View File

@@ -114,8 +114,6 @@ public class HiveSyncTool extends AbstractSyncTool {
private void syncHoodieTable(String tableName, boolean useRealtimeInputFormat) {
LOG.info("Trying to sync hoodie table " + tableName + " with base path " + hoodieHiveClient.getBasePath()
+ " of type " + hoodieHiveClient.getTableType());
// Check if the necessary table exists
boolean tableExists = hoodieHiveClient.doesTableExist(tableName);
// check if the database exists else create it
if (cfg.autoCreateDatabase) {
@@ -131,6 +129,9 @@ public class HiveSyncTool extends AbstractSyncTool {
}
}
// Check if the necessary table exists
boolean tableExists = hoodieHiveClient.doesTableExist(tableName);
// Get the parquet schema for this table looking at the latest commit
MessageType schema = hoodieHiveClient.getDataSchema();
// Sync schema if needed