mirror of
https://github.com/apache/sqoop.git
synced 2025-05-02 21:43:33 +08:00
SQOOP-3423 Let user pass password to connect Hive when it set to LDAP authentication
Amendum commit. Enabling usage of empy password and mentioning LDAP auth in hive.txt Change-Id: I102ab6e520fcd0f0030106300c90c86f3ccfc7f9
This commit is contained in:
parent
feb9f1db93
commit
0560c845e4
@ -48,7 +48,7 @@ Sqoop will use +$HIVE_HOME/bin/hive+ from here.
|
||||
will not be transferred via the JDBC connection it is written directly to HDFS
|
||||
just like in case of the default hive import. As HiveServer2 provides proper
|
||||
authorization and auditing features it is recommended to use this instead of
|
||||
the default. Currently only Kerberos authentication and text file format is
|
||||
the default. Currently only Kerberos and LDAP authentication and text file format is
|
||||
supported with this option.
|
||||
|
||||
NOTE: This function is incompatible with +\--as-avrodatafile+ and
|
||||
|
@ -34,7 +34,7 @@ public class HiveServer2ConnectionFactoryInitializer {
|
||||
|
||||
public JdbcConnectionFactory createJdbcConnectionFactory(SqoopOptions sqoopOptions) {
|
||||
String connectionUsername = determineConnectionUsername(sqoopOptions);
|
||||
String connectionPassword = determineConnectionPassword(sqoopOptions);
|
||||
String connectionPassword = sqoopOptions.getHs2Password();
|
||||
JdbcConnectionFactory connectionFactory = new HiveServer2ConnectionFactory(
|
||||
sqoopOptions.getHs2Url(),
|
||||
connectionUsername,
|
||||
@ -57,13 +57,6 @@ private String determineConnectionUsername(SqoopOptions sqoopOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
private String determineConnectionPassword(SqoopOptions sqoopOptions) {
|
||||
if (!isEmpty(sqoopOptions.getHs2Password())) {
|
||||
return sqoopOptions.getHs2Password();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private KerberosAuthenticator createKerberosAuthenticator(SqoopOptions sqoopOptions) {
|
||||
return new KerberosAuthenticator(sqoopOptions.getConf(), sqoopOptions.getHs2User(), sqoopOptions.getHs2Keytab());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user