Class TeradataDialect

  • All Implemented Interfaces:
    Dialect

    public class TeradataDialect
    extends JdbcDialectImpl
    Implementation of Dialect for the Teradata database.
    Since:
    Nov 23, 2008
    Author:
    jhyde
    • Constructor Detail

      • TeradataDialect

        public TeradataDialect​(Connection connection)
                        throws SQLException
        Creates a TeradataDialect.
        Parameters:
        connection - Connection
        Throws:
        SQLException
    • Method Detail

      • generateInline

        public String generateInline​(List<String> columnNames,
                                     List<String> columnTypes,
                                     List<String[]> valueList)
        Description copied from interface: Dialect
        Generates a SQL statement to represent an inline dataset.

        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')
         
        Specified by:
        generateInline in interface Dialect
        Overrides:
        generateInline in class JdbcDialectImpl
        Parameters:
        columnNames - List of column names
        columnTypes - List of column types ("String" or "Numeric")
        valueList - List of rows values
        Returns:
        SQL string
      • supportsGroupingSets

        public boolean supportsGroupingSets()
        Description copied from interface: Dialect
        Returns whether this Dialect allows the GROUPING SETS construct in the GROUP BY clause. Currently Greenplum, IBM DB2, Oracle, and Teradata.
        Specified by:
        supportsGroupingSets in interface Dialect
        Overrides:
        supportsGroupingSets in class JdbcDialectImpl
        Returns:
        Whether this Dialect allows GROUPING SETS clause
      • requiresUnionOrderByOrdinal

        public boolean requiresUnionOrderByOrdinal()
        Description copied from interface: Dialect
        Returns true if this dialect allows only integers in the ORDER BY clause of a UNION (or other set operation) query.

        For example, SELECT x, y + z FROM t
        UNION ALL
        SELECT x, y + z FROM t
        ORDER BY 1, 2
        is allowed but SELECT x, y, z FROM t
        UNION ALL
        SELECT x, y, z FROM t
        ORDER BY x
        is not.

        Teradata is an example of a dialect with this restriction.

        Specified by:
        requiresUnionOrderByOrdinal in interface Dialect
        Overrides:
        requiresUnionOrderByOrdinal in class JdbcDialectImpl
        Returns:
        whether this dialect allows only integers in the ORDER BY clause of a UNION (or other set operation) query