org.apache.spark.sql.jdbc
Class AggregatedDialect

Object
  extended by org.apache.spark.sql.jdbc.JdbcDialect
      extended by org.apache.spark.sql.jdbc.AggregatedDialect

public class AggregatedDialect
extends JdbcDialect

:: DeveloperApi :: AggregatedDialect can unify multiple dialects into one virtual Dialect. Dialects are tried in order, and the first dialect that does not return a neutral element will will. param: dialects List of dialects.


Constructor Summary
AggregatedDialect(scala.collection.immutable.List<JdbcDialect> dialects)
           
 
Method Summary
 boolean canHandle(String url)
          Check if this dialect instance can handle a certain jdbc url.
 scala.Option<DataType> getCatalystType(int sqlType, String typeName, int size, MetadataBuilder md)
          Get the custom datatype mapping for the given jdbc meta information.
 scala.Option<JdbcType> getJDBCType(DataType dt)
          Retrieve the jdbc / sql type for a given datatype.
 
Methods inherited from class org.apache.spark.sql.jdbc.JdbcDialect
quoteIdentifier
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregatedDialect

public AggregatedDialect(scala.collection.immutable.List<JdbcDialect> dialects)
Method Detail

canHandle

public boolean canHandle(String url)
Description copied from class: JdbcDialect
Check if this dialect instance can handle a certain jdbc url.

Specified by:
canHandle in class JdbcDialect
Parameters:
url - the jdbc url.
Returns:
True if the dialect can be applied on the given jdbc url.

getCatalystType

public scala.Option<DataType> getCatalystType(int sqlType,
                                              String typeName,
                                              int size,
                                              MetadataBuilder md)
Description copied from class: JdbcDialect
Get the custom datatype mapping for the given jdbc meta information.

Overrides:
getCatalystType in class JdbcDialect
Parameters:
sqlType - The sql type (see java.sql.Types)
typeName - The sql type name (e.g. "BIGINT UNSIGNED")
size - The size of the type.
md - Result metadata associated with this type.
Returns:
The actual DataType (subclasses of DataType) or null if the default type mapping should be used.

getJDBCType

public scala.Option<JdbcType> getJDBCType(DataType dt)
Description copied from class: JdbcDialect
Retrieve the jdbc / sql type for a given datatype.

Overrides:
getJDBCType in class JdbcDialect
Parameters:
dt - The datatype (e.g. StringType)
Returns:
The new JdbcType if there is an override for this DataType