Calculate expression in HIVE installation applications

In my hive requests, some variables are set.

However, I realized that the bush remembers the expression, not the value, for example:

set a=1 ; set b=2 ; set c= ${hiveconf:a} + ${hiveconf:b} ; set c ; -- the command above returns -- c=1 + 2 

Why doesn't Hive value value? Is there a way to set the hive so that set c ; will return c= 3 in the previous example?

+5
source share
1 answer

Usually at a point, you only define variables in the CLI. Evaluation will be carried out during a map run, for example.

 SELECT ${hiveconf:c} FROM yourTable LIMIT 1; 

will give you the calculated value of c.

+1
source

Source: https://habr.com/ru/post/1204621/


All Articles