gpt4 book ai didi

hadoop - 在 Hive 中将日期作为命令行参数传递

转载 作者:可可西里 更新时间:2023-11-01 14:15:07 27 4
gpt4 key购买 nike

我在 test1.hql 文件 中有以下查询。我正在尝试将 date (dt) 作为命令行参数传递。

select * from lip_data_quality where dt = '${hiveconf: start_date}';

所以每当我尝试像这样从 shell 提示符运行上面的 test1.hql 文件时-

 hive -f hivetest1.hql -hiveconf start_date=20120709

我得到零条记录。但是该特定日期的数据在该表中。为什么会这样?我做错了什么?

有人可以帮我吗?我在关注 Bejoy's Article

我正在使用 Hive 0.6

最佳答案

消除 hiveconf: 和 start_date 之间的空格。

这可能只针对字符串类型,但 Hive 在这方面很挑剔。

关于hadoop - 在 Hive 中将日期作为命令行参数传递,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11804353/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com