Skip to content

Commit

Permalink
[HUDI-5074] Warn if table for metastore sync has capitals in it (apac…
Browse files Browse the repository at this point in the history
…he#7077)


Co-authored-by: Jonathan Vexler <=>
  • Loading branch information
jonvex authored and Alexey Kudinkin committed Dec 14, 2022
1 parent a2a3afd commit 61710f7
Showing 1 changed file with 7 additions and 1 deletion.
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 61710f7

Please sign in to comment.