[
https://issues.apache.org/jira/browse/OPTIQ-437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14167650#comment-14167650
]
Tom Barber commented on OPTIQ-437:
----------------------------------
Okay I think what it is is the foodmart sample I have has SMALLINT data types
in it, but the core doesn't understand SMALLINT(Small) datatypes.
> Cast Class Exception at Baz$12.apply
> ------------------------------------
>
> Key: OPTIQ-437
> URL: https://issues.apache.org/jira/browse/OPTIQ-437
> Project: Optiq
> Issue Type: Bug
> Affects Versions: 0.9.1-incubating
> Reporter: Tom Barber
> Assignee: Julian Hyde
> Attachments: 0001-classcasttest.patch
>
>
> I can't validate this cause I can't get the suite to run but I think this is
> more than just a mongo bug. I've attached a patch to the mongo test suite
> that causes a class cast exception on my build when i run the query in SQLLine
> Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error:
> Error while loading segment; sql=[select "time_by_day"."the_year" as "c0",
> "product_class"."product_family" as "c1", "prod
> uct_class"."product_department" as "c2", "product_class"."product_category"
> as "c3", count("sales_fact_1997"."product_id") as "m0" from "sales_fact_1997"
> as "sales_fact_1997", "time_by_day" as "tim
> e_by_day", "product" as "product", "product_class" as "product_class" where
> "time_by_day"."the_year" = 1997 and "sales_fact_1997"."time_id" =
> "time_by_day"."time_id" and "sales_fact_1997"."product_
> id" = "product"."product_id" and "product"."product_class_id" =
> "product_class"."product_class_id" group by "time_by_day"."the_year",
> "product_class"."product_family", "product_class"."product_depa
> rtment", "product_class"."product_category"]
> at
> mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:992)
> at mondrian.olap.Util.newInternal(Util.java:2543)
> at mondrian.olap.Util.newError(Util.java:2559)
> at mondrian.rolap.SqlStatement.handle(SqlStatement.java:362)
> at mondrian.rolap.SqlStatement.execute(SqlStatement.java:262)
> at mondrian.rolap.RolapUtil.executeQuery(RolapUtil.java:346)
> at
> mondrian.rolap.agg.SegmentLoader.createExecuteSql(SegmentLoader.java:633)
> ... 7 more
> Caused by: java.sql.SQLException: exception while executing query:
> java.lang.Integer cannot be cast to java.lang.Short
> at net.hydromatic.avatica.Helper.createException(Helper.java:39)
> at
> net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:406)
> at
> net.hydromatic.avatica.AvaticaStatement.executeQueryInternal(AvaticaStatement.java:350)
> at
> net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:77)
> at
> org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
> at
> org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
> at mondrian.rolap.SqlStatement.execute(SqlStatement.java:202)
> ... 9 more
> Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to
> java.lang.Short
> at Baz$12.apply(Unknown Source)
> at Baz$12.apply(Unknown Source)
> at
> net.hydromatic.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:664)
> at
> net.hydromatic.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:632)
> at
> net.hydromatic.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:284)
> at Baz.bind(Unknown Source)
> at
> net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.getEnumerable(OptiqPrepare.java:270)
> at
> net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.enumerator(OptiqPrepare.java:280)
> at
> net.hydromatic.optiq.jdbc.OptiqPrepare$PrepareResult.createCursor(OptiqPrepare.java:248)
> at net.hydromatic.optiq.jdbc.MetaImpl.createCursor(MetaImpl.java:611)
> at
> net.hydromatic.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:161)
> at
> net.hydromatic.optiq.jdbc.OptiqResultSet.execute(OptiqResultSet.java:58)
> at
> net.hydromatic.optiq.jdbc.OptiqResultSet.execute(OptiqResultSet.java:35)
> at
> net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:404)
> ... 14 more
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)