public abstract class DriverQuirks
extends Object
Currently, the only thing DriverQuirks does is handle type mapping.
getCatalystType
is used when reading from a JDBC table and getJDBCType
is used when writing to a JDBC table. If getCatalystType
returns null
,
the default type handling is used for the given JDBC type. Similarly,
if getJDBCType
returns (null, None)
, the default type handling is used
for the given Catalyst type.
Constructor and Description |
---|
DriverQuirks() |
Modifier and Type | Method and Description |
---|---|
static DriverQuirks |
get(String url)
Fetch the DriverQuirks class corresponding to a given database url.
|
abstract org.apache.spark.sql.types.DataType |
getCatalystType(int sqlType,
String typeName,
int size,
org.apache.spark.sql.types.MetadataBuilder md) |
abstract scala.Tuple2<String,scala.Option<Object>> |
getJDBCType(org.apache.spark.sql.types.DataType dt) |
public static DriverQuirks get(String url)
public abstract org.apache.spark.sql.types.DataType getCatalystType(int sqlType, String typeName, int size, org.apache.spark.sql.types.MetadataBuilder md)
public abstract scala.Tuple2<String,scala.Option<Object>> getJDBCType(org.apache.spark.sql.types.DataType dt)