如何通过SSRS报告查询中的ODBC传递参数到Hive LLAP
我正在VS 2019中创建SSRS报告,并使用Cloudera ODBC驱动程序为Apache Hive具有ODBC数据源,并且无法使参数到目前为止工作。
我创建了一个数据集,查询类型文本,如果查询中有静态值,一切正常。我需要创建参数并尝试过,因为据推测使用ODBC时如何指示参数:
select * from clients where client_id = ?
问题是我测试查询或单击“确定”以关闭查询设计器/数据集属性,我收到此错误消息和字段SET不会更新(报告被认为是无效的):
执行查询时发生错误。错误[42000] [Cloudera] [Hardy](80)语法或语义分析错误 执行查询时服务器。服务器的错误消息:错误时 编译语句:失败:ParseException行24:16不能 识别“?”附近的输入在表达式规范中
我尝试了“@”,?”,使用这些字符,使用括号,以及在Google上找到的其他几种变体。我什么时候使用?或 @,SSR弹出标准定义查询参数对话框,但无论我在那里做什么,似乎都没有任何区别。
它几乎就像SSR(或ODBC)没有代替参数占位符,而只是通过它通过它不知道该如何处理它。
有什么想法吗?
I am creating an SSRS report in VS 2019 and have an ODBC datasource using the Cloudera ODBC Driver for Apache Hive and am unable to get parameters to work so far.
I have created a dataset, query type text and everything works fine if I have static values in my query. I need to create parameters and have tried this as it is supposedly how to indicate parameters when using ODBC:
select * from clients where client_id = ?
The issue is when I test the query or click 'ok' to close the query designer/dataset properties I receive this error message and the field set does not update (and report is considered invalid):
An error occurred while executing the query. ERROR [42000]
[Cloudera][Hardy] (80) Syntax or semantic analysis error thrown in
server while executing query. Error message from server: Error while
compiling statement: FAILED: ParseException line 24:16 cannot
recognize input near '?' in expression specification
I have tried "@", "?", using [] around those characters, using parenthesis, and several other variations I found on google. When I use the ? or @, SSRS pops-up the standard define query parameters dialog but no matter what I do there it does not seem to make any difference.
It is almost like SSRS (or ODBC) is not substituting the parameter placeholder and just passing it through which HIVE does not know what to do with it.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过传递到数据集的过滤器来使用参数,但它不是优化的解决方案,另一个解决方法是将您的查询包装在expression
=“从表_a中select select name where en gengender ='”& parameter_name.value& “'”
手动定义字段并查看报告。
如果您找到其他解决方案,请纠正此问题
I use parameters by passing into filters of the dataset but its not a optimized solution another workaround is wrap your query inside an expression
="select name from table_a where gender='" & parameter_name.value & "'"
define fields manually and view the report.
If you find any other solution kindly correct this