Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MONDRIAN: First cut at supporting large dimensions by automatically i…
…terating (contributed by Luis F. Canals and Jorge Lopez). Many changes to internal APIs to return lists of members rather than arrays. Obsolete property LargeDimensionThreshold. Add schema property Dimension.highCardinality. Reinstate (but not enable) code to optimize lists of constraints for aggregate distinct count. Introduce MemberListCalc and TupleListCalc, subclasses of ListCalc for stronger typing. Update copyright notices & trim spaces. [git-p4: depot-paths = "//open/mondrian/": change = 11049]
- Loading branch information
1 parent
cd2f797
commit 3b50bf1
Showing
102 changed files
with
5,440 additions
and
2,068 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
// $Id$ | ||
// This software is subject to the terms of the Common Public License | ||
// Agreement, available at the following URL: | ||
// http://www.opensource.org/licenses/cpl.html. | ||
// Copyright (C) 2006-2008 Julian Hyde | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
*/ | ||
package mondrian.calc; | ||
|
||
import java.util.List; | ||
|
||
import mondrian.olap.Evaluator; | ||
import mondrian.olap.Member; | ||
|
||
// End ListCalc.java | ||
|
||
/** | ||
* Expression which evaluates a set of members or tuples to a list. | ||
* | ||
* @author jhyde | ||
* @version $Id$ | ||
* @since Sep 27, 2005 | ||
*/ | ||
public interface MemberListCalc extends ListCalc { | ||
/** | ||
* Evaluates an expression to yield a list of members. | ||
* | ||
* <p>The list is immutable if {@link #getResultStyle()} yields | ||
* {@link mondrian.calc.ResultStyle#MUTABLE_LIST}. Otherwise, | ||
* the caller must not modify the list. | ||
* | ||
* @param evaluator Evaluation context | ||
* @return A list of members, never null. | ||
*/ | ||
List<Member> evaluateMemberList(Evaluator evaluator); | ||
} | ||
|
||
// End MemberListCalc.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
// $Id$ | ||
// This software is subject to the terms of the Common Public License | ||
// Agreement, available at the following URL: | ||
// http://www.opensource.org/licenses/cpl.html. | ||
// Copyright (C) 2006-2008 Julian Hyde | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
*/ | ||
package mondrian.calc; | ||
|
||
import java.util.List; | ||
|
||
import mondrian.olap.Evaluator; | ||
import mondrian.olap.Member; | ||
|
||
// End ListCalc.java | ||
|
||
/** | ||
* Expression which evaluates a set of members or tuples to a list. | ||
* | ||
* @author jhyde | ||
* @version $Id$ | ||
* @since Sep 27, 2005 | ||
*/ | ||
public interface TupleListCalc extends ListCalc { | ||
/** | ||
* Evaluates an expression to yield a list of tuples. | ||
* | ||
* <p>Each tuple is represented by an array of members. | ||
* | ||
* <p>The list is immutable if {@link #getResultStyle()} yields | ||
* {@link mondrian.calc.ResultStyle#MUTABLE_LIST}. Otherwise, | ||
* the caller must not modify the list. | ||
* | ||
* @param evaluator Evaluation context | ||
* @return A list of tuples, never null. | ||
*/ | ||
List<Member[]> evaluateTupleList(Evaluator evaluator); | ||
} | ||
|
||
// End TupleListCalc.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
// $Id$ | ||
// This software is subject to the terms of the Common Public License | ||
// Agreement, available at the following URL: | ||
// http://www.opensource.org/licenses/cpl.html. | ||
// Copyright (C) 2006-2008 Julian Hyde | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
*/ | ||
package mondrian.calc.impl; | ||
|
||
import mondrian.olap.*; | ||
import mondrian.olap.type.SetType; | ||
import mondrian.calc.*; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Abstract implementation of the {@link mondrian.calc.ListCalc} interface | ||
* for expressions that return a list of members but never a list of tuples. | ||
* | ||
* <p>The derived class must | ||
* implement the {@link #evaluateMemberList(mondrian.olap.Evaluator)} method, | ||
* and the {@link #evaluate(mondrian.olap.Evaluator)} method will call it. | ||
* | ||
* @see mondrian.calc.impl.AbstractListCalc | ||
* | ||
* @author jhyde | ||
* @version $Id$ | ||
* @since Feb 20, 2008 | ||
*/ | ||
public abstract class AbstractMemberListCalc | ||
extends AbstractCalc | ||
implements MemberListCalc | ||
{ | ||
private final Calc[] calcs; | ||
private final boolean mutable; | ||
|
||
/** | ||
* Creates an abstract implementation of a compiled expression which | ||
* returns a mutable list of members. | ||
* | ||
* @param exp Expression which was compiled | ||
* @param calcs List of child compiled expressions (for dependency | ||
* analysis) | ||
*/ | ||
protected AbstractMemberListCalc(Exp exp, Calc[] calcs) { | ||
this(exp, calcs, true); | ||
} | ||
|
||
/** | ||
* Creates an abstract implementation of a compiled expression which | ||
* returns a list. | ||
* | ||
* @param exp Expression which was compiled | ||
* @param calcs List of child compiled expressions (for dependency | ||
* analysis) | ||
* @param mutable Whether the list is mutable | ||
*/ | ||
protected AbstractMemberListCalc(Exp exp, Calc[] calcs, boolean mutable) { | ||
super(exp); | ||
this.calcs = calcs; | ||
this.mutable = mutable; | ||
assert getType() instanceof SetType : "expecting a set: " + getType(); | ||
assert ((SetType) getType()).getArity() == 1; | ||
} | ||
|
||
public Object evaluate(Evaluator evaluator) { | ||
final List<Member> memberList = evaluateMemberList(evaluator); | ||
assert memberList != null : "null as empty memberList is deprecated"; | ||
return memberList; | ||
} | ||
|
||
public Calc[] getCalcs() { | ||
return calcs; | ||
} | ||
|
||
public ResultStyle getResultStyle() { | ||
return mutable ? | ||
ResultStyle.MUTABLE_LIST : | ||
ResultStyle.LIST; | ||
} | ||
|
||
public String toString() { | ||
return "AbstractMemberListCalc object"; | ||
} | ||
|
||
public List<Member> evaluateList(Evaluator evaluator) { | ||
return evaluateMemberList(evaluator); | ||
} | ||
|
||
public List<Member[]> evaluateTupleList(Evaluator evaluator) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} | ||
|
||
// End AbstractMemberListCalc.java |
Oops, something went wrong.