You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@kylin.apache.org by 魏龙星 <wl...@gmail.com> on 2016/01/22 08:46:46 UTC

Sql problem when using saiku, mondrian and kylin.

I tried to use saiku, mondrian and kylin according to
https://github.com/mustangore/kylin-mondrian-interaction.

I build a cube in kylin use two tables as the picture below:
[image: pasted3]

I also build a cube in Saiku as below:
[image: pasted2]
The measures new_num is sum of is_new and order_num is sum of order_pay_num.

Here is the problem.
When I use Saiku, I got the error:
IOException: org.apache.commons.httpclient.methods.PostMethod@697d2a4e
failed, error code 500 and response: {"url":"
http://10.10.163.68:7070/kylin/api/query","exception":"[Ljava.lang.Object;
cannot be cast to java.lang.Integer\nwhile executing SQL: \"select
\"DIM_ENTERPRISE\".\"ID\" as \"c0\" from \"DIM_ENTERPRISE\" as
\"DIM_ENTERPRISE\" group by \"DIM_ENTERPRISE\".\"ID\" order by CASE WHEN
\"DIM_ENTERPRISE\".\"ID\" IS NULL THEN 1 ELSE 0 END,
\"DIM_ENTERPRISE\".\"ID\" ASC\""}
I use the sql in Kylin and also get the same error.

However, when I use the same saiku schema and use mysql to store the data.
I got different sql and it works:
select
`dim_enterprise`.`kdt_id` as `c0`,
sum(`fact_qyd_enterprise_d`.`is_new`) as `m0`
from
`fact_qyd_enterprise_d` as `fact_qyd_enterprise_d`,
`dim_enterprise` as `dim_enterprise`
where
`fact_qyd_enterprise_d`.`kdt_id` = `dim_enterprise`.`kdt_id`
group by
`dim_enterprise`.`kdt_id`

I searched and didn't find much useful. I guess it's maybe
the mondrian-4.4-lagunitas-SNAPSHOT-with-kylin-dialect.jar. Any suggestions?

Thanks.

Longxing

Re: Sql problem when using saiku, mondrian and kylin.

Posted by 魏龙星 <wl...@gmail.com>.
It's my cube problem. I fixed it.

魏龙星 <wl...@gmail.com>于2016年1月22日周五 下午3:46写道:

> I tried to use saiku, mondrian and kylin according to
> https://github.com/mustangore/kylin-mondrian-interaction.
>
> I build a cube in kylin use two tables as the picture below:
> [image: pasted3]
>
> I also build a cube in Saiku as below:
> [image: pasted2]
> The measures new_num is sum of is_new and order_num is sum of
> order_pay_num.
>
> Here is the problem.
> When I use Saiku, I got the error:
> IOException: org.apache.commons.httpclient.methods.PostMethod@697d2a4e
> failed, error code 500 and response: {"url":"
> http://10.10.163.68:7070/kylin/api/query","exception":"[Ljava.lang.Object;
> cannot be cast to java.lang.Integer\nwhile executing SQL: \"select
> \"DIM_ENTERPRISE\".\"ID\" as \"c0\" from \"DIM_ENTERPRISE\" as
> \"DIM_ENTERPRISE\" group by \"DIM_ENTERPRISE\".\"ID\" order by CASE WHEN
> \"DIM_ENTERPRISE\".\"ID\" IS NULL THEN 1 ELSE 0 END,
> \"DIM_ENTERPRISE\".\"ID\" ASC\""}
> I use the sql in Kylin and also get the same error.
>
> However, when I use the same saiku schema and use mysql to store the data.
> I got different sql and it works:
> select
> `dim_enterprise`.`kdt_id` as `c0`,
> sum(`fact_qyd_enterprise_d`.`is_new`) as `m0`
> from
> `fact_qyd_enterprise_d` as `fact_qyd_enterprise_d`,
> `dim_enterprise` as `dim_enterprise`
> where
> `fact_qyd_enterprise_d`.`kdt_id` = `dim_enterprise`.`kdt_id`
> group by
> `dim_enterprise`.`kdt_id`
>
> I searched and didn't find much useful. I guess it's maybe
> the mondrian-4.4-lagunitas-SNAPSHOT-with-kylin-dialect.jar. Any suggestions?
>
> Thanks.
>
> Longxing
>