Package mondrian.spi.impl
Class InfobrightDialect
java.lang.Object
mondrian.spi.impl.JdbcDialectImpl
mondrian.spi.impl.MySqlDialect
mondrian.spi.impl.InfobrightDialect
- All Implemented Interfaces:
Dialect
Implementation of
Dialect for the Infobright database.- Since:
- Nov 23, 2008
- Author:
- jhyde
-
Nested Class Summary
Nested classes/interfaces inherited from interface mondrian.spi.Dialect
Dialect.DatabaseProduct, Dialect.Datatype -
Field Summary
FieldsFields inherited from class mondrian.spi.impl.JdbcDialectImpl
databaseProduct, permitsSelectNotInGroupBy, productVersion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this Dialect allows multiple arguments to theCOUNT(DISTINCT ...) aggregate function, for exampleSELECT COUNT(DISTINCT x, y) FROM tbooleanReturns true if aliases defined in the SELECT clause can be used as expressions in the ORDER BY clause.generateOrderItem(String expr, boolean nullable, boolean ascending, boolean collateNullsLast) Generates an item for an ORDER BY clause, sorting in the required direction, and ensuring that NULL values collate either before or after all non-NULL values, depending on thecollateNullsLastparameter.Returns the database for this Dialect, orDialect.DatabaseProduct.UNKNOWNif the database is not a common database.booleanReturns 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.booleanRequired for MySQL 5.7+, where SQL_MODE include ONLY_FULL_GROUP_BY by default.booleanReturns whether this Dialect supports expressions in the GROUP BY clause.booleanReturns true if this dialect supports multi-value IN expressions.Methods inherited from class mondrian.spi.impl.MySqlDialect
allowsFromQuery, allowsRegularExpressionInWhereClause, appendHintsAfterFromClause, deduceIdentifierQuoteString, deduceProductName, deduceSupportsSelectNotInGroupBy, generateInline, generateOrderByNulls, generateRegularExpression, isInfobright, quoteBooleanLiteral, quoteStringLiteral, requiresAliasForFromQuery, requiresHavingAliasMethods inherited from class mondrian.spi.impl.JdbcDialectImpl
allowsAs, allowsCountDistinct, allowsCountDistinctWithOtherAggs, allowsDdl, allowsDialectSharing, allowsJoinOn, allowsMultipleCountDistinct, allowsMultipleDistinctSqlMeasures, allowsSelectNotInGroupBy, caseWhenElse, computeStatisticsProviders, deduceMaxColumnNameLength, deduceProductVersion, deduceReadOnly, deduceSupportedResultSetStyles, extractEmbeddedFlags, generateCountExpression, generateInlineForAnsi, generateInlineGeneric, generateOrderByNullsAnsi, getMaxColumnNameLength, getProduct, getQuoteIdentifierString, getStatisticsProviders, getType, isDatabase, needsExponent, quote, quoteDateLiteral, quoteDateLiteral, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteNumericLiteral, quoteTimeLiteral, quoteTimestampLiteral, quoteTimestampLiteral, requiresUnionOrderByExprToBeInSelectClause, requiresUnionOrderByOrdinal, supportsGroupingSets, supportsResultSetConcurrency, supportsUnlimitedValueList, toString, toUpper
-
Field Details
-
FACTORY
-
-
Constructor Details
-
InfobrightDialect
Creates an InfobrightDialect.- Parameters:
connection- Connection- Throws:
SQLException
-
-
Method Details
-
getDatabaseProduct
Description copied from interface:DialectReturns the database for this Dialect, orDialect.DatabaseProduct.UNKNOWNif the database is not a common database.- Specified by:
getDatabaseProductin interfaceDialect- Overrides:
getDatabaseProductin classJdbcDialectImpl- Returns:
- Database
-
allowsCompoundCountDistinct
public boolean allowsCompoundCountDistinct()Description copied from interface:DialectReturns whether this Dialect allows multiple arguments to theCOUNT(DISTINCT ...) aggregate function, for exampleSELECT COUNT(DISTINCT x, y) FROM t- Specified by:
allowsCompoundCountDistinctin interfaceDialect- Overrides:
allowsCompoundCountDistinctin classMySqlDialect- Returns:
- whether Dialect allows multiple arguments to COUNT DISTINCT
- See Also:
-
generateOrderItem
public String generateOrderItem(String expr, boolean nullable, boolean ascending, boolean collateNullsLast) Description copied from interface:DialectGenerates an item for an ORDER BY clause, sorting in the required direction, and ensuring that NULL values collate either before or after all non-NULL values, depending on thecollateNullsLastparameter.- Specified by:
generateOrderItemin interfaceDialect- Overrides:
generateOrderItemin classJdbcDialectImpl- Parameters:
expr- Expressionnullable- Whether expression may have NULL valuesascending- Whether to sort expression ascendingcollateNullsLast- Whether the null values should be sorted first or last.- Returns:
- Expression modified so that NULL values collate last
-
supportsGroupByExpressions
public boolean supportsGroupByExpressions()Description copied from interface:DialectReturns whether this Dialect supports expressions in the GROUP BY clause. Derby/Cloudscape and Infobright do not.- Specified by:
supportsGroupByExpressionsin interfaceDialect- Overrides:
supportsGroupByExpressionsin classJdbcDialectImpl- Returns:
- Whether this Dialect allows expressions in the GROUP BY clause
-
requiresGroupByAlias
public boolean requiresGroupByAlias()Description copied from interface:DialectReturns 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.For example, in such a dialect,
would be illegal, butSELECT x, x FROM t GROUP BY x
would be legal.SELECT x AS a, x AS b FROM t ORDER BY a, bInfobright is the only such dialect.
- Specified by:
requiresGroupByAliasin interfaceDialect- Overrides:
requiresGroupByAliasin classJdbcDialectImpl- Returns:
- Whether this Dialect can include expressions in the GROUP BY clause only by adding an expression to the SELECT clause and using its alias
-
allowsOrderByAlias
public boolean allowsOrderByAlias()Description copied from interface:DialectReturns true if aliases defined in the SELECT clause can be used as expressions in the ORDER BY clause.For example, in such a dialect,
would be legal.SELECT x, x + y AS z FROM t ORDER BY zMySQL, DB2 and Ingres are examples of dialects where this is true; Access is a dialect where this is false.
- Specified by:
allowsOrderByAliasin interfaceDialect- Overrides:
allowsOrderByAliasin classJdbcDialectImpl- Returns:
- Whether aliases defined in the SELECT clause can be used as expressions in the ORDER BY clause.
-
requiresOrderByAlias
public boolean requiresOrderByAlias()Description copied from class:MySqlDialectRequired for MySQL 5.7+, where SQL_MODE include ONLY_FULL_GROUP_BY by default. This prevent expressions like ISNULL(RTRIM(`promotion_name`)) ASC from being used in ORDER BY section. ISNULL(`c0`) ASC will be used, where `c0` is an alias of the RTRIM(`promotion_name`). And this is important for the cases where we're using SQL expressions in a Level definition. Jira ticket, that describes the issue: http://jira.pentaho.com/browse/MONDRIAN-2451- Specified by:
requiresOrderByAliasin interfaceDialect- Overrides:
requiresOrderByAliasin classMySqlDialect- Returns:
- true when MySQL version is 5.7 or larger
-
supportsMultiValueInExpr
public boolean supportsMultiValueInExpr()Description copied from interface:DialectReturns true if this dialect supports multi-value IN expressions. E.g.,WHERE (col1, col2) IN ((val1a, val2a), (val1b, val2b))- Specified by:
supportsMultiValueInExprin interfaceDialect- Overrides:
supportsMultiValueInExprin classMySqlDialect- Returns:
- true if the dialect supports multi-value IN expressions
-