Package mondrian.spi.impl
Class MonetDbDialect
- java.lang.Object
-
- mondrian.spi.impl.JdbcDialectImpl
-
- mondrian.spi.impl.MonetDbDialect
-
- All Implemented Interfaces:
Dialect
public class MonetDbDialect extends JdbcDialectImpl
Implementation ofDialect
for the MonetDB database.- Since:
- Nov 10, 2012
- Author:
- pstoellberger
-
-
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 MonetDbDialect()
MonetDbDialect(Connection connection)
Creates a MonetDbDialect.
-
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
allowsCountDistinct()
Returns whether this Dialect supports distinct aggregations.boolean
allowsCountDistinctWithOtherAggs()
Returns whether this Dialect supports distinct aggregations with other aggregations in the same query.boolean
allowsMultipleCountDistinct()
Returns whether this Dialect supports more than one distinct aggregation in the same query.boolean
allowsMultipleDistinctSqlMeasures()
Returns whether this Dialect has performant support of distinct SQL measures in the same query.int
compareVersions(String v1, String v2)
Compares two MonetDB versions that contain only digits separated by dots.SqlStatement.Type
getType(ResultSetMetaData metaData, int columnIndex)
Chooses the most appropriate type for accessing the values of a column in a result set for a dialect.void
quoteStringLiteral(StringBuilder buf, String s)
Appends to a buffer a single-quoted SQL string.boolean
requiresAliasForFromQuery()
Returns whether this Dialect requires subqueries in the FROM clause to have an alias.boolean
supportsGroupByExpressions()
Returns whether this Dialect supports expressions in the GROUP BY clause.-
Methods inherited from class mondrian.spi.impl.JdbcDialectImpl
allowsAs, allowsDdl, allowsDialectSharing, allowsFromQuery, allowsJoinOn, allowsOrderByAlias, allowsRegularExpressionInWhereClause, allowsSelectNotInGroupBy, appendHintsAfterFromClause, caseWhenElse, computeStatisticsProviders, deduceIdentifierQuoteString, deduceMaxColumnNameLength, deduceProductName, deduceProductVersion, deduceReadOnly, deduceSupportedResultSetStyles, deduceSupportsSelectNotInGroupBy, extractEmbeddedFlags, generateCountExpression, generateInline, generateInlineForAnsi, generateInlineGeneric, generateOrderByNulls, generateOrderByNullsAnsi, generateOrderItem, generateRegularExpression, getDatabaseProduct, getMaxColumnNameLength, getProduct, getQuoteIdentifierString, getStatisticsProviders, isDatabase, needsExponent, quote, quoteBooleanLiteral, quoteDateLiteral, quoteDateLiteral, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteNumericLiteral, quoteTimeLiteral, quoteTimestampLiteral, quoteTimestampLiteral, requiresGroupByAlias, requiresHavingAlias, requiresOrderByAlias, requiresUnionOrderByExprToBeInSelectClause, requiresUnionOrderByOrdinal, supportsGroupingSets, supportsMultiValueInExpr, supportsResultSetConcurrency, supportsUnlimitedValueList, toString, toUpper
-
-
-
-
Field Detail
-
FACTORY
public static final JdbcDialectFactory FACTORY
-
-
Constructor Detail
-
MonetDbDialect
public MonetDbDialect(Connection connection) throws SQLException
Creates a MonetDbDialect.- Parameters:
connection
- Connection- Throws:
SQLException
- on error
-
MonetDbDialect
public MonetDbDialect()
-
-
Method Detail
-
allowsMultipleDistinctSqlMeasures
public boolean allowsMultipleDistinctSqlMeasures()
Description copied from interface:Dialect
Returns whether this Dialect has performant support of distinct SQL measures in the same query.- Specified by:
allowsMultipleDistinctSqlMeasures
in interfaceDialect
- Overrides:
allowsMultipleDistinctSqlMeasures
in classJdbcDialectImpl
- Returns:
- whether this dialect supports multiple count(distinct subquery) measures in one query.
-
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 interfaceDialect
- Overrides:
allowsCountDistinct
in classJdbcDialectImpl
- Returns:
- whether Dialect allows COUNT DISTINCT
-
allowsCountDistinctWithOtherAggs
public boolean allowsCountDistinctWithOtherAggs()
Description copied from interface:Dialect
Returns whether this Dialect supports distinct aggregations with other aggregations in the same query. This may be enabled for performance reasons (Vertica)- Specified by:
allowsCountDistinctWithOtherAggs
in interfaceDialect
- Overrides:
allowsCountDistinctWithOtherAggs
in classJdbcDialectImpl
- Returns:
- whether this Dialect supports more than one distinct aggregation in the same query
-
allowsMultipleCountDistinct
public boolean allowsMultipleCountDistinct()
Description copied from interface:Dialect
Returns whether this Dialect supports more than one distinct aggregation in the same query.In Derby 10.1,
select couunt(distinct x) from t
select couunt(distinct x), count(distinct y) from t
- Specified by:
allowsMultipleCountDistinct
in interfaceDialect
- Overrides:
allowsMultipleCountDistinct
in classJdbcDialectImpl
- Returns:
- whether this Dialect supports more than one distinct aggregation in the same query
-
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 interfaceDialect
- Overrides:
requiresAliasForFromQuery
in classJdbcDialectImpl
- Returns:
- whether dialewct requires subqueries to have an alias
- See Also:
Dialect.allowsFromQuery()
-
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 classJdbcDialectImpl
- Returns:
- whether Dialect allows multiple arguments to COUNT DISTINCT
- See Also:
Dialect.allowsCountDistinct()
,Dialect.allowsMultipleCountDistinct()
-
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
-
quoteStringLiteral
public void quoteStringLiteral(StringBuilder buf, String s)
Description copied from interface:Dialect
Appends to a buffer a single-quoted SQL string.For example, in the default dialect,
quoteStringLiteral(buf, "Can't")
appends "'Can''t'
" tobuf
.- Specified by:
quoteStringLiteral
in interfaceDialect
- Overrides:
quoteStringLiteral
in classJdbcDialectImpl
- Parameters:
buf
- Buffer to append tos
- Literal
-
getType
public SqlStatement.Type getType(ResultSetMetaData metaData, int columnIndex) throws SQLException
Description copied from interface:Dialect
Chooses the most appropriate type for accessing the values of a column in a result set for a dialect.
Dialect-specific nuances involving type representation should be encapsulated in implementing methods. For example, if a dialect has implicit rules involving scale or precision, they should be handled within this method so the client can simply retrieve the "best fit" SqlStatement.Type for the column.
- Specified by:
getType
in interfaceDialect
- Overrides:
getType
in classJdbcDialectImpl
- Parameters:
metaData
- Results set metadatacolumnIndex
- Column ordinal (0-based)- Returns:
- the most appropriate SqlStatement.Type for the column
- Throws:
SQLException
-
compareVersions
public int compareVersions(String v1, String v2)
Compares two MonetDB versions that contain only digits separated by dots.Examples of MonetDB versions:
11.17.17
11.5.3
- Parameters:
v1
- the first version be comparedv2
- the second version to be compared- Returns:
- the value 0 if two versions are equal; a value less than 0 if the first version number is less than the second one; and a value greater than 0 if the first version number is greater than the second one.
-
-