nexr / RHive

RHive is an R extension facilitating distributed computing via Apache Hive.
http://nexr.github.io/RHive
122 stars 63 forks source link

Cannot modify mapred.child.env at runtime, persists after modifying the hive-site.xml file #99

Open jingjingyangg opened 8 years ago

jingjingyangg commented 8 years ago

I am trying to use RHive package to connect to Hive on Hortonworks Data Platform 2.4. When I execute:

rhive.connect(host="192.168.56.101",port=10000, hiveServer2=TRUE)

I received the following error message:

Cannot modify mapred.child.env at runtime. It is not in list of params that are allowed to be modified at runtime.

I inserted the following property and value in the hive-site.xml file, as suggested by some other posts:

hive.security.authorization.sqlstd.confwhitelist.append mapred.child.env

But i am still getting the same error. Any suggestion? Thanks in advance!

jakemoon commented 8 years ago

Did you restart hive-server2 after change hive-site.xml?

Hive does not support reload configuration at runtime.

jingjingyangg commented 8 years ago

@jakemoon Hi, thank you for the reply. No I did not restart hive-server2. Do you know how I can do that? Apologies I am a complete newbie.

jakemoon commented 8 years ago

If you use HDP, you can manage services via ambari.

http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.1/bk_Ambari_Users_Guide/content/ch_managing_services.html

jingjingyangg commented 8 years ago

@jakemoon Thank you for the link. I followed the instruction and restarted hive-server2. The original error message is gone, but I am getting a new one:

Cannot modify RHIVE_UDF_DIR at runtime. It is not in list of params that are allowed to be modified at runtime.

I tried adding RHIVE_UDF_DIR to the same property next to mapred.child.env:

hive.security.authorization.sqlstd.confwhitelist.append mapred.child.env, RHIVE_UDF_DIR

This brings me back the error message about mapred.child.env again. I also tried:

hive.security.authorization.sqlstd.confwhitelist.append mapred.child.env, query\.invoker|RHIVE_UDF_DIR

As per #92 , but this did not do it, either

jakemoon commented 8 years ago

try this

hive.security.authorization.sqlstd.confwhitelist.append=mapred.child.env|query.invoker|RHIVE_UDF_DIR

and restart hive-server2

jingjingyangg commented 8 years ago

That did not resolve the issue :( I am getting the same mapred.child.env cannot be modified error.

jingjingyangg commented 8 years ago

@taeyoung-yoon Hi there, this is very similar to an issue that you helped solve, so if you could offer some insights here, it would be greatly appreciated!

taeyoung-yoon commented 8 years ago

@jingjingyangg I think that Jake's comment is the correct and it is enough to solve your problem.

Anyway, please try again with the following steps.

<property>
    <name>hive.security.authorization.sqlstd.confwhitelist.append</name>    <value>mapred\.child\.env|query\.invoker|RHIVE_UDF_DIR</value>
    <description>Java regexes, to be appended to list set in
        hive.security.authorization.sqlstd.confwhitelist. Using this list instead
        of updating the original list means that you can append to the defaults
        set by SQL standard authorization instead of replacing it entirely.
    </description>
</property>

The value should be Java Regex but not a comma separated list. Please don't make changes to hive.security.authorization.sqlstd.confwhitelist configuration in hive-site.xml If you set any value to the hive.security.authorization.sqlstd.confwhitelist configuration, it will overwrite the default white list properties. You can check the default value in your Hive env. through beeline command or your Hive user interface(query editor?) on HDP.

set hive.security.authorization.sqlstd.confwhitelist

So it would be much easier to manage the white list properties with '~confwhitelist.append' rather than '~confwhitelist'.

0: jdbc:hive2://localhost:10000> set hive.security.authorization.sqlstd.confwhitelist.append;

The results should be as below.

hive.security.authorization.sqlstd.confwhitelist.append=mapred\.child\.env|query\.invoker|RHIVE_UDF_DIR
jingjingyangg commented 8 years ago

@taeyoung-yoon Thanks a lot for the detailed reply. I followed all the steps(added the property in the .xml file, saved the file and then restarted the hive server), but strangely when I ran "set hive.security.authorization.sqlstd.confwhitelist.append' in the query editor, it says the property is undefined. But finally I was able to define it on Ambari at Services -> Hive -> Configs -> Advanced -> Custom hive-site -> Add Property and manually added a property named "hive.security.authorization.sqlstd.confwhitelist.append' with a value of "mapred.child.env|query.invoker|RHIVE_UDF_DIR". This enabled a successful connection with Hive.

@jakemoon @taeyoung-yoon thank you so much to both of you for your help!