28

How do you view the value of a hive variable you have set with the command "SET a = 'B,C,D'"? I don't want to use the variable- just see the value I have set it to. Also is there a good resource for Hive documentation like this? The Apache website is not very helpful.

abu
  • 898
  • 1
  • 7
  • 14

3 Answers3

46

Found my answer. The answer is simply: "Set a;" Stupid syntax IMO, but thats the way it is.

abu
  • 898
  • 1
  • 7
  • 14
12

Another way to view the value of a variable is via the hiveconf variable

hive> select ${hiveconf.a};

where a is the variable name

To see the values of all the variables, simply type

set -v
Abbas Gadhia
  • 13,110
  • 8
  • 53
  • 66
11

The bellow will set the value of zzz

hive> set zzz=5;

To see what value in zzz use the bellow command

hive> set zzz;
zzz=5
Sachin Sukumaran
  • 619
  • 1
  • 8
  • 21