@Internal public class MySqlDialect extends AbstractDialect
AbstractDialect.Range
Constructor and Description |
---|
MySqlDialect() |
Modifier and Type | Method and Description |
---|---|
String |
appendDefaultUrlProperties(String url)
Appends default JDBC properties to url for current dialect.
|
Optional<AbstractDialect.Range> |
decimalPrecisionRange() |
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)
Mysql upsert query use DUPLICATE KEY UPDATE.
|
String |
quoteIdentifier(String identifier)
Quotes the identifier.
|
Set<LogicalTypeRoot> |
supportedTypes()
Defines the set of supported types for the dialect.
|
Optional<AbstractDialect.Range> |
timestampPrecisionRange() |
getDeleteStatement, getInsertIntoStatement, getRowExistsStatement, getSelectFromStatement, getUpdateStatement, validate
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 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)
NOTE: It requires Mysql's primary key to be consistent with pkFields.
We don't use REPLACE INTO, if there are other fields, we can keep their previous values.
public String dialectName()
JdbcDialect
public Optional<AbstractDialect.Range> decimalPrecisionRange()
decimalPrecisionRange
in class AbstractDialect
DecimalType
columns. None if decimal type is not supported.public Optional<AbstractDialect.Range> timestampPrecisionRange()
timestampPrecisionRange
in class AbstractDialect
TimestampType
columns. None if timestamp type is not supported.public Set<LogicalTypeRoot> supportedTypes()
AbstractDialect
DECIMAL
or TIMESTAMP
types, be sure to override AbstractDialect.decimalPrecisionRange()
and AbstractDialect.timestampPrecisionRange()
respectively.supportedTypes
in class AbstractDialect
public String appendDefaultUrlProperties(String url)
JdbcDialect
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.