Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use scriptVariables in hive (AWS Data Pipeline)

We can pass script variables into AWS data pipeline hiveactivity using the following construct :

"scriptVariable" : [
    "param1=value1",
    "param2=value2"
  ]

How do we access these variables in the hive script? I have been trying to use them in a select statement without any success :

Select ${hiveconf:param1}, dummytable.col1,...
from dummytable where dummytable.id = 1;

My knowledge of hive is limited. Any help with this will be greatly appreciated. Thanks.

like image 865
Santanu C Avatar asked May 01 '14 19:05

Santanu C


1 Answers

just write ${param1}.

You can test it by starting hive with -d.

hive -d param1=2014-06-20

select * from something where dt='${param1}';
like image 95
gevert Avatar answered Nov 18 '22 15:11

gevert