Package mondrian.spi.impl
Class MonetDbDialect
java.lang.Object
mondrian.spi.impl.JdbcDialectImpl
mondrian.spi.impl.MonetDbDialect
- All Implemented Interfaces:
Dialect
Implementation of
Dialect 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
FieldsFields inherited from class mondrian.spi.impl.JdbcDialectImpl
databaseProduct, permitsSelectNotInGroupBy, productVersion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this Dialect allows multiple arguments to theCOUNT(DISTINCT ...) aggregate function, for exampleSELECT COUNT(DISTINCT x, y) FROM tbooleanReturns whether this Dialect supports distinct aggregations.booleanReturns whether this Dialect supports distinct aggregations with other aggregations in the same query.booleanReturns whether this Dialect supports more than one distinct aggregation in the same query.booleanReturns whether this Dialect has performant support of distinct SQL measures in the same query.intcompareVersions(String v1, String v2) Compares two MonetDB versions that contain only digits separated by dots.getType(ResultSetMetaData metaData, int columnIndex) Chooses the most appropriate type for accessing the values of a column in a result set for a dialect.voidquoteStringLiteral(StringBuilder buf, String s) Appends to a buffer a single-quoted SQL string.booleanReturns whether this Dialect requires subqueries in the FROM clause to have an alias.booleanReturns 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 Details
-
FACTORY
-
-
Constructor Details
-
MonetDbDialect
Creates a MonetDbDialect.- Parameters:
connection- Connection- Throws:
SQLException- on error
-
MonetDbDialect
public MonetDbDialect()
-
-
Method Details
-
allowsMultipleDistinctSqlMeasures
public boolean allowsMultipleDistinctSqlMeasures()Description copied from interface:DialectReturns whether this Dialect has performant support of distinct SQL measures in the same query.- Specified by:
allowsMultipleDistinctSqlMeasuresin interfaceDialect- Overrides:
allowsMultipleDistinctSqlMeasuresin classJdbcDialectImpl- Returns:
- whether this dialect supports multiple count(distinct subquery) measures in one query.
-
allowsCountDistinct
public boolean allowsCountDistinct()Description copied from interface:DialectReturns whether this Dialect supports distinct aggregations.For example, Access does not allow
select count(distinct x) from t- Specified by:
allowsCountDistinctin interfaceDialect- Overrides:
allowsCountDistinctin classJdbcDialectImpl- Returns:
- whether Dialect allows COUNT DISTINCT
-
allowsCountDistinctWithOtherAggs
public boolean allowsCountDistinctWithOtherAggs()Description copied from interface:DialectReturns whether this Dialect supports distinct aggregations with other aggregations in the same query. This may be enabled for performance reasons (Vertica)- Specified by:
allowsCountDistinctWithOtherAggsin interfaceDialect- Overrides:
allowsCountDistinctWithOtherAggsin classJdbcDialectImpl- Returns:
- whether this Dialect supports more than one distinct aggregation in the same query
-
allowsMultipleCountDistinct
public boolean allowsMultipleCountDistinct()Description copied from interface:DialectReturns whether this Dialect supports more than one distinct aggregation in the same query.In Derby 10.1,
is OK, butselect couunt(distinct x) from t
gives "Multiple DISTINCT aggregates are not supported at this time."select couunt(distinct x), count(distinct y) from t- Specified by:
allowsMultipleCountDistinctin interfaceDialect- Overrides:
allowsMultipleCountDistinctin classJdbcDialectImpl- Returns:
- whether this Dialect supports more than one distinct aggregation in the same query
-
requiresAliasForFromQuery
public boolean requiresAliasForFromQuery()Description copied from interface:DialectReturns whether this Dialect requires subqueries in the FROM clause to have an alias.- Specified by:
requiresAliasForFromQueryin interfaceDialect- Overrides:
requiresAliasForFromQueryin classJdbcDialectImpl- Returns:
- whether dialewct requires subqueries to have an alias
- See Also:
-
allowsCompoundCountDistinct
public boolean allowsCompoundCountDistinct()Description copied from interface:DialectReturns whether this Dialect allows multiple arguments to theCOUNT(DISTINCT ...) aggregate function, for exampleSELECT COUNT(DISTINCT x, y) FROM t- Specified by:
allowsCompoundCountDistinctin interfaceDialect- Overrides:
allowsCompoundCountDistinctin classJdbcDialectImpl- Returns:
- whether Dialect allows multiple arguments to COUNT DISTINCT
- See Also:
-
supportsGroupByExpressions
public boolean supportsGroupByExpressions()Description copied from interface:DialectReturns whether this Dialect supports expressions in the GROUP BY clause. Derby/Cloudscape and Infobright do not.- Specified by:
supportsGroupByExpressionsin interfaceDialect- Overrides:
supportsGroupByExpressionsin classJdbcDialectImpl- Returns:
- Whether this Dialect allows expressions in the GROUP BY clause
-
quoteStringLiteral
Description copied from interface:DialectAppends to a buffer a single-quoted SQL string.For example, in the default dialect,
quoteStringLiteral(buf, "Can't")appends "'Can''t'" tobuf.- Specified by:
quoteStringLiteralin interfaceDialect- Overrides:
quoteStringLiteralin classJdbcDialectImpl- Parameters:
buf- Buffer to append tos- Literal
-
getType
Description copied from interface:DialectChooses 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:
getTypein interfaceDialect- Overrides:
getTypein classJdbcDialectImpl- Parameters:
metaData- Results set metadatacolumnIndex- Column ordinal (0-based)- Returns:
- the most appropriate SqlStatement.Type for the column
- Throws:
SQLException
-
compareVersions
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.
-