|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmondrian.spi.impl.JdbcDialectImpl
mondrian.spi.impl.TeradataDialect
public class TeradataDialect
Implementation of Dialect
for the Teradata database.
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 | |
---|---|
TeradataDialect(Connection connection)
Creates a TeradataDialect. |
Method Summary | |
---|---|
String |
generateInline(List<String> columnNames,
List<String> columnTypes,
List<String[]> valueList)
Generates a SQL statement to represent an inline dataset. |
String |
generateOrderItem(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. |
Dialect.NullCollation |
getNullCollation()
Returns the rule which determines whether NULL values appear first or last when sorted using ORDER BY. |
boolean |
requiresAliasForFromQuery()
Returns whether this Dialect requires subqueries in the FROM clause to have an alias. |
boolean |
requiresUnionOrderByOrdinal()
Returns true if this dialect allows only integers in the ORDER BY clause of a UNION (or other set operation) query. |
boolean |
supportsGroupingSets()
Returns whether this Dialect allows the GROUPING SETS construct in the GROUP BY clause. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final JdbcDialectFactory FACTORY
Constructor Detail |
---|
public TeradataDialect(Connection connection) throws SQLException
connection
- Connection
SQLException
Method Detail |
---|
public boolean requiresAliasForFromQuery()
Dialect
requiresAliasForFromQuery
in interface Dialect
requiresAliasForFromQuery
in class JdbcDialectImpl
Dialect.allowsFromQuery()
public String generateInline(List<String> columnNames, List<String> columnTypes, List<String[]> valueList)
Dialect
For example, for Oracle, generates
SELECT 1 AS FOO, 'a' AS BAR FROM dual UNION ALL SELECT 2 AS FOO, 'b' AS BAR FROM dual
For ANSI SQL, generates:
VALUES (1, 'a'), (2, 'b')
generateInline
in interface Dialect
generateInline
in class JdbcDialectImpl
columnNames
- List of column namescolumnTypes
- List of column types ("String" or "Numeric")valueList
- List of rows values
public boolean supportsGroupingSets()
Dialect
supportsGroupingSets
in interface Dialect
supportsGroupingSets
in class JdbcDialectImpl
public Dialect.NullCollation getNullCollation()
Dialect
According to the SQL standard, this is implementation-specific.
The default behavior is
Dialect.NullCollation.POSINF
.
getNullCollation
in interface Dialect
getNullCollation
in class JdbcDialectImpl
public String generateOrderItem(String expr, boolean nullable, boolean ascending)
Dialect
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".
generateOrderItem
in interface Dialect
generateOrderItem
in class JdbcDialectImpl
expr
- Expressionnullable
- Whether expression may have NULL valuesascending
- Whether to sort expression ascending
public boolean requiresUnionOrderByOrdinal()
Dialect
For example,
SELECT x, y + z FROM t
is allowed but
UNION ALL
SELECT x, y + z FROM t
ORDER BY 1, 2SELECT x, y, z FROM t
is not.
UNION ALL
SELECT x, y, z FROM t
ORDER BY x
Teradata is an example of a dialect with this restriction.
requiresUnionOrderByOrdinal
in interface Dialect
requiresUnionOrderByOrdinal
in class JdbcDialectImpl
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |