Interface JdbcReadWithPartitionsHelper<PartitionT>

  • Type Parameters:
    PartitionT - Element type of the column used for partition.
    All Superinterfaces:
    JdbcIO.PreparedStatementSetter<org.apache.beam.sdk.values.KV<PartitionT,​PartitionT>>, JdbcIO.RowMapper<org.apache.beam.sdk.values.KV<java.lang.Long,​org.apache.beam.sdk.values.KV<PartitionT,​PartitionT>>>, java.io.Serializable

    public interface JdbcReadWithPartitionsHelper<PartitionT>
    extends JdbcIO.PreparedStatementSetter<org.apache.beam.sdk.values.KV<PartitionT,​PartitionT>>, JdbcIO.RowMapper<org.apache.beam.sdk.values.KV<java.lang.Long,​org.apache.beam.sdk.values.KV<PartitionT,​PartitionT>>>
    A helper for JdbcIO.ReadWithPartitions that handles range calculations.
    • Method Detail

      • calculateRanges

        java.lang.Iterable<org.apache.beam.sdk.values.KV<PartitionT,​PartitionT>> calculateRanges​(PartitionT lowerBound,
                                                                                                       PartitionT upperBound,
                                                                                                       java.lang.Long partitions)
        Calculate the range of each partition from the lower and upper bound, and number of partitions.

        Return a list of pairs for each lower and upper bound within each partition.

      • mapRow

        org.apache.beam.sdk.values.KV<java.lang.Long,​org.apache.beam.sdk.values.KV<PartitionT,​PartitionT>> mapRow​(java.sql.ResultSet resultSet)
                                                                                                                       throws java.lang.Exception
        Specified by:
        mapRow in interface JdbcIO.RowMapper<PartitionT>
        Throws:
        java.lang.Exception