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.
NullPointerException
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.
Converts value to SQL expression.
Converts value to SQL expression.
The value to be converted.
Converted value.
Escape special characters in SQL string literals.
Escape special characters in SQL string literals.
The string to be escaped.
Escaped string.
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
The SQL query that should be used to discover the schema of a table.
The SQL query that should be used to discover the schema of a table. It only needs to ensure that the result set has the same schema as the table, such as by calling "SELECT * ...". 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 discovering the schema.
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.
The SQL query that should be used to truncate a table.
The SQL query that should be used to truncate a table. Dialects can override this method to return a query that is suitable for a particular database. For PostgreSQL, for instance, a different query is used to prevent "TRUNCATE" affecting other tables.
The name of the table.
The SQL query to use for truncating a table
Return Some[true] iff TRUNCATE TABLE
causes cascading default.
Return Some[true] iff TRUNCATE TABLE
causes cascading default.
Some[true] : TRUNCATE TABLE causes cascading.
Some[false] : TRUNCATE TABLE does not cause cascading.
None: The behavior of TRUNCATE TABLE is unknown (default).
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.