mondrian.spi.impl
Class GreenplumDialect

java.lang.Object
  extended by mondrian.spi.impl.JdbcDialectImpl
      extended by mondrian.spi.impl.PostgreSqlDialect
          extended by mondrian.spi.impl.GreenplumDialect
All Implemented Interfaces:
Dialect

public class GreenplumDialect
extends PostgreSqlDialect

Implementation of Dialect for the GreenplumSQL database.

Since:
Dec 23, 2009
Author:
Millersoft

Nested Class Summary
 
Nested classes/interfaces inherited from interface mondrian.spi.Dialect
Dialect.DatabaseProduct, Dialect.Datatype
 
Field Summary
static JdbcDialectFactory FACTORY
           
 
Fields inherited from class mondrian.spi.impl.JdbcDialectImpl
databaseProduct, permitsSelectNotInGroupBy, productVersion
 
Constructor Summary
GreenplumDialect(Connection connection)
          Creates a GreenplumDialect.
 
Method Summary
 boolean allowsCountDistinct()
          Returns whether this Dialect supports distinct aggregations.
 boolean allowsFromQuery()
          Returns whether this Dialect allows a subquery in the from clause, for example SELECT * FROM (SELECT * FROM t) AS x
 boolean allowsRegularExpressionInWhereClause()
          Informs Mondrian if the dialect supports regular expressions when creating the 'where' or the 'having' clause.
 String generateCountExpression(String exp)
          Some databases, like Greenplum, don't include nulls as part of the results of a COUNT sql call.
 Dialect.DatabaseProduct getDatabaseProduct()
          Returns the database for this Dialect, or Dialect.DatabaseProduct.UNKNOWN if the database is not a common database.
 boolean requiresAliasForFromQuery()
          Returns whether this Dialect requires subqueries in the FROM clause to have an alias.
 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 supportsGroupingSets()
          Returns whether this Dialect allows the GROUPING SETS construct in the GROUP BY clause.
 
Methods inherited from class mondrian.spi.impl.PostgreSqlDialect
generateOrderByNulls, generateRegularExpression, isGreenplum
 
Methods inherited from class mondrian.spi.impl.JdbcDialectImpl
allowsAs, allowsCompoundCountDistinct, allowsDdl, allowsDialectSharing, allowsJoinOn, allowsMultipleCountDistinct, allowsMultipleDistinctSqlMeasures, allowsOrderByAlias, allowsSelectNotInGroupBy, appendHintsAfterFromClause, caseWhenElse, deduceIdentifierQuoteString, deduceMaxColumnNameLength, deduceProductName, deduceProductVersion, deduceReadOnly, deduceSupportedResultSetStyles, deduceSupportsSelectNotInGroupBy, generateInline, generateInlineForAnsi, generateInlineGeneric, generateOrderByNullsAnsi, generateOrderItem, generateOrderItem, getMaxColumnNameLength, getProduct, getQuoteIdentifierString, needsExponent, quote, quoteBooleanLiteral, quoteDateLiteral, quoteDateLiteral, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteNumericLiteral, quoteStringLiteral, quoteTimeLiteral, quoteTimestampLiteral, requiresHavingAlias, requiresOrderByAlias, requiresUnionOrderByExprToBeInSelectClause, requiresUnionOrderByOrdinal, supportsGroupByExpressions, supportsMultiValueInExpr, supportsResultSetConcurrency, supportsUnlimitedValueList, toString, toUpper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FACTORY

public static final JdbcDialectFactory FACTORY
Constructor Detail

GreenplumDialect

public GreenplumDialect(Connection connection)
                 throws SQLException
Creates a GreenplumDialect.

Parameters:
connection - Connection
Throws:
SQLException
Method Detail

supportsGroupingSets

public boolean supportsGroupingSets()
Description copied from interface: Dialect
Returns whether this Dialect allows the GROUPING SETS construct in the GROUP BY clause. Currently Greenplum, IBM DB2, Oracle, and Teradata.

Specified by:
supportsGroupingSets in interface Dialect
Overrides:
supportsGroupingSets in class JdbcDialectImpl
Returns:
Whether this Dialect allows GROUPING SETS 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

requiresAliasForFromQuery

public boolean requiresAliasForFromQuery()
Description copied from interface: Dialect
Returns whether this Dialect requires subqueries in the FROM clause to have an alias.

Specified by:
requiresAliasForFromQuery in interface Dialect
Overrides:
requiresAliasForFromQuery in class PostgreSqlDialect
Returns:
whether dialewct requires subqueries to have an alias
See Also:
Dialect.allowsFromQuery()

allowsCountDistinct

public boolean allowsCountDistinct()
Description copied from interface: Dialect
Returns whether this Dialect supports distinct aggregations.

For example, Access does not allow

select count(distinct x) from t

Specified by:
allowsCountDistinct in interface Dialect
Overrides:
allowsCountDistinct in class JdbcDialectImpl
Returns:
whether Dialect allows COUNT DISTINCT

allowsFromQuery

public boolean allowsFromQuery()
Description copied from interface: Dialect
Returns whether this Dialect allows a subquery in the from clause, for example
SELECT * FROM (SELECT * FROM t) AS x

Specified by:
allowsFromQuery in interface Dialect
Overrides:
allowsFromQuery in class JdbcDialectImpl
Returns:
whether Dialect allows subquery in FROM clause
See Also:
Dialect.requiresAliasForFromQuery()

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 PostgreSqlDialect
Returns:
Database

generateCountExpression

public String generateCountExpression(String exp)
Description copied from interface: Dialect
Some databases, like Greenplum, don't include nulls as part of the results of a COUNT sql call. This allows dialects to wrap the count expression in something before it is used in the query.

Specified by:
generateCountExpression in interface Dialect
Overrides:
generateCountExpression in class JdbcDialectImpl
Parameters:
exp - The expression to wrap.
Returns:
A valid expression to use for a count operation.

allowsRegularExpressionInWhereClause

public boolean allowsRegularExpressionInWhereClause()
Description copied from interface: Dialect
Informs Mondrian if the dialect supports regular expressions when creating the 'where' or the 'having' clause.

Specified by:
allowsRegularExpressionInWhereClause in interface Dialect
Overrides:
allowsRegularExpressionInWhereClause in class PostgreSqlDialect
Returns:
True if regular expressions are supported.

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads