Skip to content

Commit

Permalink
[Hotfix][Connector-V2][Hive] Support user-defined hive-site.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
TyrantLucifer committed Jun 28, 2023
1 parent 5fbfd05 commit fb7345d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public class HiveConfig {
.stringType()
.noDefaultValue()
.withDescription("Hive metastore uri");

public static final Option<String> HIVE_SITE_PATH =
Options.key("hive_site_path")
.stringType()
.noDefaultValue()
.withDescription("The path of hive-site.xml");
public static final String TEXT_INPUT_FORMAT_CLASSNAME =
"org.apache.hadoop.mapred.TextInputFormat";
public static final String TEXT_OUTPUT_FORMAT_CLASSNAME =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ private HiveMetaStoreProxy(Config config) {
Configuration configuration = new Configuration();
FileSystemUtils.doKerberosAuthentication(configuration, principal, keytabPath);
}
if (config.hasPath(HiveConfig.HIVE_SITE_PATH.key())) {
hiveConf.addResource(config.getString(HiveConfig.HIVE_SITE_PATH.key()));
}
try {
hiveMetaStoreClient = new HiveMetaStoreClient(hiveConf);
} catch (MetaException e) {
Expand Down

0 comments on commit fb7345d

Please sign in to comment.