|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmondrian.spi.impl.JdbcDialectImpl
mondrian.spi.impl.MySqlDialect
mondrian.spi.impl.InfobrightDialect
public class InfobrightDialect
Implementation of Dialect
for the Infobright database.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface mondrian.spi.Dialect |
---|
Dialect.DatabaseProduct, Dialect.Datatype, Dialect.NullCollation |
Field Summary | |
---|---|
static JdbcDialectFactory |
FACTORY
|
Fields inherited from class mondrian.spi.impl.JdbcDialectImpl |
---|
databaseProduct, permitsSelectNotInGroupBy, productVersion |
Constructor Summary | |
---|---|
InfobrightDialect(java.sql.Connection connection)
Creates an InfobrightDialect. |
Method Summary | |
---|---|
boolean |
allowsCompoundCountDistinct()
Returns whether this Dialect allows multiple arguments to the COUNT(DISTINCT ...) aggregate function, for example
|
boolean |
allowsOrderByAlias()
Returns true if aliases defined in the SELECT clause can be used as expressions in the ORDER BY clause. |
java.lang.String |
generateOrderItem(java.lang.String expr,
boolean nullable,
boolean ascending)
Generates an item for an ORDER BY clause, sorting in the required direction, and ensuring that NULL values collate after all non-NULL values. |
Dialect.DatabaseProduct |
getDatabaseProduct()
Returns the database for this Dialect, or Dialect.DatabaseProduct.UNKNOWN if the database is
not a common database. |
boolean |
requiresGroupByAlias()
Returns true if this Dialect can include expressions in the GROUP BY clause only by adding an expression to the SELECT clause and using its alias. |
boolean |
requiresOrderByAlias()
Returns true if this Dialect can include expressions in the ORDER BY clause only by adding an expression to the SELECT clause and using its alias. |
boolean |
supportsGroupByExpressions()
Returns whether this Dialect supports expressions in the GROUP BY clause. |
boolean |
supportsMultiValueInExpr()
Returns true if this dialect supports multi-value IN expressions. |
Methods inherited from class mondrian.spi.impl.MySqlDialect |
---|
allowsFromQuery, appendHintsAfterFromClause, deduceIdentifierQuoteString, deduceProductName, deduceSupportsSelectNotInGroupBy, generateInline, getNullCollation, isInfobright, requiresAliasForFromQuery |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final JdbcDialectFactory FACTORY
Constructor Detail |
---|
public InfobrightDialect(java.sql.Connection connection) throws java.sql.SQLException
connection
- Connection
java.sql.SQLException
Method Detail |
---|
public Dialect.DatabaseProduct getDatabaseProduct()
Dialect
Dialect.DatabaseProduct.UNKNOWN
if the database is
not a common database.
getDatabaseProduct
in interface Dialect
getDatabaseProduct
in class JdbcDialectImpl
public boolean allowsCompoundCountDistinct()
Dialect
COUNT(DISTINCT ...) aggregate function, for example
SELECT COUNT(DISTINCT x, y) FROM t
- Specified by:
allowsCompoundCountDistinct
in interface Dialect
- Overrides:
allowsCompoundCountDistinct
in class MySqlDialect
- Returns:
- whether Dialect allows multiple arguments to COUNT DISTINCT
- See Also:
Dialect.allowsCountDistinct()
,
Dialect.allowsMultipleCountDistinct()
public java.lang.String generateOrderItem(java.lang.String expr, boolean nullable, boolean ascending)
Dialect
By default, generateOrderItem(expr, true)
generates "expr ASC"
and generateOrderItem(expr, false)
generates "expr DESC". But
depending on Dialect.getNullCollation()
and ascending
, there
may need to be additional code.
For example, on Oracle, where NULLs collate higher than all other
values, generateOrderItem(expr, true)
generates "expr ASC" and
generateOrderItem(expr, false)
generates "expr DESC NULLS LAST".
On MySQL, where NULLs collate lower than all other values,
generateOrderItem(expr, true)
generates "ISNULL(expr), expr ASC"
and generateOrderItem(expr, false)
generates "expr DESC".
generateOrderItem
in interface Dialect
generateOrderItem
in class MySqlDialect
expr
- Expressionnullable
- Whether expression may have NULL valuesascending
- Whether to sort expression ascending
public boolean supportsGroupByExpressions()
Dialect
supportsGroupByExpressions
in interface Dialect
supportsGroupByExpressions
in class JdbcDialectImpl
public boolean requiresGroupByAlias()
Dialect
For example, in such a dialect,
SELECT x, x FROM t GROUP BY x
would be illegal, but
SELECT x AS a, x AS b FROM t ORDER BY a, b
would be legal.
Infobright is the only such dialect.
requiresGroupByAlias
in interface Dialect
requiresGroupByAlias
in class JdbcDialectImpl
public boolean allowsOrderByAlias()
Dialect
For example, in such a dialect,
SELECT x, x + y AS z FROM t ORDER BY z
would be legal.
MySQL, DB2 and Ingres are examples of dialects where this is true; Access is a dialect where this is false.
allowsOrderByAlias
in interface Dialect
allowsOrderByAlias
in class JdbcDialectImpl
public boolean requiresOrderByAlias()
Dialect
For example, in such a dialect,
SELECT x FROM t ORDER BY x + y
would be illegal, but
SELECT x, x + y AS z FROM t ORDER BY z
would be legal.
MySQL, DB2 and Ingres are examples of such dialects.
requiresOrderByAlias
in interface Dialect
requiresOrderByAlias
in class MySqlDialect
public boolean supportsMultiValueInExpr()
Dialect
WHERE (col1, col2) IN ((val1a, val2a), (val1b, val2b))
supportsMultiValueInExpr
in interface Dialect
supportsMultiValueInExpr
in class MySqlDialect
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |