Hi Devs,
I am trying to get Mondrian to run over Kylin but get an exception while
creating a connection to Kylin via Mondrian below are the steps that I have
followed:
1. Setup Kylin using On-hadoop Install
2. Execute the ./sample.sh script to create sample cube in Kylin
3. Build Cube
4. Test queries against the cube. Also tested using JDBC driver.
But when I try to execute MDX using Mondrian on top of Kylin I get an
exception trace as follows:
*[Mondrian Monitor]:[2015-05-20
14:55:34,563][DEBUG][mondrian.server.MonitorImpl$Actor.run(MonitorImpl.java:975)]
- StatementEndEvent(0)*
*java.lang.RuntimeException: cannot convert to long
(net.hydromatic.optiq.runtime.AbstractCursor$StringAccessor@fff056c)*
* at
net.hydromatic.optiq.runtime.AbstractCursor$AccessorImpl.cannotConvert(AbstractCursor.java:287)*
* at
net.hydromatic.optiq.runtime.AbstractCursor$AccessorImpl.getLong(AbstractCursor.java:243)*
* at
net.hydromatic.optiq.runtime.AbstractCursor$AccessorImpl.getInt(AbstractCursor.java:239)*
* at
net.hydromatic.avatica.AvaticaResultSet.getInt(AvaticaResultSet.java:220)*
* at
org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:225)*
* at
mondrian.rolap.aggmatcher.JdbcSchema$Table.loadColumns(JdbcSchema.java:972)*
* at mondrian.rolap.aggmatcher.JdbcSchema$Table.load(JdbcSchema.java:775)*
* at
mondrian.rolap.RolapSchema$PhysTable.populateColumns(RolapSchema.java:1853)*
* at
mondrian.rolap.RolapSchema$PhysRelationImpl.ensurePopulated(RolapSchema.java:1519)*
* at
mondrian.rolap.RolapSchema$PhysTable.ensurePopulated(RolapSchema.java:1729)*
* at
mondrian.rolap.RolapSchemaLoader.registerTable(RolapSchemaLoader.java:1051)*
* at
mondrian.rolap.RolapSchemaLoader.validatePhysicalSchema(RolapSchemaLoader.java:715)*
* at
mondrian.rolap.RolapSchemaLoader.loadStage2(RolapSchemaLoader.java:376)*
* at
mondrian.rolap.RolapSchemaLoader.loadStage1(RolapSchemaLoader.java:336)*
* at
mondrian.rolap.RolapSchemaLoader.loadStage0(RolapSchemaLoader.java:272)*
* at
mondrian.rolap.RolapSchemaLoader.createSchema(RolapSchemaLoader.java:4303)*
* at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:210)*
* at mondrian.rolap.RolapSchemaPool.get(RolapSchemaPool.java:62)*
* at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:160)*
* at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:84)*
* at mondrian.olap.DriverManager.getConnection(DriverManager.java:112)*
* at mondrian.olap.DriverManager.getConnection(DriverManager.java:68)*
* at
mondrian.olap4j.MondrianOlap4jConnection.<init>(MondrianOlap4jConnection.java:153)*
* at
mondrian.olap4j.FactoryJdbc4Plus$AbstractConnection.<init>(FactoryJdbc4Plus.java:323)*
* at
mondrian.olap4j.FactoryJdbc41Impl$MondrianOlap4jConnectionJdbc41.<init>(FactoryJdbc41Impl.java:118)*
* at
mondrian.olap4j.FactoryJdbc41Impl.newConnection(FactoryJdbc41Impl.java:32)*
* at
mondrian.olap4j.MondrianOlap4jDriver.connect(MondrianOlap4jDriver.java:139)*
* at java.sql.DriverManager.getConnection(DriverManager.java:571)*
* at java.sql.DriverManager.getConnection(DriverManager.java:233)*
* at com.fractal.mondrian.kylin.MondrianKylin.main(MondrianKylin.java:27)*
I tried searching a lot but the only link I could find related to this
issue was
https://groups.google.com/forum/#!searchin/optiq-dev/mondrian/optiq-dev/qMd5FyOtp28/-BBsC4ScKe0J
*Kylin Version: 0.7-1*
*Hadoop: 2.6*
*Hbase: 0.98*
*Hive: 1.0.1*
*Mondrian Jar: 4.3*
Attached is the mondrian xml for reference that corresponds to the cube in
Kylin.
I am not pretty sure what am I doing wrong, any help/pointers would be
appreciated a lot. Apologize if this is not a Kylin issue.
I am new to the Kylin community.
Thanks
Divye Sheth
<Schema name="Kylin" caption="Kylin" description="Kylin" metamodelVersion="4.0" Caption="Kylin">
<PhysicalSchema>
<Table name="KYLIN_CAL_DT">
<Key>
<Column name="cal_dt" type="String"/>
</Key>
</Table>
<Table name="KYLIN_CATEGORY_GROUPINGS">
<Key>
<Column name="leaf_categ_id"/>
</Key>
</Table>
<Table name="kylin_sales"/>
</PhysicalSchema>
<Dimension name="Period" table="KYLIN_CAL_DT" type="TIME" key="Date">
<Attributes>
<Attribute name="Year" keyColumn="year_id" hasHierarchy="false" levelType="TimeYears"/>
<Attribute name="Quarter" hasHierarchy="false" levelType="TimeQuarters">
<Key>
<Column name="year_id"/>
<Column name="qtr_of_year_id"/>
</Key>
<Name>
<Column name="qtr_of_year_id"/>
</Name>
</Attribute>
<Attribute name="Month" hasHierarchy="false" levelType="TimeMonths">
<Key>
<Column name="year_id"/>
<Column name="month_of_year_id"/>
</Key>
<Name>
<Column name="month_of_year_id"/>
</Name>
</Attribute>
<Attribute name="Day of Month" hasHierarchy="false" levelType="TimeDays">
<Key>
<Column name="year_id"/>
<Column name="month_of_year_id"/>
<Column name="day_of_month_id"/>
</Key>
<Name>
<Column name="day_of_month_id"/>
</Name>
</Attribute>
<Attribute name="Date" keyColumn="cal_dt" hasHierarchy="false" type="String"/>
</Attributes>
<Hierarchies>
<Hierarchy name="PeriodHierarchy" hasAll="true">
<Level attribute="Year"/>
<Level attribute="Quarter"/>
<Level attribute="Month"/>
<Level attribute="Day of Month"/>
</Hierarchy>
</Hierarchies>
</Dimension>
<Dimension name="Category" table="KYLIN_CATEGORY_GROUPINGS" key="Category_id">
<Attributes>
<Attribute name="Category_id" table="kylin_category_groupings" keyColumn="leaf_categ_id" hasHierarchy="false"/>
<Attribute name="Category Name" table="kylin_category_groupings" keyColumn="meta_categ_name" hasHierarchy="false"/>
</Attributes>
<Hierarchies>
<Hierarchy name="CategoryHierarchy" hasAll="true">
<Level attribute="Category Name"/>
</Hierarchy>
</Hierarchies>
</Dimension>
<Cube name="Data Cube">
<Dimensions>
<Dimension source="Period"/>
<Dimension source="Category"/>
</Dimensions>
<MeasureGroups>
<MeasureGroup name="Syndicated" table="KYLIN_SALES">
<Measures>
<Measure name="Price" column="price" aggregator="sum" formatString="#,###" datatype="String"/>
<Measure name="Count" column="price" aggregator="count" formatString="#,###" datatype="Integer"/>
</Measures>
<DimensionLinks>
<ForeignKeyLink dimension="Period" foreignKeyColumn="Date"/>
<ForeignKeyLink dimension="Category" foreignKeyColumn="Category_id"/>
</DimensionLinks>
</MeasureGroup>
</MeasureGroups>
</Cube>
</Schema>