public class InfobrightDialect extends MySqlDialect
Dialect
for the Infobright database.Dialect.DatabaseProduct, Dialect.Datatype
Modifier and Type | Field and Description |
---|---|
static JdbcDialectFactory |
FACTORY |
databaseProduct, permitsSelectNotInGroupBy, productVersion
Constructor and Description |
---|
InfobrightDialect(Connection connection)
Creates an InfobrightDialect.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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 the
collateNullsLast
parameter. |
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()
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.
|
allowsFromQuery, allowsRegularExpressionInWhereClause, appendHintsAfterFromClause, deduceIdentifierQuoteString, deduceProductName, deduceSupportsSelectNotInGroupBy, generateInline, generateOrderByNulls, generateRegularExpression, isInfobright, quoteBooleanLiteral, quoteStringLiteral, requiresAliasForFromQuery, requiresHavingAlias
allowsAs, allowsCountDistinct, allowsCountDistinctWithOtherAggs, allowsDdl, allowsDialectSharing, allowsJoinOn, allowsMultipleCountDistinct, allowsMultipleDistinctSqlMeasures, allowsSelectNotInGroupBy, caseWhenElse, computeStatisticsProviders, deduceMaxColumnNameLength, deduceProductVersion, deduceReadOnly, deduceSupportedResultSetStyles, generateCountExpression, generateInlineForAnsi, generateInlineGeneric, generateOrderByNullsAnsi, getMaxColumnNameLength, getProduct, getQuoteIdentifierString, getStatisticsProviders, getType, isDatabase, needsExponent, quote, quoteDateLiteral, quoteDateLiteral, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteNumericLiteral, quoteTimeLiteral, quoteTimestampLiteral, requiresUnionOrderByExprToBeInSelectClause, requiresUnionOrderByOrdinal, supportsGroupingSets, supportsResultSetConcurrency, supportsUnlimitedValueList, toString, toUpper
public static final JdbcDialectFactory FACTORY
public InfobrightDialect(Connection connection) throws SQLException
connection
- ConnectionSQLException
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()
-
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 the collateNullsLast
parameter.
- Specified by:
generateOrderItem
in interface Dialect
- Overrides:
generateOrderItem
in class JdbcDialectImpl
- Parameters:
expr
- Expression
nullable
- Whether expression may have NULL values
ascending
- Whether to sort expression ascending
collateNullsLast
- 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 interface Dialect
- Overrides:
supportsGroupByExpressions
in class JdbcDialectImpl
- 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
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.
- Specified by:
requiresGroupByAlias
in interface Dialect
- Overrides:
requiresGroupByAlias
in class JdbcDialectImpl
- 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
would be legal.
MySQL, DB2 and Ingres are examples of dialects where this is true;
Access is a dialect where this is false.
- Specified by:
allowsOrderByAlias
in interface Dialect
- Overrides:
allowsOrderByAlias
in class JdbcDialectImpl
- 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 interface Dialect
- Overrides:
requiresOrderByAlias
in class MySqlDialect
- 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 interface Dialect
- Overrides:
supportsMultiValueInExpr
in class MySqlDialect
- Returns:
- true if the dialect supports multi-value IN expressions
Copyright © 2018 Hitachi Vantara. All rights reserved.