Package mondrian.rolap
Class RolapStar.Column
java.lang.Object
mondrian.rolap.RolapStar.Column
- Direct Known Subclasses:
RolapStar.Measure
- Enclosing class:
- RolapStar
A column in a star schema.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
createInExpr
(String expr, StarColumnPredicate predicate, Dialect.Datatype datatype, SqlQuery sqlQuery) Generates a predicate that a column matches one of a list of values.boolean
generateExprString
(SqlQuery query) Generates a SQL expression, which typically this looks like this:tableName.columnName
.int
long
Get column cardinality from the schema cache if possible; otherwise issue a select count(distinct) query to retrieve the cardinality and stores it in the cache.getDatatypeString
(Dialect dialect) Returns a string representation of the datatype of this column, in the dialect specified.getName()
getStar()
getTable()
int
hashCode()
boolean
void
print
(PrintWriter pw, String prefix) Prints this column.toString()
-
Field Details
-
COMPARATOR
-
-
Constructor Details
-
Column
Fake column.- Parameters:
datatype
- Datatype
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
getName
-
getBitPosition
public int getBitPosition() -
getStar
-
getTable
-
getSqlQuery
-
getNameColumn
-
getParentColumn
-
getUsagePrefix
-
isNameColumn
public boolean isNameColumn() -
getExpression
-
generateExprString
Generates a SQL expression, which typically this looks like this:tableName.columnName
. -
getCardinality
public long getCardinality()Get column cardinality from the schema cache if possible; otherwise issue a select count(distinct) query to retrieve the cardinality and stores it in the cache.- Returns:
- the column cardinality.
-
createInExpr
public static String createInExpr(String expr, StarColumnPredicate predicate, Dialect.Datatype datatype, SqlQuery sqlQuery) Generates a predicate that a column matches one of a list of values.Several possible outputs, depending upon whether the there are nulls:
- One not-null value:
foo.bar = 1
- All values not null:
foo.bar in (1, 2, 3)
</li - Null and not null values:
(foo.bar is null or foo.bar in (1, 2))
- Only null values:
foo.bar is null
- String values:
foo.bar in ('a', 'b', 'c')
- One not-null value:
-
toString
-
print
Prints this column.- Parameters:
pw
- Print writerprefix
- Prefix to print first, such as spaces for indentation
-
getDatatype
-
getDatatypeString
Returns a string representation of the datatype of this column, in the dialect specified. For example, 'DECIMAL(10, 2) NOT NULL'.- Parameters:
dialect
- Dialect- Returns:
- String representation of column's datatype
-
getInternalType
-