I have been struggling to get a simple OLAP example to work against our development database after a nice presentation from the JasperSoft folks. When I dig into the error message it turns out the SQL query being generated actually contains the name of my fact table twice in the from clause. Of course Oracle throws an error saying the statement is not properly ended. I have double checked the data source, foreign keys, table names and so forth. Any help is greatly appreciated!
Simple Schema definition:
Simple Schema definition:
Code: |
<br /> <Schema name="EdwardSchema"><br /> <Cube name="QuickClick"><br /> <Table name="VASDS.SDS_ASSMT_RESULT_QC"/><br /> <Dimension name="Grade" foreignKey="GRADE_ID"><br /> <Hierarchy hasAll="true" allMemberName="All Grades" primaryKey="GRADE_ID"><br /> <Table name="VAMDS.MDS_GRADE"/><br /> <Level name="Grade" column="GRADE_CODE" uniqueMembers="true"/><br /> </Hierarchy><br /> </Dimension> <br /> <Measure name="Pass Count" column="PASS_CNT" aggregator="sum" formatString="#"/> <br /> </Cube><br /> </Schema><br /> </td></tr></tbody></table><br /> Simple MDX query:<br /> <br /> <table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre><br /> select {[Measures].[Pass Count]} ON COLUMNS,{[Grade].[All Grades]} ON ROWS FROM [QuickClick]<br /> </td></tr></tbody></table><br /> <br /> Nasty Error Returned:<br /> <br /> JPivot had an error ...<br /> org.apache.jasper.JasperException: javax.servlet.jsp.el.ELException: An error occurred while getting property "result" from an instance of class com.tonbeller.jpivot.tags.OlapModelProxy<br /> <br /> Digging into the log file a little results in finding the following…<br /> <table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre><br /> mondrian.olap.MondrianException: Mondrian Error:Failed to parse query 'select {[Measures].[Pass Count]} ON COLUMNS,{[Grade].[All Grades]} ON ROWS FROM [QuickClick]'<br /> </td></tr></tbody></table><br /> <br /> However that looks correct still going down the stack trace we see the culprit.<br /> <br /> <table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre><br /> Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while loading segment; sql=[select sum("VASDS"."SDS_ASSMT_RESULT_QC"."PASS_CNT"«») as "m0" from "VASDS"."SDS_ASSMT_RESULT_QC" "VASDS"."SDS_ASSMT_RESULT_QC"]<br /> </td></tr></tbody></table><br /> <br /> There are two of my fact tables listed in the From cause why??? |
4 Answers:
Posted on August 30, 2006 at 2:09pm
Hello,
I think Mondrian is trying to generate an alias for the table, and using the original table name to do that. I'm not sure what the point of having an alias is if it is the same as the table name, but perhaps there are cases when it is different.
I think this generated SQL should work if you set the tableName in your mondrian schema to "SDS_ASSMT_RESULT_QC" instead of the fully qualified "VASDS.SDS_ASSMT_RESULT_QC".
Let's see what happens after that...
Sam
I think Mondrian is trying to generate an alias for the table, and using the original table name to do that. I'm not sure what the point of having an alias is if it is the same as the table name, but perhaps there are cases when it is different.
I think this generated SQL should work if you set the tableName in your mondrian schema to "SDS_ASSMT_RESULT_QC" instead of the fully qualified "VASDS.SDS_ASSMT_RESULT_QC".
Let's see what happens after that...
Sam
Posted on August 30, 2006 at 6:49pm
That worked when I used the actual user of the schema! Now the only problem is the dimensions cannot be drilled down into. Does anyone know how to actually get this to work or work arounds for not having to fully qualify the tables?
Thanks again sbirney!!! At least now I have something that sort of works even if I can't drill down and have a better understanding of the error!
Thanks again sbirney!!! At least now I have something that sort of works even if I can't drill down and have a better understanding of the error!
Posted on August 30, 2006 at 7:00pm
great, glad that helped some. In your simple schema example, it seems there is only one dimension with a single level, so it does not surprise me that there are no ability to drill down. Perhaps if you try a dimension with two levels then drill-down will work? If there is an error message, feel free to post it and I'll look. You were correct in your first post to try to find the "caused by:" log statement, it usually seems to lead to the answer.
Sam
Sam
Posted on August 30, 2006 at 7:09pm
Actually just got it to work with several dimensions. Turns out what I needed to do for a work around was to provide a private synonym for the dimension tables then I don't have to fully qualify the tables. Honestly surprising there wasn't more about this well call it a "bug" out there, but thanks so much for your help.