Class VerticaDialect

  • All Implemented Interfaces:
    Dialect

    public class VerticaDialect
    extends JdbcDialectImpl
    Implementation of Dialect for the Vertica database.
    Since:
    Sept 11, 2009
    Author:
    Pedro Alves
    • Constructor Detail

      • VerticaDialect

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

      • 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
        is OK, but
        select couunt(distinct x), count(distinct y) from t
        gives "Multiple DISTINCT aggregates are not supported at this time."
        Specified by:
        allowsMultipleCountDistinct in interface Dialect
        Overrides:
        allowsMultipleCountDistinct in class JdbcDialectImpl
        Returns:
        whether this Dialect supports more than one distinct aggregation in the same query
      • 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 interface Dialect
        Overrides:
        allowsCountDistinctWithOtherAggs in class JdbcDialectImpl
        Returns:
        whether this Dialect supports more than one distinct aggregation in the same query
      • supportsResultSetConcurrency

        public boolean supportsResultSetConcurrency​(int type,
                                                    int concurrency)
        Description copied from interface: Dialect
        Returns whether this Dialect supports the given concurrency type in combination with the given result set type.

        The result is similar to DatabaseMetaData.supportsResultSetConcurrency(int, int), except that the JdbcOdbc bridge in JDK 1.6 overstates its abilities. See bug 1690406.

        Specified by:
        supportsResultSetConcurrency in interface Dialect
        Overrides:
        supportsResultSetConcurrency in class JdbcDialectImpl
        Parameters:
        type - defined in ResultSet
        concurrency - type defined in ResultSet
        Returns:
        true if so; false otherwise
      • generateInline

        public java.lang.String generateInline​(java.util.List<java.lang.String> columnNames,
                                               java.util.List<java.lang.String> columnTypes,
                                               java.util.List<java.lang.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
      • getType

        public SqlStatement.Type getType​(java.sql.ResultSetMetaData metaData,
                                         int columnIndex)
                                  throws java.sql.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 interface Dialect
        Overrides:
        getType in class JdbcDialectImpl
        Parameters:
        metaData - Results set metadata
        columnIndex - Column ordinal (0-based)
        Returns:
        the most appropriate SqlStatement.Type for the column
        Throws:
        java.sql.SQLException
      • supportsMultiValueInExpr

        public boolean supportsMultiValueInExpr()
        Description copied from interface: Dialect
        Returns true if this dialect supports multi-value IN expressions. E.g., WHERE (col1, col2) IN ((val1a, val2a), (val1b, val2b))
        Specified by:
        supportsMultiValueInExpr in interface Dialect
        Overrides:
        supportsMultiValueInExpr in class JdbcDialectImpl
        Returns:
        true if the dialect supports multi-value IN expressions