如何在配置单元中使用scriptVariables(AWS Data Pipeline) [英] How to use scriptVariables in hive (AWS Data Pipeline)

查看:158
本文介绍了如何在配置单元中使用scriptVariables(AWS Data Pipeline)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以使用以下构造将脚本变量传递到AWS数据管道hiveactivity中:


$ scriptVariable $ [
param1 = value1,
param2 = value2
]

我们如何在蜂房中访问这些变量脚本?我一直试图在select语句中使用它们,但没有任何成功:

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

我对配置单元的了解有限。任何帮助,将不胜感激。谢谢。

解决方案

您只需写$ {param1}即可。可以通过使用-d启动配置单元来测试它。


hive -d param1 = 2014-06-20




  select * from something where dt ='$ {param1}'; 


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.

解决方案

just write ${param1}.

You can test it by starting hive with -d.

hive -d param1=2014-06-20

select * from something where dt='${param1}';

这篇关于如何在配置单元中使用scriptVariables(AWS Data Pipeline)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆