Class JdbcChunkUtils
- java.lang.Object
-
- org.apache.flink.cdc.connectors.base.source.utils.JdbcChunkUtils
-
public class JdbcChunkUtils extends Object
Utilities to split chunks of table.
-
-
Constructor Summary
Constructors Constructor Description JdbcChunkUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.debezium.relational.ColumngetSplitColumn(io.debezium.relational.Table table, String chunkKeyColumn)Get the column which is seen as chunk key.static ObjectqueryMin(io.debezium.jdbc.JdbcConnection jdbc, String quotedTableName, String quotedColumnName, Object excludedLowerBound)Query the minimum value of the column in the table, and the minimum value must greater than the excludedLowerBound value.static Object[]queryMinMax(io.debezium.jdbc.JdbcConnection jdbc, String quotedTableName, String quotedColumnName)Query the maximum and minimum value of the column in the table.
-
-
-
Method Detail
-
queryMinMax
public static Object[] queryMinMax(io.debezium.jdbc.JdbcConnection jdbc, String quotedTableName, String quotedColumnName) throws SQLException
Query the maximum and minimum value of the column in the table. e.g. query stringSELECT MIN(%s) FROM %s WHERE %s > ?- Parameters:
jdbc- JDBC connection.quotedTableName- table identity.quotedColumnName- column name.- Returns:
- maximum and minimum value.
- Throws:
SQLException
-
queryMin
public static Object queryMin(io.debezium.jdbc.JdbcConnection jdbc, String quotedTableName, String quotedColumnName, Object excludedLowerBound) throws SQLException
Query the minimum value of the column in the table, and the minimum value must greater than the excludedLowerBound value. e.g. prepare query stringSELECT MIN(%s) FROM %s WHERE %s > ?- Parameters:
jdbc- JDBC connection.quotedTableName- table identity.quotedColumnName- column name.excludedLowerBound- the minimum value should be greater than this value.- Returns:
- minimum value.
- Throws:
SQLException
-
getSplitColumn
public static io.debezium.relational.Column getSplitColumn(io.debezium.relational.Table table, @Nullable String chunkKeyColumn)Get the column which is seen as chunk key.- Parameters:
table- table identity.chunkKeyColumn- column name which is seen as chunk key, if chunkKeyColumn is null, use primary key instead. @Column the column which is seen as chunk key.
-
-