Class BigQueryRecordHandler

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

    public class BigQueryRecordHandler
    extends RecordHandler
    This record handler is an example of how you can implement a lambda that calls bigquery and pulls data. This Lambda requires that your BigQuery table is small enough so that a table scan can be completed within 5-10 mins or this lambda will time out and it will fail.
    • Constructor Detail

      • BigQueryRecordHandler

        public BigQueryRecordHandler​(com.amazonaws.services.s3.AmazonS3 amazonS3,
                                     com.amazonaws.services.secretsmanager.AWSSecretsManager secretsManager,
                                     com.amazonaws.services.athena.AmazonAthena athena,
                                     Map<String,​String> configOptions,
                                     org.apache.arrow.memory.BufferAllocator allocator)
    • Method Detail

      • readWithConstraint

        public void readWithConstraint​(BlockSpiller spiller,
                                       ReadRecordsRequest recordsRequest,
                                       QueryStatusChecker queryStatusChecker)
                                throws Exception
        Description copied from class: RecordHandler
        A more stream lined option for reading the row data associated with the provided Split. This method differs from doReadRecords(...) in that the SDK handles more of the request lifecycle, leaving you to focus more closely on the task of actually reading from your source.
        Specified by:
        readWithConstraint in class RecordHandler
        Parameters:
        spiller - A BlockSpiller that should be used to write the row data associated with this Split. The BlockSpiller automatically handles chunking the response, encrypting, and spilling to S3.
        recordsRequest - Details of the read request, including: 1. The Split 2. The Catalog, Database, and Table the read request is for. 3. The filtering predicate (if any) 4. The columns required for projection.
        queryStatusChecker - A QueryStatusChecker that you can use to stop doing work for a query that has already terminated
        Throws:
        Exception