类 OceanBaseMysqlDialect
- java.lang.Object
-
- org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.oceanbase.OceanBaseMysqlDialect
-
- 所有已实现的接口:
Serializable,JdbcDialect
public class OceanBaseMysqlDialect extends Object implements JdbcDialect
- 另请参阅:
- 序列化表格
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.JdbcDialect
JdbcDialect.AlterType
-
-
字段概要
字段 修饰符和类型 字段 说明 StringfieldIde-
从接口继承的字段 org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.JdbcDialect
log
-
-
构造器概要
构造器 构造器 说明 OceanBaseMysqlDialect()OceanBaseMysqlDialect(String fieldIde)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 LongapproximateRowCntStatement(Connection connection, JdbcSourceTable table)Approximate total number of entries in the lookup table.PreparedStatementcreatPreparedStatement(Connection connection, String queryTemplate, int fetchSize)Different dialects optimize their PreparedStatementStringdecorateWithComment(String basicSql, org.apache.seatunnel.api.table.converter.BasicTypeDefine typeBasicTypeDefine)decorate with commentMap<String,String>defaultParameter()StringdialectName()Get the name of jdbc dialect.StringextractTableName(org.apache.seatunnel.api.table.catalog.TablePath tablePath)JdbcDialectTypeMappergetJdbcDialectTypeMapper()get jdbc meta-information type to seatunnel data type mapper.JdbcRowConvertergetRowConverter()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'sDUPLICATE KEY UPDATE, or PostgreSQL'sON CONFLICT... DO UPDATE SET...booleanisSpecialDefaultValue(Object defaultValue)whether is special default value e.g. current_timestampbooleanneedsQuotesWithDefaultValue(String sqlType)whether quotes with default valueorg.apache.seatunnel.api.table.catalog.TablePathparse(String tablePath)StringquoteDatabaseIdentifier(String identifier)Quotes the identifier for database name or field nameStringquoteIdentifier(String identifier)Quotes the identifier for table name or field namevoidrefreshTableSchemaBySchemaChangeEvent(String sourceDialectName, org.apache.seatunnel.api.table.event.AlterTableColumnEvent event, JdbcConnectionProvider refreshTableSchemaConnectionProvider, org.apache.seatunnel.api.table.catalog.TablePath sinkTablePath)Refresh physical table schema by schema change eventObject[]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.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.JdbcDialect
buildAlterTableBasicSql, buildAlterTableSql, connectionUrlParse, convertType, decorateWithColumnNameAndType, decorateWithDefaultValue, decorateWithNullable, generateAlterTableSql, getDeleteStatement, getFieldIde, getInsertIntoStatement, getJdbcConnectionProvider, getResultSetMetaData, getRowExistsStatement, getUpdateStatement, hashModForField, hashModForField, queryNextChunkMax, quotesDefaultValue, tableIdentifier, tableIdentifier
-
-
-
-
字段详细资料
-
fieldIde
public String fieldIde
-
-
构造器详细资料
-
OceanBaseMysqlDialect
public OceanBaseMysqlDialect()
-
OceanBaseMysqlDialect
public OceanBaseMysqlDialect(String fieldIde)
-
-
方法详细资料
-
dialectName
public String dialectName()
从接口复制的说明:JdbcDialectGet the name of jdbc dialect.- 指定者:
dialectName在接口中JdbcDialect- 返回:
- the dialect name.
-
getRowConverter
public JdbcRowConverter getRowConverter()
从接口复制的说明:JdbcDialectGet converter that convert jdbc object to seatunnel internal object.- 指定者:
getRowConverter在接口中JdbcDialect- 返回:
- a row converter for the database
-
getJdbcDialectTypeMapper
public JdbcDialectTypeMapper getJdbcDialectTypeMapper()
从接口复制的说明:JdbcDialectget jdbc meta-information type to seatunnel data type mapper.- 指定者:
getJdbcDialectTypeMapper在接口中JdbcDialect- 返回:
- a type mapper for the database
-
quoteIdentifier
public String quoteIdentifier(String identifier)
从接口复制的说明:JdbcDialectQuotes the identifier for table name or field name- 指定者:
quoteIdentifier在接口中JdbcDialect
-
quoteDatabaseIdentifier
public String quoteDatabaseIdentifier(String identifier)
从接口复制的说明:JdbcDialectQuotes the identifier for database name or field name- 指定者:
quoteDatabaseIdentifier在接口中JdbcDialect
-
getUpsertStatement
public Optional<String> getUpsertStatement(String database, String tableName, String[] fieldNames, String[] uniqueKeyFields)
从接口复制的说明:JdbcDialectConstructs the dialects upsert statement if supported; such as MySQL'sDUPLICATE KEY UPDATE, or PostgreSQL'sON 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 thefieldNamesparameter.If the dialect does not support native upsert statements, the writer will fallback to
SELECT ROW Exists+UPDATE/INSERTwhich may have poor performance.- 指定者:
getUpsertStatement在接口中JdbcDialect- 返回:
- the dialects
UPSERTstatement orOptional.empty().
-
creatPreparedStatement
public PreparedStatement creatPreparedStatement(Connection connection, String queryTemplate, int fetchSize) throws SQLException
从接口复制的说明:JdbcDialectDifferent dialects optimize their PreparedStatement- 指定者:
creatPreparedStatement在接口中JdbcDialect- 返回:
- The logic about optimize PreparedStatement
- 抛出:
SQLException
-
extractTableName
public String extractTableName(org.apache.seatunnel.api.table.catalog.TablePath tablePath)
- 指定者:
extractTableName在接口中JdbcDialect
-
defaultParameter
public Map<String,String> defaultParameter()
- 指定者:
defaultParameter在接口中JdbcDialect
-
parse
public org.apache.seatunnel.api.table.catalog.TablePath parse(String tablePath)
- 指定者:
parse在接口中JdbcDialect
-
sampleDataFromColumn
public Object[] sampleDataFromColumn(Connection connection, JdbcSourceTable table, String columnName, int samplingRate, int fetchSize) throws Exception
从接口复制的说明:JdbcDialectPerforms a sampling operation on the specified column of a table in a JDBC-connected database.- 指定者:
sampleDataFromColumn在接口中JdbcDialect- 参数:
connection- 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.- 返回:
- Returns a List of sampled data from the specified column.
- 抛出:
SQLException- If an SQL error occurs during the sampling operation.Exception
-
approximateRowCntStatement
public Long approximateRowCntStatement(Connection connection, JdbcSourceTable table) throws SQLException
从接口复制的说明:JdbcDialectApproximate total number of entries in the lookup table.- 指定者:
approximateRowCntStatement在接口中JdbcDialect- 参数:
connection- The JDBC connection object used to connect to the database.table- table info.- 返回:
- approximate row count statement.
- 抛出:
SQLException
-
refreshTableSchemaBySchemaChangeEvent
public void refreshTableSchemaBySchemaChangeEvent(String sourceDialectName, org.apache.seatunnel.api.table.event.AlterTableColumnEvent event, JdbcConnectionProvider refreshTableSchemaConnectionProvider, org.apache.seatunnel.api.table.catalog.TablePath sinkTablePath)
从接口复制的说明:JdbcDialectRefresh physical table schema by schema change event- 指定者:
refreshTableSchemaBySchemaChangeEvent在接口中JdbcDialect- 参数:
sourceDialectName- source dialect nameevent- schema change eventrefreshTableSchemaConnectionProvider- jdbc connection providersinkTablePath- sink table path
-
decorateWithComment
public String decorateWithComment(String basicSql, org.apache.seatunnel.api.table.converter.BasicTypeDefine typeBasicTypeDefine)
从接口复制的说明:JdbcDialectdecorate with comment- 指定者:
decorateWithComment在接口中JdbcDialect- 参数:
basicSql- alter table sql for sink tabletypeBasicTypeDefine- type basic type define of new column- 返回:
- alter table sql with comment for sink table
-
needsQuotesWithDefaultValue
public boolean needsQuotesWithDefaultValue(String sqlType)
从接口复制的说明:JdbcDialectwhether quotes with default value- 指定者:
needsQuotesWithDefaultValue在接口中JdbcDialect- 参数:
sqlType- sql type of column- 返回:
- whether needs quotes with the type
-
isSpecialDefaultValue
public boolean isSpecialDefaultValue(Object defaultValue)
从接口复制的说明:JdbcDialectwhether is special default value e.g. current_timestamp- 指定者:
isSpecialDefaultValue在接口中JdbcDialect- 参数:
defaultValue- default value of column- 返回:
- whether is special default value e.g current_timestamp
-
-