Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Severe Severe
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      1. make a dimension like this
      <Dimension name="Region">
      <Hierarchy name="Region" hasAll="true" allMemberName="All Region" primaryKey="id">
      <Table schema="demo_storage" name="tblregions"/>
      <Level name="Region" table="tblregions" column="id" captionColumn="name" uniqueMembers="true">
      <Property name="order" column="order"/>
      <Property name="name_en" column="name_en"/>
      <Property name="name_ua" column="name"/>
      </Level>
      </Hierarchy>
      </Dimension>
      2.make query
      select
      {[Measures].[sv]} ON COLUMNS,
      [Region].[All Region].Children ON ROWS
      from [SalesAndBallance]

      expecting:
      see values from corresponding columns of tblregions in the member properties

      actually:
      see caption in order property, order in name_en and name_en in name_ua.


      Looks like something shifts inside and properties are filled from wrong columns
      Everything works fine if the query is
      select
      {[Measures].[sv]} ON COLUMNS,
      [Region].Members ON ROWS
      from [SalesAndBallance]
      i.e. query <Dimension>.Members instead of <All Member>.Children

        Activity

        Hide
        Mondrian Importer User added a comment -
        {oleg_k}, 07/02/2007: IP, Artifact Created: 212.109.63.149 |
        {rthar}, 08/17/2007: IP, Comment Added: 12.183.217.250 |
        {jhyde}, 08/17/2007: IP, Comment Added: 64.81.57.79 |
        {jhyde}, 08/17/2007: assigned_to, 100 |
        {rthar}, 08/20/2007: IP, Comment Added: 12.183.217.250 |
        {rthar}, 08/21/2007: IP, Comment Added: 12.183.217.250 |
        {jhyde}, 10/26/2007: IP, Comment Added: 64.81.57.79 |
        {jhyde}, 10/26/2007: status_id, 1 |
        {jhyde}, 10/26/2007: resolution_id, 100 |
        {jhyde}, 10/26/2007: close_date, 0
        Show
        Mondrian Importer User added a comment - {oleg_k}, 07/02/2007: IP, Artifact Created: 212.109.63.149 | {rthar}, 08/17/2007: IP, Comment Added: 12.183.217.250 | {jhyde}, 08/17/2007: IP, Comment Added: 64.81.57.79 | {jhyde}, 08/17/2007: assigned_to, 100 | {rthar}, 08/20/2007: IP, Comment Added: 12.183.217.250 | {rthar}, 08/21/2007: IP, Comment Added: 12.183.217.250 | {jhyde}, 10/26/2007: IP, Comment Added: 64.81.57.79 | {jhyde}, 10/26/2007: status_id, 1 | {jhyde}, 10/26/2007: resolution_id, 100 | {jhyde}, 10/26/2007: close_date, 0
        Hide
        Mondrian Importer User added a comment -
        {rthar}, 08/17/2007: Logged In: YES
        user_id=1842412
        Originator: NO

        Which version of mondrian was this problem observed with ? I attempted to create a dimension configuration similar to the one described above using the current tip of mondrian and had an errors indicating the foreignKey column needed to be specified.

        Thanks,

        Robin
        Show
        Mondrian Importer User added a comment - {rthar}, 08/17/2007: Logged In: YES user_id=1842412 Originator: NO Which version of mondrian was this problem observed with ? I attempted to create a dimension configuration similar to the one described above using the current tip of mondrian and had an errors indicating the foreignKey column needed to be specified. Thanks, Robin
        Hide
        Mondrian Importer User added a comment -
        {jhyde}, 08/17/2007: Logged In: YES
        user_id=312935
        Originator: NO

        You don't need to specify foreignKey when the dimension is shared. oleg didn't make that very clear. With a shared dimension, you specify the foreign key when you use the dimension in a specific cube using a DimensionUsage element.

        I expect this bug should reproduce with both kinds of dimension. The key factor is that there is a property which is mapped to the same column as caption. You should be able to reproduce that in any one FoodMart. Try, for example,

              <Level name="Store Name" column="store_name" uniqueMembers="true" caption="store_manager">
                <Property name="Store Type" column="store_type"/>
                <Property name="Store Manager" column="store_manager"/>

        Julian
        Show
        Mondrian Importer User added a comment - {jhyde}, 08/17/2007: Logged In: YES user_id=312935 Originator: NO You don't need to specify foreignKey when the dimension is shared. oleg didn't make that very clear. With a shared dimension, you specify the foreign key when you use the dimension in a specific cube using a DimensionUsage element. I expect this bug should reproduce with both kinds of dimension. The key factor is that there is a property which is mapped to the same column as caption. You should be able to reproduce that in any one FoodMart. Try, for example,       <Level name="Store Name" column="store_name" uniqueMembers="true" caption="store_manager">         <Property name="Store Type" column="store_type"/>         <Property name="Store Manager" column="store_manager"/> Julian
        Hide
        Mondrian Importer User added a comment -
        {rthar}, 08/20/2007: Logged In: YES
        user_id=1842412
        Originator: NO


        It appears that the problem occurs even when the caption is a different column from one of the properties. See the example below.

         final TestContext testContext = TestContext.createSubstitutingCube(
                        "Sales",
                        " <Dimension name=\"Store2\" foreignKey=\"store_id\">\n" +
                            " <Hierarchy name=\"Store2\" hasAll=\"true\" allMemberName=\"All Stores\" primaryKey=\"store_id\">\n" +
                            " <Table name=\"store_ragged\"/>\n" +
                            " <Level name=\"Store2\" table=\"store_ragged\" column=\"store_id\" captionColumn=\"store_name\" uniqueMembers=\"true\">\n" +
                            " <Property name=\"Store Type\" column=\"store_type\"/>" +
                            " <Property name=\"Store Manager\" column=\"store_manager\"/>" +
                            " </Level>" +
                            " </Hierarchy>\n" +
                            " </Dimension>\n");

             Result result = testContext.executeQuery(
                        "WITH\n" +
                        " MEMBER [Measures].[StoreType] AS \n" +
                        " '[Store2].CurrentMember.Properties(\"Store Type\")'\n" +
                        "SELECT\n" +
                        " { [Store2].[All Stores].children } ON COLUMNS,\n" +
                        " { [Measures].[Store Sales], [Measures].[StoreType]} ON ROWS\n" +
                        "FROM Sales");

        In this particular example the store name was being returned instead of the store type.

        Looking at the code there was a comment regarding this problem in SqlMemberSource.getMemberChildren:

        if (member == null) {
          // REVIEW jvs 20-Feb-2007: Shouldn't "1" be "2"
          // if there was a caption?
          member = makeMember(
             parentMember, childLevel, value, captionValue,
             parentChild, resultSet, key, 1);
         }

        I went ahead with the suggesting and made the change to use a columnOffset of 2 instead of 1 if a caption is specified. This appears to resolve the problem. Below is the code:

                        if (childLevel.hasCaptionColumn()){
                            //If a caption exists the column offset
                            // must be set accordingly in order to
                            // read the properties
                            columnOffset = 2;
                            captionValue=resultSet.getObject(columnOffset);
                        } else {
                            captionValue = null;
                        }
        ...

                        if (member == null) {
                            member = makeMember(
                                    parentMember, childLevel, value, captionValue,
                                    parentChild, resultSet, key, columnOffset);
                        }
                        
        I am currently in the process of testing this again all the test case. Let me know if you see any issues.

        Thanks,

        Robin
        Show
        Mondrian Importer User added a comment - {rthar}, 08/20/2007: Logged In: YES user_id=1842412 Originator: NO It appears that the problem occurs even when the caption is a different column from one of the properties. See the example below.  final TestContext testContext = TestContext.createSubstitutingCube(                 "Sales",                 " <Dimension name=\"Store2\" foreignKey=\"store_id\">\n" +                     " <Hierarchy name=\"Store2\" hasAll=\"true\" allMemberName=\"All Stores\" primaryKey=\"store_id\">\n" +                     " <Table name=\"store_ragged\"/>\n" +                     " <Level name=\"Store2\" table=\"store_ragged\" column=\"store_id\" captionColumn=\"store_name\" uniqueMembers=\"true\">\n" +                     " <Property name=\"Store Type\" column=\"store_type\"/>" +                     " <Property name=\"Store Manager\" column=\"store_manager\"/>" +                     " </Level>" +                     " </Hierarchy>\n" +                     " </Dimension>\n");      Result result = testContext.executeQuery(                 "WITH\n" +                 " MEMBER [Measures].[StoreType] AS \n" +                 " '[Store2].CurrentMember.Properties(\"Store Type\")'\n" +                 "SELECT\n" +                 " { [Store2].[All Stores].children } ON COLUMNS,\n" +                 " { [Measures].[Store Sales], [Measures].[StoreType]} ON ROWS\n" +                 "FROM Sales"); In this particular example the store name was being returned instead of the store type. Looking at the code there was a comment regarding this problem in SqlMemberSource.getMemberChildren: if (member == null) {   // REVIEW jvs 20-Feb-2007: Shouldn't "1" be "2"   // if there was a caption?   member = makeMember(      parentMember, childLevel, value, captionValue,      parentChild, resultSet, key, 1);  } I went ahead with the suggesting and made the change to use a columnOffset of 2 instead of 1 if a caption is specified. This appears to resolve the problem. Below is the code:                 if (childLevel.hasCaptionColumn()){                     //If a caption exists the column offset                     // must be set accordingly in order to                     // read the properties                     columnOffset = 2;                     captionValue=resultSet.getObject(columnOffset);                 } else {                     captionValue = null;                 } ...                 if (member == null) {                     member = makeMember(                             parentMember, childLevel, value, captionValue,                             parentChild, resultSet, key, columnOffset);                 }                  I am currently in the process of testing this again all the test case. Let me know if you see any issues. Thanks, Robin
        Hide
        Mondrian Importer User added a comment -
        {rthar}, 08/21/2007: Logged In: YES
        user_id=1842412
        Originator: NO

        Fix committed into Perforce (see change list 9793)
        Show
        Mondrian Importer User added a comment - {rthar}, 08/21/2007: Logged In: YES user_id=1842412 Originator: NO Fix committed into Perforce (see change list 9793)
        Hide
        Mondrian Importer User added a comment -
        {jhyde}, 10/26/2007: Logged In: YES
        user_id=312935
        Originator: NO

        Marking closed. Actual change number was 9795 (perforce sometimes ups change numbers when you check in).
        Show
        Mondrian Importer User added a comment - {jhyde}, 10/26/2007: Logged In: YES user_id=312935 Originator: NO Marking closed. Actual change number was 9795 (perforce sometimes ups change numbers when you check in).

          People

          • Assignee:
            rthar
            Reporter:
            oleg_k
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: