pentaho 在对中文query过滤时候报500错误,如何解决?

在使用Pentaho时遇到一个500错误,问题出现在对包含中文的SQL查询上。尽管SQL在客户端能够正确查询,但在控制台和日志中显示结果为0,并报错。分析认为是字符集编码导致的问题,尽管数据库、表和行编码都设置为utf8,但在Pentaho数据源配置中设置characterEncoding无效。替换中文为英文后,查询恢复正常。通过开启mondrian.log和mondrian_mdx.log日志,以及启动Pentaho的debug模式,发现查询可以正常运行,但尚未找到问题的根本原因。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

SQL语句通过日志拿到,在客户端可以查询到结果。


但是在控制台打印日志发现返回结果为0

pentaho.log也进行了报错。

页面报500错误,


这样看应该是字符集编码的问题,数据库和表以及行俺都是utf8,在pentaho配置数据源option没有配置characterEncoding, 如果进行了设置还是报参数无效。


如果把云南省替换成 英文就没有问题可以进行过滤查询。


通过log4j.xml带开了mondrian.log和mondrian_mdx.log,另外启动pentaho采用了debug方式 ./start-pentaho-debug.sh ,查询竟然正常了。目前没有发现什么规律。

2014-03-25 10:06:51,504 DEBUG [mondrian.sql] 15: SqlTupleReader.readTuples [[Agent.Default].[Agent Code]]: executing sql [select `t_data_place_cater_order`.`agent_code` as `c0` from `t_data_place_cater_order` as `t_data_place_cater_order`, `t_dim_business` as `t_dim_business` where `t_data_place_cater_order`.`shop_id` = `t_dim_business`.`shop_id` and `t_dim_business`.`province` = '上海市' group by `t_data_place_cater_order`.`agent_code` order by ISNULL(`t_data_place_cater_order`.`agent_code`) ASC, `t_data_place_cater_order`.`agent_code` ASC]
2014-03-25 10:06:51,683 DEBUG [mondrian.sql] 15: , exec 178 ms
2014-03-25 10:06:51,683 DEBUG [mondrian.sql] 15: , exec+fetch 179 ms, 3 rows


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值