zoukankan
html css js c++ java
hive使用小技巧如何往Hive SQL中传入参数
很多SQL需要重复执行,可能是每天执行一次,而需要修改的只是SQL中的日期字段,这种情况下可以使用 参数代入
使用的方式
$
hive
-d key1=value1 -d key2=value -d key3=value3 ...
复制代码
例子-1:
hive -d shell_date_1='20120425' -d shell_date_2='20120426'
hive> set shell_date_1;
shell_date_1=20120425
hive> set shell_date_2;
shell_date_2=20120426
hive> explain select * from dual where user_id = ${shell_date_1};
复制代码
这里面的 shell_date_1 会替换为 20120425
例子-2:
hive -d shell_date_1='20120425' -d shell_date_2='20120426' \
-e "explain select * from dual where user_id = ${shell_date_1}"
复制代码
例子-3:
vim hive.sql
复制代码
内容为:
explain select * from dual where user_id = ${shell_date_1}
hive -d shell_date_1='20120425' -f hive.sql
复制代码
查看全文
相关阅读:
python的编码判断_unicode_gbk/gb2312_utf8(附函数)
stat文件状态信息结构体
内核配置中 ramdisk 大小修改
mount命令详解
dirent和DIR 结构体 表示文件夹中目录内容信息
nandwrite 参数
mke2fs 制作ext2文件系统image
ext2文件系统错误
照度/感光度(Lux)
摄像机的几个重要的技术指标
原文地址:https://www.cnblogs.com/java20130722/p/3206939.html
最新文章
函数的渐近增长表3
函数的渐近增长
函数的渐近增长表4
函数的渐近增长
函数的渐近增长表3
函数的渐近增长
函数的渐近增长
函数的渐近增长表4
函数的渐近增长
函数的渐近增长
热门文章
前端规范
ajax用get方法中文传值的转义方法
css的重点,难点
css的重点,难点
前端规范
[转载]前端工程师应该关注什么
[原创 js]复选框不能超过3个
[原创 js]复选框不能超过3个
[转载]前端工程师应该关注什么
公共css文件
Copyright © 2011-2022 走看看