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
public class InfobrightDialect extends MySqlDialect
Implementation ofDialect
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
Fields Modifier and Type Field Description static JdbcDialectFactory
FACTORY
-
Fields inherited from class mondrian.spi.impl.JdbcDialectImpl
databaseProduct, permitsSelectNotInGroupBy, productVersion
-
-
Constructor Summary
Constructors Constructor Description InfobrightDialect(Connection connection)
Creates an InfobrightDialect.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowsCompoundCountDistinct()
Returns whether this Dialect allows multiple arguments to theCOUNT(DISTINCT ...) aggregate function, for example
SELECT COUNT(DISTINCT x, y) FROM t
boolean
allowsOrderByAlias()
Returns true if aliases defined in the SELECT clause can be used as expressions in the ORDER BY clause.String
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 thecollateNullsLast
parameter.Dialect.DatabaseProduct
getDatabaseProduct()
Returns the database for this Dialect, orDialect.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()
Required for MySQL 5.7+, where SQL_MODE include ONLY_FULL_GROUP_BY by default.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, allowsRegularExpressionInWhereClause, appendHintsAfterFromClause, deduceIdentifierQuoteString, deduceProductName, deduceSupportsSelectNotInGroupBy, generateInline, generateOrderByNulls, generateRegularExpression, isInfobright, quoteBooleanLiteral, quoteStringLiteral, requiresAliasForFromQuery, requiresHavingAlias
-
Methods 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 Detail
-
FACTORY
public static final JdbcDialectFactory FACTORY
-
-
Constructor Detail
-
InfobrightDialect
public InfobrightDialect(Connection connection) throws SQLException
Creates an InfobrightDialect.- Parameters:
connection
- Connection- Throws:
SQLException
-
-
Method Detail
-
getDatabaseProduct
public Dialect.DatabaseProduct getDatabaseProduct()
Description copied from interface:Dialect
Returns the database for this Dialect, orDialect.DatabaseProduct.UNKNOWN
if the database is not a common database.- Specified by:
getDatabaseProduct
in interfaceDialect
- Overrides:
getDatabaseProduct
in classJdbcDialectImpl
- Returns:
- Database
-
allowsCompoundCountDistinct
public boolean allowsCompoundCountDistinct()
Description copied from interface:Dialect
Returns whether this Dialect allows multiple arguments to theCOUNT(DISTINCT ...) aggregate function, for example
SELECT COUNT(DISTINCT x, y) FROM t
- Specified by:
allowsCompoundCountDistinct
in interfaceDialect
- Overrides:
allowsCompoundCountDistinct
in classMySqlDialect
- Returns:
- whether Dialect allows multiple arguments to COUNT DISTINCT
- See Also:
Dialect.allowsCountDistinct()
,Dialect.allowsMultipleCountDistinct()
-
generateOrderItem
public String generateOrderItem(String expr, boolean nullable, boolean ascending, boolean collateNullsLast)
Description copied from interface:Dialect
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 thecollateNullsLast
parameter.- Specified by:
generateOrderItem
in interfaceDialect
- Overrides:
generateOrderItem
in 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:Dialect
Returns whether this Dialect supports expressions in the GROUP BY clause. Derby/Cloudscape and Infobright do not.- Specified by:
supportsGroupByExpressions
in interfaceDialect
- Overrides:
supportsGroupByExpressions
in classJdbcDialectImpl
- Returns:
- Whether this Dialect allows expressions in the GROUP BY clause
-
requiresGroupByAlias
public boolean requiresGroupByAlias()
Description copied from interface:Dialect
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.For example, in such a dialect,
SELECT x, x FROM t GROUP BY x
SELECT x AS a, x AS b FROM t ORDER BY a, b
Infobright is the only such dialect.
- Specified by:
requiresGroupByAlias
in interfaceDialect
- Overrides:
requiresGroupByAlias
in 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:Dialect
Returns true if aliases defined in the SELECT clause can be used as expressions in the ORDER BY clause.For example, in such a dialect,
SELECT x, x + y AS z FROM t ORDER BY z
MySQL, DB2 and Ingres are examples of dialects where this is true; Access is a dialect where this is false.
- Specified by:
allowsOrderByAlias
in interfaceDialect
- Overrides:
allowsOrderByAlias
in 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:MySqlDialect
Required 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:
requiresOrderByAlias
in interfaceDialect
- Overrides:
requiresOrderByAlias
in classMySqlDialect
- Returns:
- true when MySQL version is 5.7 or larger
-
supportsMultiValueInExpr
public boolean supportsMultiValueInExpr()
Description copied from interface:Dialect
Returns true if this dialect supports multi-value IN expressions. E.g.,WHERE (col1, col2) IN ((val1a, val2a), (val1b, val2b))
- Specified by:
supportsMultiValueInExpr
in interfaceDialect
- Overrides:
supportsMultiValueInExpr
in classMySqlDialect
- Returns:
- true if the dialect supports multi-value IN expressions
-
-