@PublicEvolving public abstract class AbstractDialect extends Object implements JdbcDialect
JdbcDialects that implements basic data type validation and
the construction of basic INSERT, UPDATE, DELETE, and SELECT
statements.
Implementors should be careful to check the default SQL statements are performant for their specific dialect and override them if necessary.
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractDialect.Range
A range from [min,max] where min <= max.
|
| Constructor and Description |
|---|
AbstractDialect() |
| Modifier and Type | Method and Description |
|---|---|
Optional<AbstractDialect.Range> |
decimalPrecisionRange() |
String |
getDeleteStatement(String tableName,
String[] conditionFields)
A simple single row
DELETE statement. |
String |
getInsertIntoStatement(String tableName,
String[] fieldNames)
A simple
INSERT INTO statement. |
String |
getRowExistsStatement(String tableName,
String[] conditionFields)
A simple
SELECT statement that checks for the existence of a single row. |
String |
getSelectFromStatement(String tableName,
String[] selectFields,
String[] conditionFields)
A simple
SELECT statement. |
String |
getUpdateStatement(String tableName,
String[] fieldNames,
String[] conditionFields)
A simple single row
UPDATE statement. |
abstract Set<org.apache.flink.table.types.logical.LogicalTypeRoot> |
supportedTypes()
Defines the set of supported types for the dialect.
|
Optional<AbstractDialect.Range> |
timestampPrecisionRange() |
void |
validate(org.apache.flink.table.types.logical.RowType rowType)
Check if this dialect instance support a specific data type in table schema.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendDefaultUrlProperties, defaultDriverName, dialectName, getLimitClause, getRowConverter, getUpsertStatement, quoteIdentifierpublic void validate(org.apache.flink.table.types.logical.RowType rowType)
throws org.apache.flink.table.api.ValidationException
JdbcDialectvalidate in interface JdbcDialectrowType - the physical table datatype of a row in the database table.org.apache.flink.table.api.ValidationException - in case of the table schema contains unsupported type.public String getInsertIntoStatement(String tableName, String[] fieldNames)
INSERT INTO statement.
INSERT INTO table_name (column_name [, ...])
VALUES (value [, ...])
getInsertIntoStatement in interface JdbcDialectINSERT INTO statement.public String getUpdateStatement(String tableName, String[] fieldNames, String[] conditionFields)
UPDATE statement.
UPDATE table_name
SET col = val [, ...]
WHERE cond [AND ...]
getUpdateStatement in interface JdbcDialectpublic String getDeleteStatement(String tableName, String[] conditionFields)
DELETE statement.
DELETE FROM table_name
WHERE cond [AND ...]
getDeleteStatement in interface JdbcDialectpublic String getSelectFromStatement(String tableName, String[] selectFields, String[] conditionFields)
SELECT statement.
SELECT expression [, ...]
FROM table_name
WHERE cond [AND ...]
getSelectFromStatement in interface JdbcDialectpublic String getRowExistsStatement(String tableName, String[] conditionFields)
SELECT statement that checks for the existence of a single row.
SELECT 1
FROM table_name
WHERE cond [AND ...]
getRowExistsStatement in interface JdbcDialectpublic Optional<AbstractDialect.Range> timestampPrecisionRange()
TimestampType
columns. None if timestamp type is not supported.public Optional<AbstractDialect.Range> decimalPrecisionRange()
DecimalType
columns. None if decimal type is not supported.public abstract Set<org.apache.flink.table.types.logical.LogicalTypeRoot> supportedTypes()
DECIMAL
or TIMESTAMP types, be sure to override decimalPrecisionRange() and timestampPrecisionRange() respectively.Copyright © 2022–2024 The Apache Software Foundation. All rights reserved.