Class Db2As400MetadataHandler

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

    public class Db2As400MetadataHandler
    extends JdbcMetadataHandler
    • Constructor Detail

      • Db2As400MetadataHandler

        public Db2As400MetadataHandler​(Map<String,​String> configOptions)
        Instantiates handler to be used by Lambda function directly.

        Recommend using Db2As400MuxCompositeHandler instead.

      • Db2As400MetadataHandler

        public Db2As400MetadataHandler​(DatabaseConnectionConfig databaseConnectionConfig,
                                       Map<String,​String> configOptions)
        TO be used by Mux.
        Parameters:
        databaseConnectionConfig -
      • Db2As400MetadataHandler

        protected Db2As400MetadataHandler​(DatabaseConnectionConfig databaseConnectionConfig,
                                          software.amazon.awssdk.services.secretsmanager.SecretsManagerClient secretsManager,
                                          software.amazon.awssdk.services.athena.AthenaClient athena,
                                          JdbcConnectionFactory jdbcConnectionFactory,
                                          Map<String,​String> configOptions)
    • Method Detail

      • doGetDataSourceCapabilities

        public GetDataSourceCapabilitiesResponse doGetDataSourceCapabilities​(BlockAllocator allocator,
                                                                             GetDataSourceCapabilitiesRequest request)
        Description copied from class: MetadataHandler
        Used to describe the types of capabilities supported by a data source. An engine can use this to determine what portions of the query to push down. A connector that returns any optimization will guarantee that the associated predicate will be pushed down.
        Overrides:
        doGetDataSourceCapabilities in class MetadataHandler
        Parameters:
        allocator - Tool for creating and managing Apache Arrow Blocks.
        request - Provides details about the catalog being used.
        Returns:
        A GetDataSourceCapabilitiesResponse object which returns a map of supported optimizations that the connector is advertising to the consumer. The connector assumes all responsibility for whatever is passed here.
      • 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: