Skip to content

Commit

Permalink
Upgrade to version of mondrian that implements latest API.
Browse files Browse the repository at this point in the history
Update URL for JDK javadoc.

Clarify API doc regarding filter axis when WHERE clause is non-existent or
evaluates to empty set of tuples. Fix XMLA driver and test accordingly.


git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@368 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Nov 16, 2010
1 parent ed8217c commit 0ef4414
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
8 changes: 4 additions & 4 deletions build.xml
Expand Up @@ -3,7 +3,7 @@
== This software is subject to the terms of the Eclipse Public License v1.0
== Agreement, available at the following URL:
== http://www.eclipse.org/legal/epl-v10.html.
== Copyright (C) 2006-2009 Julian Hyde and others.
== Copyright (C) 2006-2010 Julian Hyde and others.
== All Rights Reserved.
== You must accept the terms of that agreement to use this software.
-->
Expand Down Expand Up @@ -272,7 +272,7 @@ META-INF/**" />
<tag name="pre" description="Pre-condition:" scope="constructors,methods" />
<tag name="post" description="Post-condition:" scope="constructors,methods" />
<tag name="testcase" description="Test-case:" scope="constructors,methods,types" />
<link href="http://java.sun.com/javase/6/docs/api/" />
<link href="http://download.oracle.com/javase/6/docs/api/" />
</javadoc>
</target>

Expand All @@ -291,7 +291,7 @@ META-INF/**" />
<tag name="pre" description="Pre-condition:" scope="constructors,methods" />
<tag name="post" description="Post-condition:" scope="constructors,methods" />
<tag name="testcase" description="Test-case:" scope="constructors,methods,types" />
<link href="http://java.sun.com/javase/6/docs/api/" />
<link href="http://download.oracle.com/javase/6/docs/api/" />
</javadoc>
</target>

Expand All @@ -315,7 +315,7 @@ META-INF/**" />
<tag name="pre" description="Pre-condition:" scope="constructors,methods" />
<tag name="post" description="Post-condition:" scope="constructors,methods" />
<tag name="testcase" description="Test-case:" scope="constructors,methods,types" />
<link href="http://java.sun.com/javase/6/docs/api/" />
<link href="http://download.oracle.com/javase/6/docs/api/" />
<link href="http://www.junit.org/junit/javadoc/3.8/" />
<doclet name="ydoc.doclets.YStandard"
path="${ydoc.home}/lib/ydoc.jar${ps}${ydoc.home}/lib/class2svg.jar${ps}${ydoc.home}/resources${ps}${ydoc.home}/doc">
Expand Down
2 changes: 1 addition & 1 deletion ivy.xml
Expand Up @@ -76,7 +76,7 @@
<dependency org="hsqldb" name="hsqldb" rev="1.8.0.7"
transitive="false" conf="test->default" />

<dependency org="pentaho" name="mondrian" rev="3.2.1.13893"
<dependency org="pentaho" name="mondrian" rev="3.2.1.13914"
transitive="false" changing="true" conf="test->default" />

<dependency org="eigenbase" name="eigenbase-xom" rev="1.3.0.11999"
Expand Down
20 changes: 13 additions & 7 deletions src/org/olap4j/CellSet.java
Expand Up @@ -97,13 +97,19 @@ public interface CellSet extends ResultSet, OlapWrapper {
/**
* Retrieves the CellSetAxis representing the filter axis.
*
* <p>This axis always has one position, and members of
* dimensions not included in any other axis. Some of these dimensions may
* have been explicitly mentioned in the WHERE clause of the MDX statement;
* others dimensions are represented by their default member.
*
* <p>In particular, if the query has no WHERE clause, the axis has a single
* position as usual, but the position has no members.
* <p>If the query has a WHERE clause, the contains the members returned
* by that expression. Most query authors write a WHERE clause so that it
* evaluates to just one member or tuple. The members in this tuple (or
* the sole member), are referred to as the 'slicer context' of the query.
* The tuple contains only members of hierarchies explicitly mentioned in
* the WHERE expression; the slicer context of every hierarchy in the
* query's cube is implicitly the default member of that hierarchy.
*
* <p>While not typical, note that a query's WHERE clause may also evaluate
* to zero or more than one tuples.
*
* <p>If the query has no WHERE clause, the filter axis has a single
* position, but the position has no members.
*
* <p>The filter axis is not included in the {@link #getAxes()} collection.
*
Expand Down
10 changes: 4 additions & 6 deletions src/org/olap4j/driver/xmla/XmlaOlap4jCellSet.java
Expand Up @@ -278,17 +278,15 @@ void populate() throws OlapException {
}
}

// olap4j requires a filter axis even if XMLA does not return one. If
// XMLA does not return one, presumably there was no WHERE clause and
// therefore the filter axis has a single position containing 0 members
// If XMLA did not return a filter axis, it means that the WHERE clause
// evaluated to zero tuples. (If the query had no WHERE clause, it
// would have evaluated to a single tuple with zero positions.)
if (filterAxis == null) {
filterAxis =
new XmlaOlap4jCellSetAxis(
this,
Axis.FILTER,
Collections.<Position>singletonList(
new XmlaOlap4jPosition(
Collections.<Member>emptyList(), 0)));
Collections.<Position>emptyList());
}

final Element cellDataNode = findChild(root, MDDATASET_NS, "CellData");
Expand Down
2 changes: 1 addition & 1 deletion testsrc/org/olap4j/ConnectionTest.java
Expand Up @@ -577,7 +577,7 @@ public void testEmptyFilter() throws SQLException {
assertEquals(0, filterAxis.getPositionCount());
final List<Position> filterPositions = filterAxis.getPositions();
assertEquals(0, filterPositions.size());
assertEquals(2, filterAxis.getAxisMetaData().getHierarchies().size());
assertEquals(0, filterAxis.getAxisMetaData().getHierarchies().size());
final Cell cell = cellSet.getCell(Arrays.asList(0, 0));
assertTrue(cell.isNull());
}
Expand Down

0 comments on commit 0ef4414

Please sign in to comment.