Skip to content

Commit

Permalink
MONDRIAN: Update olap4j.jar to 0.9.4-svn072; fix olap4j driver for Ax…
Browse files Browse the repository at this point in the history
…isNode API change; Cube.getMeasures() sorts measures by ordinal, per spec.

[git-p4: depot-paths = "//open/mondrian/": change = 10519]
  • Loading branch information
julianhyde committed Feb 5, 2008
1 parent aab9832 commit 6a98282
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
Binary file modified lib/olap4j.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/mondrian/olap4j/MondrianOlap4jConnection.java
Expand Up @@ -632,9 +632,9 @@ private AxisNode toOlap4j(QueryAxis axis) {
return new AxisNode(
null,
axis.isNonEmpty(),
toOlap4j(axis.getSet()),
MondrianOlap4jConnection.toOlap4j(axis.getAxisName()),
toOlap4j(axis.getDimensionProperties()));
toOlap4j(axis.getDimensionProperties()),
toOlap4j(axis.getSet()));
}

private List<IdentifierNode> toOlap4j(Id[] dimensionProperties) {
Expand Down
16 changes: 15 additions & 1 deletion src/main/mondrian/olap4j/MondrianOlap4jMeasure.java
Expand Up @@ -38,7 +38,21 @@ public class MondrianOlap4jMeasure
public Aggregator getAggregator() {
final RolapAggregator aggregator =
((RolapStoredMeasure) member).getAggregator();
return Aggregator.valueOf(aggregator.getName().toUpperCase());
if (aggregator == RolapAggregator.Avg) {
return Aggregator.AVG;
} else if (aggregator == RolapAggregator.Count) {
return Aggregator.COUNT;
} else if (aggregator == RolapAggregator.DistinctCount) {
return Aggregator.UNKNOWN;
} else if (aggregator == RolapAggregator.Max) {
return Aggregator.MAX;
} else if (aggregator == RolapAggregator.Min) {
return Aggregator.MIN;
} else if (aggregator == RolapAggregator.Sum) {
return Aggregator.SUM;
} else {
return Aggregator.UNKNOWN;
}
}

public Datatype getDatatype() {
Expand Down
21 changes: 19 additions & 2 deletions src/main/mondrian/rolap/RolapCube.java
Expand Up @@ -252,13 +252,30 @@ private RolapCube(

List<String> propNames = new ArrayList<String>();
List<String> propExprs = new ArrayList<String>();
validateMemberProps(xmlMeasure.memberProperties, propNames,
propExprs, xmlMeasure.name);
validateMemberProps(
xmlMeasure.memberProperties, propNames, propExprs,
xmlMeasure.name);
int ordinal = i;
for (int j = 0; j < propNames.size(); j++) {
String propName = propNames.get(j);
final Object propExpr = propExprs.get(j);
measure.setProperty(propName, propExpr);
if (propName.equals(Property.MEMBER_ORDINAL.name)
&& propExpr instanceof String) {
final String expr = (String) propExpr;
if (expr.startsWith("\"")
&& expr.endsWith("\"")) {
try {
ordinal =
Integer.valueOf(
expr.substring(1, expr.length() - 1));
} catch (NumberFormatException e) {
Util.discard(e);
}
}
}
}
measure.setOrdinal(ordinal);
}

this.measuresHierarchy.setMemberReader(new CacheMemberReader(
Expand Down

0 comments on commit 6a98282

Please sign in to comment.