Package mondrian.rolap
Class RolapStar.Column
- java.lang.Object
-
- mondrian.rolap.RolapStar.Column
-
- Direct Known Subclasses:
RolapStar.Measure
- Enclosing class:
- RolapStar
public static class RolapStar.Column extends Object
A column in a star schema.
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<RolapStar.Column>COMPARATOR
-
Constructor Summary
Constructors Modifier Constructor Description protectedColumn(Dialect.Datatype datatype)Fake column.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringcreateInExpr(String expr, StarColumnPredicate predicate, Dialect.Datatype datatype, SqlQuery sqlQuery)Generates a predicate that a column matches one of a list of values.booleanequals(Object obj)StringgenerateExprString(SqlQuery query)Generates a SQL expression, which typically this looks like this:tableName.columnName.intgetBitPosition()longgetCardinality()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.Dialect.DatatypegetDatatype()StringgetDatatypeString(Dialect dialect)Returns a string representation of the datatype of this column, in the dialect specified.MondrianDef.ExpressiongetExpression()SqlStatement.TypegetInternalType()StringgetName()RolapStar.ColumngetNameColumn()RolapStar.ColumngetParentColumn()SqlQuerygetSqlQuery()RolapStargetStar()RolapStar.TablegetTable()StringgetUsagePrefix()inthashCode()booleanisNameColumn()voidprint(PrintWriter pw, String prefix)Prints this column.StringtoString()
-
-
-
Field Detail
-
COMPARATOR
public static final Comparator<RolapStar.Column> COMPARATOR
-
-
Constructor Detail
-
Column
protected Column(Dialect.Datatype datatype)
Fake column.- Parameters:
datatype- Datatype
-
-
Method Detail
-
getName
public String getName()
-
getBitPosition
public int getBitPosition()
-
getStar
public RolapStar getStar()
-
getTable
public RolapStar.Table getTable()
-
getSqlQuery
public SqlQuery getSqlQuery()
-
getNameColumn
public RolapStar.Column getNameColumn()
-
getParentColumn
public RolapStar.Column getParentColumn()
-
getUsagePrefix
public String getUsagePrefix()
-
isNameColumn
public boolean isNameColumn()
-
getExpression
public MondrianDef.Expression getExpression()
-
generateExprString
public String generateExprString(SqlQuery query)
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)Null and not null values:
- Only null values:
foo.bar is null - String values:
foo.bar in ('a', 'b', 'c')
(foo.bar is null or foo.bar in (1, 2)) - One not-null value:
-
print
public void print(PrintWriter pw, String prefix)
Prints this column.- Parameters:
pw- Print writerprefix- Prefix to print first, such as spaces for indentation
-
getDatatype
public Dialect.Datatype getDatatype()
-
getDatatypeString
public String getDatatypeString(Dialect dialect)
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
public SqlStatement.Type getInternalType()
-
-