Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class HoodieCatalogFactory implements CatalogFactory {
private static final Logger LOG = LoggerFactory.getLogger(HoodieCatalogFactory.class);

public static final String IDENTIFIER = "hudi";
public static final String HADOOP_PREFIX = "hadoop.";

@Override
public String factoryIdentifier() {
Expand All @@ -50,7 +51,7 @@ public String factoryIdentifier() {
public Catalog createCatalog(Context context) {
final FactoryUtil.CatalogFactoryHelper helper =
FactoryUtil.createCatalogFactoryHelper(this, context);
helper.validate();
helper.validateExcept(HADOOP_PREFIX);
String mode = helper.getOptions().get(CatalogOptions.MODE);
switch (mode.toLowerCase(Locale.ROOT)) {
case "hms":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ public class HoodieCatalogUtil {
* @param hiveConfDir Hive conf directory path.
* @return A HiveConf instance.
*/
public static HiveConf createHiveConf(@Nullable String hiveConfDir) {
public static HiveConf createHiveConf(@Nullable String hiveConfDir, @Nullable org.apache.flink.configuration.Configuration flinkConf) {
// create HiveConf from hadoop configuration with hadoop conf directory configured.
Configuration hadoopConf = HadoopConfigurations.getHadoopConf(new org.apache.flink.configuration.Configuration());
final org.apache.flink.configuration.Configuration flinkConfiguration = flinkConf == null ? new org.apache.flink.configuration.Configuration() : flinkConf;
Configuration hadoopConf = HadoopConfigurations.getHadoopConf(flinkConfiguration);

// ignore all the static conf file URLs that HiveConf may have set
HiveConf.setHiveSiteLocation(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public class HoodieHiveCatalog extends AbstractCatalog {
private final boolean external;

public HoodieHiveCatalog(String catalogName, Configuration options) {
this(catalogName, options, HoodieCatalogUtil.createHiveConf(options.getString(CatalogOptions.HIVE_CONF_DIR)), false);
this(catalogName, options, HoodieCatalogUtil.createHiveConf(options.getString(CatalogOptions.HIVE_CONF_DIR), options), false);
}

public HoodieHiveCatalog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static HoodieHiveCatalog createHiveCatalog(String name) {

public static HoodieHiveCatalog createHiveCatalog(String name, boolean external) {
Configuration options = new Configuration();
options.setString("hadoop.dfs.client.block.write.replace-datanode-on-failure.enable", "true");
options.setBoolean(CatalogOptions.TABLE_EXTERNAL, external);
return new HoodieHiveCatalog(
name,
Expand Down