mysticfall / pivot4j

Pivot4J provides a common API for OLAP servers which can be used to build an analytical service frontend with pivot style GUI.
Other
128 stars 101 forks source link

Dimension properties problem #185

Closed mkvoyager closed 8 years ago

mkvoyager commented 9 years ago

Hi Xavier, I found this problem: imagine you have in Foodmart this:

    <Dimension name="Store">
    <Hierarchy hasAll="true" primaryKey="store_id">
      <Table name="store"/>
      <Level name="Store Country" column="store_country" uniqueMembers="true"/>
      <Level name="Store State" column="store_state" uniqueMembers="true">
        <Property name="Store State" column="store_state"/>
      </Level>
      <Level name="Store City" column="store_city" uniqueMembers="false"/>
      <Level name="Store Name" column="store_name" uniqueMembers="true">
        <Property name="Store Type" column="store_type"/>
        <Property name="Store Manager" column="store_manager"/>
        <Property name="Store Sqft" column="store_sqft" type="Numeric"/>
        <Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/>
        <Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/>
        <Property name="Meat Sqft" column="meat_sqft" type="Numeric"/>
        <Property name="Has coffee bar" column="coffee_bar" type="Boolean"/>
        <Property name="Street address" column="store_street_address" type="String"/>
      </Level>
    </Hierarchy>
  </Dimension>

This works very well in JPivot but in Pivot4j works only if you have one level with one or more properties, but if you have more levels with more properties pivot4j analytics gives this error:

17:40:48.796 ERROR [Pivot4JExceptionHandler] -Unhandled exception has occurred
java.lang.StackOverflowError
    at java.util.HashMap.hash(HashMap.java:362) ~[?:1.7.0_75]
    at java.util.HashMap.getEntry(HashMap.java:462) ~[?:1.7.0_75]
    at java.util.HashMap.get(HashMap.java:417) ~[?:1.7.0_75]
    at org.pivot4j.ui.table.TableAxisContext.getProperties(TableAxisContext.java:154) ~[pivot4j-core-1.0-SNAPSHOT.jar:?]
    at org.pivot4j.ui.table.TableHeaderNode.addMemberProperties(TableHeaderNode.java:270) ~[pivot4j-core-1.0-SNAPSHOT.jar:?]
at org.pivot4j.ui.table.TableHeaderNode.addMemberProperties(TableHeaderNode.java:305) ~[pivot4j-core-1.0-SNAPSHOT.jar:?]
................................
at org.pivot4j.ui.table.TableHeaderNode.addMemberProperties(TableHeaderNode.java:305) ~[pivot4j-core-1.0-SNAPSHOT.jar:?]

Have you ever had this exception? Maybe in pivot4j dimension properties have to be define in different ways than jpivot? thanks for any hint you can give me!

mysticfall commented 9 years ago

I tried to reproduce the problem but I couldn't. Is there anything I should do after modifying the Mondrian schema to define the additional property under Store State level, and edit pivot4j-config.xml to enable the non-internal properties collector?

I tested with this setup, and it seems that the added property show up correctly without any problem. I'd appreciate if you could instruct me to reproduce the issue.

Sorry for the late response.

mkvoyager commented 9 years ago

Hi Xavier! Do you see all 9 properties?

i post my configuration here:

    <render>
    <propertyCollector type="non-internal" />
    </render>   

SELECT {[Measures].[Store Sqft]} ON COLUMNS, {[Store].[Canada], [Store].[Canada].[BC], [Store].[Canada].[BC].[Vancouver], [Store].[Canada].[BC].[Vancouver].[Store 19], [Store].[Canada].[BC].[Victoria], [Store].[Mexico], [Store].[USA]} ON ROWS FROM [Store]

Can you test my mdx query please?

mysticfall commented 8 years ago

@mkvoyager With your MDX, I was finally able to reproduce the problem and I'm trying to debug it now. I'll update the issue as soon as there's some progress.

Thanks for the patience.

mkvoyager commented 8 years ago

Thanks a lot Xavier!! I found another problem, but maybe is correlated: if you have just a property in a middle level

immagine2

if you try the mdx query of the previous post you will see that the measure values are in the wrong column:

immagine

mysticfall commented 8 years ago

Fixed in build 382:

mkvoyager commented 8 years ago

Thank you very much Xavier!!!!