public class MysqlDialect extends Object implements JdbcDialect
| 限定符和类型 | 字段和说明 |
|---|---|
String |
fieldIde |
log| 构造器和说明 |
|---|
MysqlDialect() |
MysqlDialect(String fieldIde) |
| 限定符和类型 | 方法和说明 |
|---|---|
Long |
approximateRowCntStatement(Connection connection,
JdbcSourceTable table)
Approximate total number of entries in the lookup table.
|
PreparedStatement |
creatPreparedStatement(Connection connection,
String queryTemplate,
int fetchSize)
Different dialects optimize their PreparedStatement
|
Map<String,String> |
defaultParameter() |
String |
dialectName()
Get the name of jdbc dialect.
|
String |
extractTableName(TablePath tablePath) |
JdbcDialectTypeMapper |
getJdbcDialectTypeMapper()
get jdbc meta-information type to seatunnel data type mapper.
|
JdbcRowConverter |
getRowConverter()
Get converter that convert jdbc object to seatunnel internal object.
|
Optional<String> |
getUpsertStatement(String database,
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... |
TablePath |
parse(String tablePath) |
String |
quoteDatabaseIdentifier(String identifier)
Quotes the identifier for database name or field name
|
String |
quoteIdentifier(String identifier)
Quotes the identifier for table name or field name
|
Object[] |
sampleDataFromColumn(Connection connection,
JdbcSourceTable table,
String columnName,
int samplingRate,
int fetchSize)
Performs a sampling operation on the specified column of a table in a JDBC-connected
database.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectionUrlParse, getDeleteStatement, getFieldIde, getInsertIntoStatement, getJdbcConnectionProvider, getResultSetMetaData, getRowExistsStatement, getUpdateStatement, hashModForField, queryNextChunkMax, tableIdentifier, tableIdentifierpublic String fieldIde
public MysqlDialect()
public MysqlDialect(String fieldIde)
public String dialectName()
JdbcDialectdialectName 在接口中 JdbcDialectpublic JdbcRowConverter getRowConverter()
JdbcDialectgetRowConverter 在接口中 JdbcDialectpublic JdbcDialectTypeMapper getJdbcDialectTypeMapper()
JdbcDialectgetJdbcDialectTypeMapper 在接口中 JdbcDialectpublic String quoteIdentifier(String identifier)
JdbcDialectquoteIdentifier 在接口中 JdbcDialectpublic String quoteDatabaseIdentifier(String identifier)
JdbcDialectquoteDatabaseIdentifier 在接口中 JdbcDialectpublic Optional<String> getUpsertStatement(String database, String tableName, String[] fieldNames, String[] uniqueKeyFields)
JdbcDialectDUPLICATE 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 ROW Exists + UPDATE/INSERT which may have poor performance.
getUpsertStatement 在接口中 JdbcDialectUPSERT statement or Optional.empty().public PreparedStatement creatPreparedStatement(Connection connection, String queryTemplate, int fetchSize) throws SQLException
JdbcDialectcreatPreparedStatement 在接口中 JdbcDialectSQLExceptionpublic String extractTableName(TablePath tablePath)
extractTableName 在接口中 JdbcDialectpublic Map<String,String> defaultParameter()
defaultParameter 在接口中 JdbcDialectpublic TablePath parse(String tablePath)
parse 在接口中 JdbcDialectpublic Object[] sampleDataFromColumn(Connection connection, JdbcSourceTable table, String columnName, int samplingRate, int fetchSize) throws SQLException
JdbcDialectsampleDataFromColumn 在接口中 JdbcDialectconnection - The JDBC connection object used to connect to the database.table - The table in which the column resides.columnName - The name of the column to be sampled.samplingRate - samplingRate The inverse of the fraction of the data to be sampled from
the column. For example, a value of 1000 would mean 1/1000 of the data will be sampled.SQLException - If an SQL error occurs during the sampling operation.public Long approximateRowCntStatement(Connection connection, JdbcSourceTable table) throws SQLException
JdbcDialectapproximateRowCntStatement 在接口中 JdbcDialectconnection - The JDBC connection object used to connect to the database.table - table info.SQLExceptionCopyright © 2024 The Apache Software Foundation. All rights reserved.