Package mondrian.rolap
Class RolapNativeTopCount.TopCountConstraint
- java.lang.Object
-
- mondrian.rolap.SqlContextConstraint
-
- mondrian.rolap.RolapNativeSet.SetConstraint
-
- mondrian.rolap.RolapNativeTopCount.TopCountConstraint
-
- All Implemented Interfaces:
MemberChildrenConstraint
,SqlConstraint
,TupleConstraint
- Enclosing class:
- RolapNativeTopCount
static class RolapNativeTopCount.TopCountConstraint extends RolapNativeSet.SetConstraint
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
ascending
(package private) Exp
orderByExpr
(package private) java.lang.Integer
topCount
-
Fields inherited from class mondrian.rolap.RolapNativeSet.SetConstraint
args
-
-
Constructor Summary
Constructors Constructor Description TopCountConstraint(int count, CrossJoinArg[] args, RolapEvaluator evaluator, Exp orderByExpr, boolean ascending)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar)
Called from LevelMembers: restricts the SQL resultset to the current context.java.lang.Object
getCacheKey()
returns a key to cache the resultprotected boolean
isJoinRequired()
Returns whether a join with the fact table is required.-
Methods inherited from class mondrian.rolap.RolapNativeSet.SetConstraint
getMemberChildrenConstraint
-
Methods inherited from class mondrian.rolap.SqlContextConstraint
addLevelConstraint, addMemberConstraint, addMemberConstraint, getEvaluator, isValidContext, isValidContext
-
-
-
-
Field Detail
-
orderByExpr
Exp orderByExpr
-
ascending
boolean ascending
-
topCount
java.lang.Integer topCount
-
-
Constructor Detail
-
TopCountConstraint
public TopCountConstraint(int count, CrossJoinArg[] args, RolapEvaluator evaluator, Exp orderByExpr, boolean ascending)
-
-
Method Detail
-
isJoinRequired
protected boolean isJoinRequired()
Returns whether a join with the fact table is required. A join is required if the context contains members from dimensions other than level. If we are interested in the members of a level or a members children then it does not make sense to join only one dimension (the one that contains the requested members) with the fact table for NON EMPTY optimization.If there is a crossjoin, we need to join the fact table - even if the evaluator context is empty.
TopCount always needs to join the fact table because we want to evaluate the top count expression which involves a fact.
- Overrides:
isJoinRequired
in classRolapNativeSet.SetConstraint
-
addConstraint
public void addConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar)
Description copied from class:SqlContextConstraint
Called from LevelMembers: restricts the SQL resultset to the current context.- Specified by:
addConstraint
in interfaceTupleConstraint
- Overrides:
addConstraint
in classRolapNativeSet.SetConstraint
- Parameters:
sqlQuery
- the query to modifybaseCube
- base cube for virtual cube constraintsaggStar
- aggregate star to use
-
getCacheKey
public java.lang.Object getCacheKey()
Description copied from class:RolapNativeSet.SetConstraint
returns a key to cache the result- Specified by:
getCacheKey
in interfaceSqlConstraint
- Overrides:
getCacheKey
in classRolapNativeSet.SetConstraint
- Returns:
- valid key or null to prevent the result from being cached
-
-