@Internal public class SqlServerDialect extends AbstractDialect
AbstractDialect.Range
Constructor and Description |
---|
SqlServerDialect() |
Modifier and Type | Method and Description |
---|---|
Optional<AbstractDialect.Range> |
decimalPrecisionRange()
The maximum precision is supported by decimal.
|
Optional<String> |
defaultDriverName() |
String |
dialectName()
Get the name of jdbc dialect.
|
String |
getLimitClause(long limit)
Get limit clause to limit the number of emitted row from the jdbc source.
|
JdbcRowConverter |
getRowConverter(RowType rowType)
Get converter that convert jdbc object and Flink internal object each other.
|
Optional<String> |
getUpsertStatement(String tableName,
String[] fieldNames,
String[] uniqueKeyFields)
Constructs the dialects upsert statement if supported; such as MySQL's
DUPLICATE KEY
UPDATE , or PostgreSQL's {@code ON CONFLICT... |
String |
quoteIdentifier(String identifier)
Quotes the identifier.
|
Set<LogicalTypeRoot> |
supportedTypes()
Defines the set of supported types for the dialect.
|
Optional<AbstractDialect.Range> |
timestampPrecisionRange()
The maximum precision is supported by datetime2.
|
getDeleteStatement, getInsertIntoStatement, getRowExistsStatement, getSelectFromStatement, getUpdateStatement, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendDefaultUrlProperties
public String dialectName()
JdbcDialect
public Optional<AbstractDialect.Range> timestampPrecisionRange()
timestampPrecisionRange
in class AbstractDialect
TimestampType
columns. None if timestamp type is not supported.public Optional<AbstractDialect.Range> decimalPrecisionRange()
decimalPrecisionRange
in class AbstractDialect
DecimalType
columns. None if decimal type is not supported.public Optional<String> defaultDriverName()
public String quoteIdentifier(String identifier)
JdbcDialect
Used to put quotes around the identifier if the column name is a reserved keyword or contains characters requiring quotes (e.g., space).
public Optional<String> getUpsertStatement(String tableName, String[] fieldNames, String[] uniqueKeyFields)
JdbcDialect
DUPLICATE KEY
UPDATE
, or PostgreSQL's ON CONFLICT... DO UPDATE SET..
. If supported, the returned
string will be used as a PreparedStatement
. Fields in the statement must be
in the same order as the fieldNames
parameter.
If the dialect does not support native upsert statements, the writer will fallback to
SELECT
+ UPDATE
/INSERT
which may have poor performance.
public JdbcRowConverter getRowConverter(RowType rowType)
JdbcDialect
rowType
- the given row typepublic String getLimitClause(long limit)
JdbcDialect
limit
- number of row to emit. The value of the parameter should be non-negative.public Set<LogicalTypeRoot> supportedTypes()
AbstractDialect
DECIMAL
or TIMESTAMP
types, be sure to override AbstractDialect.decimalPrecisionRange()
and AbstractDialect.timestampPrecisionRange()
respectively.supportedTypes
in class AbstractDialect
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.