Class JdbcChunkUtils


  • public class JdbcChunkUtils
    extends Object
    Utilities to split chunks of table.
    • Constructor Detail

      • JdbcChunkUtils

        public JdbcChunkUtils()
    • 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 string SELECT 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 string SELECT 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.