Created 11-02-2015 08:50 PM
In the Hadoop config files, we have some limited variable substitution, e.g. ${user.name} is replaced by the Linux-level effective user of the hadoop daemon that accesses a given config. Is there a substitution variable to get the Hadoop-level effective user? For instance, if I connect as “jkotireddy” to HiveServer2 using Beeline, ${user.name} expands to "hive" because that's the Linux-level effective user of HiveServer2; are there any other configuration variables which gives “jkotireddy” ?
Created 11-02-2015 09:13 PM
Remember when you connect to HiveServer2 over JDBC you are running commands at the HiveServer2, so your client environment properties are not available. You can however pass additional properties at the time of initiating beeline session:
$ beeline -hiveconf hs2.connect.user=deepesh beeline> !connect jdbc:hive2://localhost:10000 hrt pwd scan complete in 2ms Connecting to jdbc:hive2://localhost:10000 Transaction isolation: TRANSACTION_REPEATABLE_READ 0: jdbc:hive2://localhost:10000> set hs2.connect.user; +---------------------------+--+ | set | +---------------------------+--+ | hs2.connect.user=deepesh | +---------------------------+--+ 1 row selected (0.112 seconds)
Created 11-02-2015 09:13 PM
Remember when you connect to HiveServer2 over JDBC you are running commands at the HiveServer2, so your client environment properties are not available. You can however pass additional properties at the time of initiating beeline session:
$ beeline -hiveconf hs2.connect.user=deepesh beeline> !connect jdbc:hive2://localhost:10000 hrt pwd scan complete in 2ms Connecting to jdbc:hive2://localhost:10000 Transaction isolation: TRANSACTION_REPEATABLE_READ 0: jdbc:hive2://localhost:10000> set hs2.connect.user; +---------------------------+--+ | set | +---------------------------+--+ | hs2.connect.user=deepesh | +---------------------------+--+ 1 row selected (0.112 seconds)
Created 11-03-2015 12:49 PM
@Deepesh i required to get the user . if i call the variable ${user.name} - i will get the value as hive, but i required to get the user . The reason we'd like this is to store AWS access credentials for S3 on each user's HDFS directory (e.g., hdfs://user/jkotireddy/aws_credentials) and have the S3 libraries automatically pick them up. We'd like to set this variable to something like "hdfs://user/${user.name}/aws_credentials". - want a config variable which gives me the Hadoop-level effective user.