比尔特4.6.0
我有以下查询,可以在birt和dbvizulizer中使用:
SELECT t1.keys as SUBSCRIBER_COMPLETE, t1.vals as previous_count, t2.vals as current_count from (
SELECT explode(map('Row Total', SUBSCRIBER_COMPLETE_TOTAL)) as (keys, vals)
FROM my_table
WHERE src_file_dt = '1222') t1,
(
SELECT explode(map('Row Total', SUBSCRIBER_COMPLETE_TOTAL)) as (keys, vals)
FROM my_table
WHERE src_file_dt = '5221') t2
where t1.keys = t2.keys
但当我把它参数化时,它会给我以下的错误
[*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: ParseException line 1:246 cannot recognize input near '?' ')' 't1' in expression specification:17:16
查询方式:
SELECT t1.keys as SUBSCRIBER_COMPLETE, t1.vals as previous_count, t2.vals as current_count from (
SELECT explode(map('Row Total', SUBSCRIBER_COMPLETE_TOTAL)) as (keys, vals)
FROM my_table
WHERE src_file_dt = ?) t1,
(
SELECT explode(map('Row Total', SUBSCRIBER_COMPLETE_TOTAL)) as (keys, vals)
FROM my_table
WHERE src_file_dt = ?) t2
where t1.keys = t2.keys
我甚至把它当作一句话:
SELECT t1.keys as SUBSCRIBER_COMPLETE, t1.vals as previous_count, t2.vals as current_count from (SELECT explode(map('Row Total', SUBSCRIBER_COMPLETE_TOTAL)) as (keys, vals) FROM my_table WHERE src_file_dt = ?) t1, (SELECT explode(map('Row Total', SUBSCRIBER_COMPLETE_TOTAL)) as (keys, vals) FROM my_table WHERE src_file_dt = ?) t2 where t1.keys = t2.keys
1条答案
按热度按时间pkbketx91#
我一直没能成功。这似乎是eclipse/birt中的一个bug
我可以通过替换beforeopen脚本中查询中的变量来解决这个问题,比如