Modifier and Type | Field and Description |
---|---|
protected boolean |
countOnly |
Modifier | Constructor and Description |
---|---|
protected |
AbstractQuerySpec(RolapStar star,
boolean countOnly)
Creates an AbstractQuerySpec.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addGroupingFunction(SqlQuery sqlQuery) |
protected void |
addGroupingSets(SqlQuery sqlQuery,
Map<String,String> groupingSetsAliases) |
protected void |
addMeasure(int i,
SqlQuery sqlQuery)
Adds a measure to a query.
|
protected Map<String,String> |
distinctGenerateSql(SqlQuery outerSqlQuery,
boolean countOnly)
Generates a SQL query to retrieve the values in this segment using
an algorithm which converts distinct-aggregates to non-distinct
aggregates over subqueries.
|
protected void |
extraPredicates(SqlQuery sqlQuery)
Adds predicates not associated with columns.
|
Pair<String,List<SqlStatement.Type>> |
generateSqlQuery() |
protected int |
getDistinctMeasureCount()
Returns the number of measures whose aggregation function is
distinct-count.
|
protected List<StarPredicate> |
getPredicateList()
Returns a list of predicates not associated with a particular column.
|
RolapStar |
getStar() |
protected abstract boolean |
isAggregate() |
protected boolean |
isOrdered()
Whether to add an ORDER BY clause to make results deterministic.
|
protected boolean |
isPartOfSelect(RolapStar.Column col)
Allows subclasses to specify if a given column must
be returned as part of the result set, in the select clause.
|
protected boolean |
isPartOfSelect(RolapStar.Measure measure)
Allows subclasses to specify if a given column must
be returned as part of the result set, in the select clause.
|
protected SqlQuery |
newSqlQuery()
Creates a query object.
|
protected Map<String,String> |
nonDistinctGenerateSql(SqlQuery sqlQuery) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColumnAlias, getColumnPredicate, getColumns, getMeasure, getMeasureAlias, getMeasureCount
protected AbstractQuerySpec(RolapStar star, boolean countOnly)
star
- Star which defines columns of interest and their
relationshipscountOnly
- If true, generate no GROUP BY clause, so the query
returns a single row containing a grand totalprotected SqlQuery newSqlQuery()
protected void addMeasure(int i, SqlQuery sqlQuery)
i
- Ordinal of measuresqlQuery
- Query objectprotected abstract boolean isAggregate()
protected boolean isPartOfSelect(RolapStar.Column col)
protected boolean isPartOfSelect(RolapStar.Measure measure)
protected boolean isOrdered()
public Pair<String,List<SqlStatement.Type>> generateSqlQuery()
generateSqlQuery
in interface QuerySpec
protected void addGroupingFunction(SqlQuery sqlQuery)
protected void addGroupingSets(SqlQuery sqlQuery, Map<String,String> groupingSetsAliases)
protected int getDistinctMeasureCount()
protected Map<String,String> distinctGenerateSql(SqlQuery outerSqlQuery, boolean countOnly)
outerSqlQuery
- Query to modifycountOnly
- If true, only generate a single row: no need to
generate a GROUP BY clause or put any constraining columns in the
SELECT clauseprotected void extraPredicates(SqlQuery sqlQuery)
sqlQuery
- Queryprotected List<StarPredicate> getPredicateList()
Copyright © 2018 Hitachi Vantara. All rights reserved.