Class Db2ChunkSplitter

    • Method Detail

      • fromDbzColumn

        protected org.apache.flink.table.types.DataType fromDbzColumn​(io.debezium.relational.Column splitColumn)
        Description copied from class: JdbcSourceChunkSplitter
        Get a corresponding Flink data type from a debezium Column.
        Specified by:
        fromDbzColumn in class JdbcSourceChunkSplitter
        Parameters:
        splitColumn - dbz split column.
        Returns:
        flink data type
      • queryNextChunkMax

        protected Object queryNextChunkMax​(io.debezium.jdbc.JdbcConnection jdbc,
                                           io.debezium.relational.TableId tableId,
                                           io.debezium.relational.Column column,
                                           int chunkSize,
                                           Object includedLowerBound)
                                    throws SQLException
        Description copied from class: JdbcSourceChunkSplitter
        Query the maximum value of the next chunk, and the next chunk must be greater than or equal to includedLowerBound value [min_1, max_1), [min_2, max_2),... [min_n, null). Each time this method is called it will return max1, max2...

        Each database has different grammar to get limit number of data, for example, `limit N` in mysql or postgres, `top(N)` in sqlserver , `FETCH FIRST %S ROWS ONLY` in DB2.

        Specified by:
        queryNextChunkMax in class JdbcSourceChunkSplitter
        Parameters:
        jdbc - JDBC connection.
        tableId - table identity.
        column - column.
        chunkSize - chunk size.
        includedLowerBound - the previous chunk end value.
        Returns:
        next chunk end value.
        Throws:
        SQLException
      • queryApproximateRowCnt

        protected Long queryApproximateRowCnt​(io.debezium.jdbc.JdbcConnection jdbc,
                                              io.debezium.relational.TableId tableId)
                                       throws SQLException
        Description copied from class: JdbcSourceChunkSplitter
        Approximate total number of entries in the lookup table.

        Each database has different system table to lookup up approximate total number. For example, `pg_class` in postgres, `sys.dm_db_partition_stats` in sqlserver, `SYSCAT.TABLE` in db2.

        Specified by:
        queryApproximateRowCnt in class JdbcSourceChunkSplitter
        Parameters:
        jdbc - JDBC connection.
        tableId - table identity.
        Returns:
        approximate row count.
        Throws:
        SQLException