Class Db2MetadataHandler

  • All Implemented Interfaces:
    com.amazonaws.services.lambda.runtime.RequestStreamHandler

    public class Db2MetadataHandler
    extends JdbcMetadataHandler
    • Method Detail

      • getPartitionSchema

        public org.apache.arrow.vector.types.pojo.Schema getPartitionSchema​(String catalogName)
        Creates Schema object with arrow compatible filed to frame the partition.
        Specified by:
        getPartitionSchema in class JdbcMetadataHandler
        Parameters:
        catalogName - Athena provided catalog name.
        Returns:
      • getPartitions

        public void getPartitions​(BlockWriter blockWriter,
                                  GetTableLayoutRequest getTableLayoutRequest,
                                  QueryStatusChecker queryStatusChecker)
                           throws Exception
        A partition is represented by a partition column(s) of type varchar. In case of Db2 connector, partitions are created using below organization schemes. - Distribute by Hash - Partition by range - Organize by dimensions The partition details such as no. of partitions, column name are fetched from the Db2 metadata table(s). A custom query is then used to get the partition. Based upon the number of distinct partitions received, the splits are being created.
        Specified by:
        getPartitions in class JdbcMetadataHandler
        Parameters:
        blockWriter -
        getTableLayoutRequest -
        queryStatusChecker -
        Throws:
        Exception
      • doGetSplits

        public GetSplitsResponse doGetSplits​(BlockAllocator blockAllocator,
                                             GetSplitsRequest getSplitsRequest)
        Split(s) will be created based on table partition. We are taking ContinuationToken from GetSplitsRequest object and loop upto row count of the partitions, and inside loop we are creating Split objects. In each Split object we are adding properties to be used in partition framing.
        Specified by:
        doGetSplits in class JdbcMetadataHandler
        Parameters:
        blockAllocator -
        getSplitsRequest -
        Returns: