Skip to content

Commit

Permalink
MONDRIAN: <harun/ashwin/ajit>fixed grouping sets for distinct count r…
Browse files Browse the repository at this point in the history
…elated unit tests and added more and fix for bug 1883611

[git-p4: depot-paths = "//open/mondrian/": change = 10510]
  • Loading branch information
Ajit Joglekar committed Feb 4, 2008
1 parent a5d6b97 commit 40b333e
Show file tree
Hide file tree
Showing 7 changed files with 840 additions and 329 deletions.
2 changes: 1 addition & 1 deletion src/main/mondrian/olap/type/MemberType.java
Expand Up @@ -167,7 +167,7 @@ public Type computeCommonType(Type type, int[] conversionCount) {
return new TupleType(new Type[] {type}).computeCommonType(tupleType,
conversionCount);
} else {
return null;
return computeCommonType(tupleType.getValueType(), conversionCount);
}
}
if (!(type instanceof MemberType)) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/mondrian/olap/type/SetType.java
Expand Up @@ -32,7 +32,8 @@ public class SetType implements Type {
public SetType(Type elementType) {
if (elementType != null) {
assert elementType instanceof MemberType ||
elementType instanceof TupleType;
elementType instanceof TupleType ||
elementType instanceof ScalarType;
}
this.elementType = elementType;
this.digest = "SetType<" + elementType + ">";
Expand Down Expand Up @@ -65,7 +66,7 @@ public Type getElementType() {
}

public boolean usesDimension(Dimension dimension, boolean definitely) {
if (elementType == null) {
if (elementType == null || elementType instanceof ScalarType) {
return definitely;
}
return elementType.usesDimension(dimension, definitely);
Expand Down
3 changes: 3 additions & 0 deletions src/main/mondrian/olap/type/TupleType.java
Expand Up @@ -101,6 +101,9 @@ public Type computeCommonType(Type type, int[] conversionCount) {
if (type instanceof ScalarType) {
return getValueType().computeCommonType(type, conversionCount);
}
if (type instanceof MemberType) {
return getValueType().computeCommonType(type, conversionCount);
}
if (!(type instanceof TupleType)) {
return null;
}
Expand Down

0 comments on commit 40b333e

Please sign in to comment.