Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jingjingyangg opened this issue Jul 14, 2016 · 9 comments

Comments

@jingjingyangg
Copy link

jingjingyangg commented Jul 14, 2016

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
Copy link
Contributor

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

Hive does not support reload configuration at runtime.

@jingjingyangg
Copy link
Author

jingjingyangg commented Jul 15, 2016

@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
Copy link
Contributor

@jingjingyangg
Copy link
Author

jingjingyangg commented Jul 18, 2016

@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
Copy link
Contributor

jakemoon commented Jul 19, 2016

try this

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

and restart hive-server2

@jingjingyangg
Copy link
Author

jingjingyangg commented Jul 19, 2016

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

@jingjingyangg
Copy link
Author

@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
Copy link

taeyoung-yoon commented Jul 20, 2016

@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.

  • Open and edit the 'hive-site.xml' on your HDP Hive and add "hive.security.authorization.sqlstd.confwhitelist.append" configuration as below.
<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'.

  • Restart you Hive Server(hive-server2).
  • Please double check the '~confwhitelist.append' value.
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
  • And now, try again RHive command.

@jingjingyangg
Copy link
Author

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants