Uploaded image for project: 'Pentaho Analysis - Mondrian'
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-2496

Closure does not use captionColumn

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Incomplete
    • Affects Version/s: 6.1.0 GA, 7.0.0 GA
    • Fix Version/s: Backlog
    • Labels:
      None
    • Story Points:
      0
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.
    • Operating System/s:
      Ubuntu 14.x
    • Steps to Reproduce:
      Hide

      Add the following test to ParentChildHierarchyTest.java :

          public void testParentChildCaption() {
              if (Bug.avoidSlowTestOnLucidDB(getTestContext().getDialect())) {
                  return;
              }
              final TestContext testContext = TestContext.instance().create(
                      null,
                      "<Cube name=\"HR-ordered\">\n"
                              + "  <Table name=\"salary\"/>\n"
                              + "  <Dimension name=\"Employees\" foreignKey=\"employee_id\">\n"
                              + "    <Hierarchy hasAll=\"true\" allMemberName=\"All Employees\"\n"
                              + "        primaryKey=\"employee_id\">\n"
                              + "      <Table name=\"employee\"/>\n"
                              + "      <Level name=\"Employee Id\" type=\"Numeric\" uniqueMembers=\"true\"\n"
                              + "          column=\"employee_id\" parentColumn=\"supervisor_id\"\n"
                              + "          captionColumn=\"full_name\" nullParentValue=\"0\""
                              + "           >\n"
                              + "        <Closure parentColumn=\"supervisor_id\" childColumn=\"employee_id\">\n"
                              + "          <Table name=\"employee_closure\"/>\n"
                              + "        </Closure>\n"
                              + "        <Property name=\"First Name\" column=\"first_name\"/>\n"
                              + "      </Level>\n"
                              + "    </Hierarchy>\n"
                              + "  </Dimension>\n"
                              + "\n"
                              + "  <Measure name=\"Org Salary\" column=\"salary_paid\" aggregator=\"sum\"\n"
                              + "      formatString=\"Currency\"/>\n"
                              + "  <Measure name=\"Count\" column=\"employee_id\" aggregator=\"count\"\n"
                              + "      formatString=\"#,#\"/>\n"
                              + "</Cube>",
                      null,
                      null,
                      null,
                      null);
      
              Result result = testContext.executeQuery("select {[Employees].[Employee Id].[1], [Employees].[Employee Id].[2]} on columns from [HR-ordered]");
              Axis[] axes = result.getAxes();
              List<Position> positions = axes[0].getPositions();
      
              Member m0 = positions.get(0).get(0);
              Assert.assertEquals("Sheri Nowmer", m0.getCaption());
          }
      
      Show
      Add the following test to ParentChildHierarchyTest.java : public void testParentChildCaption() { if (Bug.avoidSlowTestOnLucidDB(getTestContext().getDialect())) { return ; } final TestContext testContext = TestContext.instance().create( null , "<Cube name=\" HR-ordered\ ">\n" + " <Table name=\" salary\ "/>\n" + " <Dimension name=\" Employees\ " foreignKey=\" employee_id\ ">\n" + " <Hierarchy hasAll=\" true \ " allMemberName=\" All Employees\ "\n" + " primaryKey=\" employee_id\ ">\n" + " <Table name=\" employee\ "/>\n" + " <Level name=\" Employee Id\ " type=\" Numeric\ " uniqueMembers=\" true \ "\n" + " column=\" employee_id\ " parentColumn=\" supervisor_id\ "\n" + " captionColumn=\" full_name\ " nullParentValue=\" 0\"" + " >\n" + " <Closure parentColumn=\" supervisor_id\ " childColumn=\" employee_id\ ">\n" + " <Table name=\" employee_closure\ "/>\n" + " </Closure>\n" + " <Property name=\" First Name\ " column=\" first_name\ "/>\n" + " </Level>\n" + " </Hierarchy>\n" + " </Dimension>\n" + "\n" + " <Measure name=\" Org Salary\ " column=\" salary_paid\ " aggregator=\" sum\ "\n" + " formatString=\" Currency\ "/>\n" + " <Measure name=\" Count\ " column=\" employee_id\ " aggregator=\" count\ "\n" + " formatString=\" #,#\ "/>\n" + "</Cube>" , null , null , null , null ); Result result = testContext.executeQuery( "select {[Employees].[Employee Id].[1], [Employees].[Employee Id].[2]} on columns from [HR-ordered]" ); Axis[] axes = result.getAxes(); List<Position> positions = axes[0].getPositions(); Member m0 = positions.get(0).get(0); Assert.assertEquals( "Sheri Nowmer" , m0.getCaption()); }

      Description

      In our MDX queries we use ID's to select and captionColumn to display data to the end user. This works fine until we started to use closure tables within our levels. It seems that the captionColumn (and also captionExpression) are simply ignored in combincation with closures. Please see the attached testcase to reproduce the issue.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mjbroek Martijn van den Broek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: