Skip to content

Commit

Permalink
MONDRIAN: passing thru NativizeSet parameter when aggregate tables ar…
Browse files Browse the repository at this point in the history
…e turned on.

[git-p4: depot-paths = "//open/mondrian-release/3.2/": change = 13570]
  • Loading branch information
Matt Campbell authored and Matt Campbell committed Apr 22, 2010
1 parent 990fee3 commit 3ca5013
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
7 changes: 7 additions & 0 deletions src/main/mondrian/olap/fun/NativizeSetFunDef.java
Expand Up @@ -86,6 +86,13 @@ public Exp createCall(Validator validator, Exp[] args) {
public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
LOGGER.debug("NativizeSetFunDef compileCall");
Exp funArg = call.getArg(0);

if (MondrianProperties.instance().UseAggregates.get()
|| MondrianProperties.instance().ReadAggregates.get())
{
return funArg.accept(compiler);
}

final Calc[] calcs = new Calc[] {compiler.compileList(funArg, true)};

final int arity = ((SetType) calcs[0].getType()).getArity();
Expand Down
33 changes: 18 additions & 15 deletions testsrc/main/mondrian/olap/fun/NativizeSetFunDefTest.java
Expand Up @@ -27,12 +27,30 @@ public void setUp() throws Exception {
MondrianProperties.instance().EnableNonEmptyOnAllAxis, true);
propSaver.set(
MondrianProperties.instance().NativizeMinThreshold, 0);
propSaver.set(
MondrianProperties.instance().UseAggregates, false);
propSaver.set(
MondrianProperties.instance().ReadAggregates, false);
}

public void tearDown() throws Exception {
super.tearDown();
}

public void testIsNoOpWithAggregatesTablesOn() {
propSaver.set(
MondrianProperties.instance().UseAggregates, true);
propSaver.set(
MondrianProperties.instance().UseAggregates, true);
checkNotNative(
"with member [gender].[agg] as"
+ " 'aggregate({[gender].[gender].members},[measures].[unit sales])'"
+ "select NativizeSet(CrossJoin( "
+ "{gender.gender.members, gender.agg}, "
+ "{[marital status].[marital status].members}"
+ ")) on 0 from sales");
}

public void testLevelHierarchyHighCardinality() {
// The cardinality for the hierarchy looks like this:
// Year: 2 (level * gender cardinality:2)
Expand Down Expand Up @@ -645,11 +663,6 @@ public void testRedundantLevelMembersLast() {
}

public void testNonEmptyNestedCrossJoins() {
if (MondrianProperties.instance().UseAggregates.get()
|| MondrianProperties.instance().ReadAggregates.get())
{
return;
}
checkNative(
"SELECT "
+ "NativizeSet(CrossJoin("
Expand Down Expand Up @@ -1006,11 +1019,6 @@ public void testMultipleLevelsOfSameDimInConcatenatedJoins() {
}

public void testMultipleLevelsOfSameDimInSingleArg() {
if (MondrianProperties.instance().UseAggregates.get()
|| MondrianProperties.instance().ReadAggregates.get())
{
return;
}
checkNotNative(
// Although it's legal MDX, the RolapNativeSet.checkCrossJoinArg
// can't deal with an arg that contains multiple .members functions.
Expand Down Expand Up @@ -1422,11 +1430,6 @@ public void testCardinalityQueriesOnlyExecuteOnce() {
}

public void testSingleLevelDotMembersIsNativelyEvaluated() {
if (MondrianProperties.instance().UseAggregates.get()
|| MondrianProperties.instance().ReadAggregates.get())
{
return;
}
String mdx1 =
"with member [Customers].[agg] as '"
+ "AGGREGATE({[Customers].[name].MEMBERS}, [Measures].[Unit Sales])'"
Expand Down

0 comments on commit 3ca5013

Please sign in to comment.