sql参数

i1icjdpr  于 2021-06-26  发布在  Impala
关注(0)|答案(1)|浏览(426)

关于在impala上运行的查询,我有一个简单的问题(我使用pentaho报表设计器作为我的报表工具)。查询是:

select a.*, b.sentatmosphere, b.sentgeneral, b.sentnetcharge, b.sentnetqual, b.sentservice, b.senttidiness 
from p_country_town_hotel a left outer join p_hotel_rev_agg  b on (a.hotel = b.key)  
where a.country = ${Cntry} order by a.City   limit 10000

在pentaho报表设计器中失败。原因是参数,因为如果我将where子句更改为: a.country = 'Denmark' 然后我得到结果(准确地说是子弹,这就是为什么我们要用这个)。我知道pentaho想用它的参数来写 ${} ,但我还没有找到关于 Impala 使用/不使用参数的信息。有什么信息,想法,什么吗?

fnvucqvd

fnvucqvd1#

您是否尝试使用环境变量或配置单元配置变量参数化hql。你能试试。。。

select a.*, b.sentatmosphere, b.sentgeneral, b.sentnetcharge, b.sentnetqual, b.sentservice, b.senttidiness from p_country_town_hotel a left outer join p_hotel_rev_agg b on (a.hotel = b.key)
where a.country = ${env:Cntry} order by a.City limit 10000

select a.*, b.sentatmosphere, b.sentgeneral, b.sentnetcharge, b.sentnetqual, b.sentservice, b.senttidiness from p_country_town_hotel a left outer join p_hotel_rev_agg b on (a.hotel = b.key)
where a.country = ${hiveconf:Cntry} order by a.City limit 10000

相关问题