3

I am connecting to Hive using beeline.

I'd like to provide the properties of hive-site.xml from a different directory of $HIVE_HOME/conf. The reason is that we do not have permission to $HIVE_HOME/conf directory nor the /etc/hive/conf directory.

I have made a hive-site.xml in the $HADOOP_HOME/conf; however, the properties do not get picked up.

I have looked into the output of "set -v" to see the default properties; however I do not know where these properties are coming from since they do not even reflect the hive-site.xml in the $HIVE_HOME/conf nor etc/hive/conf.

My first question is: where could the default properties be coming from? More importantly: How can I provide the hive-site.xml myself and override existing properties?

Note: I'm aware that we can use "set [property]=[value];" in hive but since another program will be using hive which can only do sql queries and cannot do set commands, I'm hoping to do this through hive-site.xml.

azimos
  • 55
  • 4
  • Yes, I have set the HADOOP_CONF_DIR but the properties in hive-site.xml in that directory does not get picked up. – azimos May 11 '18 at 20:36
  • _[take 2]_ The legacy `hive` CLI is a fat client, that consumes a local `hive-site.xml` to set the session properties on startup. But Beeline is a thin JDBC client -- it's **HiveServer2** that sets the default properties on session startup, using whatever `hive-site.xml` and `hiveserver2-site.xml` it has in its server-side CLASSPATH. So you have no choice but to reset property values with `set` commands on session startup, each and every time... – Samson Scharfrichter May 11 '18 at 22:38
  • BTW the `set` command can be used in `hive` CLI, in `beeline` thin JBDC client, and in _any_ JDBC / ODBC client. What do you mean by _"another program ... can only do sql queries and cannot do set commands"_ ??? – Samson Scharfrichter May 11 '18 at 22:40
  • About setting multiple properties on startup: cf. https://cwiki.apache.org/confluence/display/Hive/HiveServer2%2BClients#HiveServer2Clients-BeelineCommands under _" `-i` (or) `--init` "_ – Samson Scharfrichter May 11 '18 at 22:42
  • Thank you Samson for your response. Your comment about beeline being a thin JDBC client and the HiveServer2 setting the default properties was helpful. Ultimately I asked this question because I am using NiFi in order to insert data into Hive; I will ask this question more specific to NiFi. – azimos May 15 '18 at 15:50

0 Answers0