Skip to content

Commit

Permalink
[HUDI-5074] Warn if table for metastore sync has capitals in it (#7077)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Vexler <=>
  • Loading branch information
jonvex authored Nov 2, 2022
1 parent 13fd5b9 commit d5ef8a3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import java.util.Properties;

/**
* Helper class for syncing Hudi commit data with external metastores.
*/
public class SyncUtilHelpers {

private static final Logger LOG = LogManager.getLogger(SyncUtilHelpers.class);
/**
* Create an instance of an implementation of {@link HoodieSyncTool} that will sync all the relevant meta information
* with an external metastore such as Hive etc. to ensure Hoodie tables can be queried or read via external systems.
Expand Down Expand Up @@ -69,6 +71,10 @@ static HoodieSyncTool instantiateMetaSyncTool(String syncToolClassName,
properties.putAll(props);
properties.put(HoodieSyncConfig.META_SYNC_BASE_PATH.key(), targetBasePath);
properties.put(HoodieSyncConfig.META_SYNC_BASE_FILE_FORMAT.key(), baseFileFormat);
String tableName = properties.getString(HoodieSyncConfig.META_SYNC_TABLE_NAME.key());
if (!tableName.equals(tableName.toLowerCase())) {
LOG.warn("Table name \"" + tableName + "\" contains capital letters. Your metastore may automatically convert this to lower case and can cause table not found errors during subsequent syncs.");
}

if (ReflectionUtils.hasConstructor(syncToolClassName,
new Class<?>[] {Properties.class, Configuration.class})) {
Expand Down

0 comments on commit d5ef8a3

Please sign in to comment.