Database Reference
In-Depth Information
WARNING
If you plan to have more than one Hive user sharing a Hadoop cluster, you need to make the directories
that Hive uses writable by all users. The following commands will create the directories and set their per-
missions appropriately:
%
hadoop fs -mkdir /tmp
%
hadoop fs -chmod a+w /tmp
%
hadoop fs -mkdir -p /user/hive/warehouse
%
hadoop fs -chmod a+w /user/hive/warehouse
If all users are in the same group, then permissions
g+w
are sufficient on the warehouse directory.
You can change settings from within a session, too, using the
SET
command. This is use-
ful for changing Hive settings for a particular query. For example, the following command
hive>
SET hive.enforce.bucketing=true;
To see the current value of any property, use
SET
with just the property name:
hive>
SET hive.enforce.bucketing;
hive.enforce.bucketing=true
By itself,
SET
will list all the properties (and their values) set by Hive. Note that the list
will not include Hadoop defaults, unless they have been explicitly overridden in one of the
ways covered in this section. Use
SET -v
to list all the properties in the system, includ-
ing Hadoop defaults.
There is a precedence hierarchy to setting properties. In the following list, lower numbers
take precedence over higher numbers:
1. The Hive
SET
command
2. The command-line
-hiveconf
option
3.
hive-site.xml
and the Hadoop site files (
core-site.xml
,
hdfs-site.xml
,
mapred-
site.xml
, and
yarn-site.xml
)
4. The Hive defaults and the Hadoop default files (
core-default.xml
,
hdfs-de-
fault.xml
,
mapred-default.xml
, and
yarn-default.xml
)
Setting configuration properties for Hadoop is covered in more detail in
Which Properties