Class InfobrightDialect

All Implemented Interfaces:
Dialect

public class InfobrightDialect extends MySqlDialect
Implementation of Dialect for the Infobright database.
Since:
Nov 23, 2008
Author:
jhyde
  • Field Details

  • Constructor Details

    • InfobrightDialect

      public InfobrightDialect(Connection connection) throws SQLException
      Creates an InfobrightDialect.
      Parameters:
      connection - Connection
      Throws:
      SQLException
  • Method Details

    • getDatabaseProduct

      public Dialect.DatabaseProduct getDatabaseProduct()
      Description copied from interface: Dialect
      Returns the database for this Dialect, or Dialect.DatabaseProduct.UNKNOWN if the database is not a common database.
      Specified by:
      getDatabaseProduct in interface Dialect
      Overrides:
      getDatabaseProduct in class JdbcDialectImpl
      Returns:
      Database
    • allowsCompoundCountDistinct

      public boolean allowsCompoundCountDistinct()
      Description copied from interface: Dialect
      Returns whether this Dialect allows multiple arguments to the 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:
    • 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