Gabriel39 commented on code in PR #66890:
URL: https://github.com/apache/doris/pull/66890#discussion_r3803248335
##########
fe/fe-connector/fe-connector-hive/src/main/java/org/apache/doris/connector/hive/HiveConnector.java:
##########
@@ -710,7 +712,17 @@ static HadoopAuthenticator
buildPluginAuthenticator(Map<String, String> properti
return HadoopAuthenticator.getHadoopAuthenticator(
new
KerberosAuthenticationConfig(spec.get().getPrincipal(), spec.get().getKeytab(),
conf));
}
- return null;
+ if (hms.getAuthType() == AuthType.KERBEROS) {
+ return null;
+ }
+ String hadoopUser =
hms.toHiveConfOverrides("").get(AuthenticationConfig.HADOOP_USER_NAME);
+ Configuration conf = buildHadoopConf(properties);
Review Comment:
Fixed in cff1fe75520. Blank and whitespace-only hadoop.username values are
removed during canonical HMS property merging and skipped when applying
configuration overrides, preserving a resource-provided user or the legacy
hadoop default. Added regression coverage for both empty and whitespace-only
values.
##########
fe/fe-connector/fe-connector-hive/src/main/java/org/apache/doris/connector/hive/HiveConnector.java:
##########
@@ -710,7 +712,17 @@ static HadoopAuthenticator
buildPluginAuthenticator(Map<String, String> properti
return HadoopAuthenticator.getHadoopAuthenticator(
new
KerberosAuthenticationConfig(spec.get().getPrincipal(), spec.get().getKeytab(),
conf));
}
- return null;
+ if (hms.getAuthType() == AuthType.KERBEROS) {
+ return null;
+ }
+ String hadoopUser =
hms.toHiveConfOverrides("").get(AuthenticationConfig.HADOOP_USER_NAME);
+ Configuration conf = buildHadoopConf(properties);
+ if (hadoopUser != null) {
+ conf.set(AuthenticationConfig.HADOOP_USER_NAME, hadoopUser);
+ }
+ // HMS set_ugi reads the current UGI, so its simple-auth identity
must match the DFS writer.
+ return HadoopAuthenticator.getHadoopAuthenticator(
+ AuthenticationConfig.getSimpleAuthenticationConfig(conf));
Review Comment:
Fixed in cff1fe75520. HmsClientConfig now carries hive.conf.resources, and
HmsConfHelper loads those XML resources before applying canonical catalog
overrides for both the HiveConf used by the client and the lightweight
Configuration used to resolve UGI. Added a resource-only hadoop.username
regression test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]