Q:

How to convert decimal value at run time in hive

I need to convert amount value to decimal based on number specified in indicator field 
for eg. if  amount is 20000 and dec_indicator has value 2 then amount will be 200.00
if  amount is 500 and dec_indicator has value 1 then amount will be 50.0 and so on 
Decimal position value is coming from dec_indicator column in the same table 
i tried below
select decimal(amount,dec_indicator) as new_col from data_table ;

Its not working
how to achieve that in hive

A:

with t as (select 12345 as amount,2 as dec_indicator)
select  amount / power(10,dec_indicator)
from    t
;

123.45

