static class RolapNativeTopCount.TopCountConstraint extends RolapNativeSet.SetConstraint
| Modifier and Type | Field and Description | 
|---|---|
(package private) boolean | 
ascending  | 
(package private) Exp | 
orderByExpr  | 
(package private) Integer | 
topCount  | 
args| Constructor and Description | 
|---|
TopCountConstraint(int count,
                  CrossJoinArg[] args,
                  RolapEvaluator evaluator,
                  Exp orderByExpr,
                  boolean ascending)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addConstraint(SqlQuery sqlQuery,
             RolapCube baseCube,
             AggStar aggStar)
Called from LevelMembers: restricts the SQL resultset to the current
 context. 
 | 
Object | 
getCacheKey()
returns a key to cache the result 
 | 
protected boolean | 
isJoinRequired()
Returns whether a join with the fact table is required. 
 | 
protected boolean | 
isValid()
If the orderByExpr is not present than we're dealing with
 the 2 arg form of TC. 
 | 
boolean | 
supportsAggTables()  | 
canApplyCrossJoinArgConstraint, getMemberChildrenConstraintaddLevelConstraint, addMemberConstraint, addMemberConstraint, getEvaluator, isValidContext, isValidContextpublic TopCountConstraint(int count,
                          CrossJoinArg[] args,
                          RolapEvaluator evaluator,
                          Exp orderByExpr,
                          boolean ascending)
protected boolean isValid()
protected boolean isJoinRequired()
If there is a crossjoin, we need to join the fact table - even if the evaluator context is empty.
TopCount needs to join the fact table if a top count expression is present (i.e. orderByExpr). If not present than the results of TC should be the natural ordering of the set in the first argument, which cannot use a join to the fact table without potentially eliminating empty tuples.
isJoinRequired in class RolapNativeSet.SetConstraintpublic boolean supportsAggTables()
supportsAggTables in interface TupleConstraintsupportsAggTables in class SqlContextConstraintpublic void addConstraint(SqlQuery sqlQuery, RolapCube baseCube, AggStar aggStar)
SqlContextConstraintaddConstraint in interface TupleConstraintaddConstraint in class RolapNativeSet.SetConstraintsqlQuery - the query to modifybaseCube - base cube for virtual cube constraintsaggStar - aggregate star to usepublic Object getCacheKey()
RolapNativeSet.SetConstraintgetCacheKey in interface SqlConstraintgetCacheKey in class RolapNativeSet.SetConstraint