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.
You may have to write additional lines in your hive script to view the values/redirect them to a separate file. As far as I know there is no such config property. You may have to write additional lines in your hive script to view the values/redirect them to a separate file.
Bookmark this question. Show activity on this post. ./hive -e "use telecom;insert overwrite local directory '/tmp/result' select avg(a) from abc;" ./hive --hiveconf MY_VAR =`cat /tmp/result/000000_0`;
You need to use the special hiveconf for variable substitution. e.g. Note that there are env and system variables as well, so you can reference ${env:USER} for example.
Hive variables are key-value pairs that can be set using the set command and they can be used in scripts and Hive SQL. The values of the variables in Hive scripts are substituted during the query construct.
Found my answer. The answer is simply: "Set a;" Stupid syntax IMO, but thats the way it is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With