mondrian.spi.impl
Class VerticaDialect

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

public class VerticaDialect
extends JdbcDialectImpl

Implementation of Dialect for the Vertica database.

Since:
Sept 11, 2009
Version:
$Id: //open/mondrian/src/main/mondrian/spi/impl/VerticaDialect.java#1 $
Author:
Pedro Alves

Nested Class Summary
 
Nested classes/interfaces inherited from interface mondrian.spi.Dialect
Dialect.DatabaseProduct, Dialect.Datatype, Dialect.NullCollation
 
Field Summary
static JdbcDialectFactory FACTORY
           
 
Fields inherited from class mondrian.spi.impl.JdbcDialectImpl
databaseProduct, permitsSelectNotInGroupBy, productVersion
 
Constructor Summary
VerticaDialect(java.sql.Connection connection)
          Creates a VerticaDialect.
 
Method Summary
 java.lang.String generateOrderItem(java.lang.String expr, boolean nullable, boolean ascending)
          Generates an item for an ORDER BY clause, sorting in the required direction, and ensuring that NULL values collate after all non-NULL values.
 boolean requiresAliasForFromQuery()
          Returns whether this Dialect requires subqueries in the FROM clause to have an alias.
 
Methods inherited from class mondrian.spi.impl.JdbcDialectImpl
allowsAs, allowsCompoundCountDistinct, allowsCountDistinct, allowsDdl, allowsDialectSharing, allowsFromQuery, allowsMultipleCountDistinct, allowsMultipleDistinctSqlMeasures, allowsOrderByAlias, allowsSelectNotInGroupBy, appendHintsAfterFromClause, caseWhenElse, deduceIdentifierQuoteString, deduceMaxColumnNameLength, deduceProductName, deduceProductVersion, deduceReadOnly, deduceSupportedResultSetStyles, deduceSupportsSelectNotInGroupBy, generateInline, generateInlineForAnsi, generateInlineGeneric, getDatabaseProduct, getMaxColumnNameLength, getNullCollation, getProduct, getQuoteIdentifierString, needsExponent, quote, quoteBooleanLiteral, quoteDateLiteral, quoteDateLiteral, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteNumericLiteral, quoteStringLiteral, quoteTimeLiteral, quoteTimestampLiteral, requiresGroupByAlias, requiresOrderByAlias, requiresUnionOrderByExprToBeInSelectClause, requiresUnionOrderByOrdinal, supportsGroupByExpressions, supportsGroupingSets, supportsMultiValueInExpr, supportsOrderByNullsLast, 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

VerticaDialect

public VerticaDialect(java.sql.Connection connection)
               throws java.sql.SQLException
Creates a VerticaDialect.

Parameters:
connection - Connection
Throws:
java.sql.SQLException
Method Detail

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 JdbcDialectImpl
Returns:
whether dialewct requires subqueries to have an alias
See Also:
Dialect.allowsFromQuery()

generateOrderItem

public java.lang.String generateOrderItem(java.lang.String expr,
                                          boolean nullable,
                                          boolean ascending)
Description copied from interface: Dialect
Generates an item for an ORDER BY clause, sorting in the required direction, and ensuring that NULL values collate after all non-NULL values.

By default, generateOrderItem(expr, true) generates "expr ASC" and generateOrderItem(expr, false) generates "expr DESC". But depending on Dialect.getNullCollation() and ascending, there may need to be additional code.

For example, on Oracle, where NULLs collate higher than all other values, generateOrderItem(expr, true) generates "expr ASC" and generateOrderItem(expr, false) generates "expr DESC NULLS LAST".

On MySQL, where NULLs collate lower than all other values, generateOrderItem(expr, true) generates "ISNULL(expr), expr ASC" and generateOrderItem(expr, false) generates "expr DESC".

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
Returns:
Expression modified so that NULL values collate last

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