Check if this dialect instance can handle a certain jdbc url.
Check if this dialect instance can handle a certain jdbc url.
the jdbc url.
True if the dialect can be applied on the given jdbc url.
if the url is null.
Override connection specific properties to run before a select is made.
Override connection specific properties to run before a select is made. This is in place to allow dialects that need special treatment to optimize behavior.
The connection object
The connection properties. This is passed through from the relation.
Get the custom datatype mapping for the given jdbc meta information.
Get the custom datatype mapping for the given jdbc meta information.
The sql type (see java.sql.Types)
The sql type name (e.g. "BIGINT UNSIGNED")
The size of the type.
Result metadata associated with this type.
The actual DataType (subclasses of org.apache.spark.sql.types.DataType) or null if the default type mapping should be used.
Retrieve the jdbc / sql type for a given datatype.
Retrieve the jdbc / sql type for a given datatype.
The datatype (e.g. org.apache.spark.sql.types.StringType)
The new JdbcType if there is an override for this DataType
Get the SQL query that should be used to find if the given table exists.
Get the SQL query that should be used to find if the given table exists. Dialects can override this method to return a query that works best in a particular database.
The name of the table.
The SQL query to use for checking the table.
Quotes the identifier.
Quotes the identifier. This is used to put quotes around the identifier in case the column name is a reserved keyword, or in case it contains characters that require quotes (e.g. space).
:: DeveloperApi :: Encapsulates everything (extensions, workarounds, quirks) to handle the SQL dialect of a certain database or jdbc driver. Lots of databases define types that aren't explicitly supported by the JDBC spec. Some JDBC drivers also report inaccurate information---for instance, BIT(n>1) being reported as a BIT type is quite common, even though BIT in JDBC is meant for single-bit values. Also, there does not appear to be a standard name for an unbounded string or binary type; we use BLOB and CLOB by default but override with database-specific alternatives when these are absent or do not behave correctly.
Currently, the only thing done by the dialect is type mapping.
getCatalystType
is used when reading from a JDBC table andgetJDBCType
is used when writing to a JDBC table. IfgetCatalystType
returnsnull
, the default type handling is used for the given JDBC type. Similarly, ifgetJDBCType
returns(null, None)
, the default type handling is used for the given Catalyst type.