Skip to content

Commit

Permalink
MONDRIAN: Head function working for high cardinality dimensions
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 11199]
  • Loading branch information
Luis F. Canals committed Jun 19, 2008
1 parent c57e114 commit de162be
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/main/mondrian/olap/fun/HeadTailFunDef.java
Expand Up @@ -107,9 +107,6 @@ public Iterator<Object> iterator() {

static List head(final int count, final List members) {
assert members != null;
if (count >= members.size()) {
return members;
}
if (count <= 0) {
return Collections.EMPTY_LIST;
}
Expand Down
16 changes: 16 additions & 0 deletions testsrc/main/mondrian/rolap/HighDimensionsTest.java
Expand Up @@ -72,6 +72,22 @@ public void testPromotionsTwoDimensions() throws Exception {
+ "from [Sales Ragged]", 1, "Promotions");
}

/*
public void testNonEmpty() throws Exception {
execHighCardTest("select {[Measures].[Unit Sales]} on columns,\n"
+ "non empty {[Promotions].[Promotion Name].Members} "
+ "on rows from [Sales Ragged]", 1, "Promotions");
}
*/

public void testHead() throws Exception {
execHighCardTest("select {[Measures].[Unit Sales]} on columns,\n"
+ "head({[Promotions].[Promotion Name].Members},51) "
+ "on rows from [Sales Ragged]", 1, "Promotions");
}




//
// Private Stuff --------------------------------------------
Expand Down

0 comments on commit de162be

Please sign in to comment.