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 ofDialectfor 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 JdbcDialectFactoryFACTORY-
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 booleanallowsCompoundCountDistinct()Returns whether this Dialect allows multiple arguments to theCOUNT(DISTINCT ...) aggregate function, for exampleSELECT COUNT(DISTINCT x, y) FROM tbooleanallowsCountDistinct()Returns whether this Dialect supports distinct aggregations.booleanallowsCountDistinctWithOtherAggs()Returns whether this Dialect supports distinct aggregations with other aggregations in the same query.booleanallowsMultipleCountDistinct()Returns whether this Dialect supports more than one distinct aggregation in the same query.booleanallowsMultipleDistinctSqlMeasures()Returns 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.SqlStatement.TypegetType(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.booleanrequiresAliasForFromQuery()Returns whether this Dialect requires subqueries in the FROM clause to have an alias.booleansupportsGroupByExpressions()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: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:
Dialect.allowsFromQuery()
-
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:
Dialect.allowsCountDistinct(),Dialect.allowsMultipleCountDistinct()
-
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
public void quoteStringLiteral(StringBuilder buf, String s)
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
public SqlStatement.Type getType(ResultSetMetaData metaData, int columnIndex) throws SQLException
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
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.
-
-