athena-express icon indicating copy to clipboard operation
athena-express copied to clipboard

Enhancements in Testing and Functionality

Open bkcompton opened this issue 4 years ago • 1 comments

  • Enhanced Tests (almost full coverage)

  • Fixed Issue: CTAS Queries Don't Work

  • Conformed to strict Sonar and es-lint rules

  • Added ability to configure timeouts for both retry and common error scenarios

  • Added ability to set the Athena workgroup in configuration (Allows workgroup level security)

  • Increased the version numbers on test tools and updated package.json to have debug script that can be used in .vscode's launch.json.

bkcompton avatar Jul 13 '19 17:07 bkcompton

The last commit allows for the caller to pass in the optional aws params object to the AthenaExpress constructor which is then used in the AWS and Athena constructors for additional configurability.

This was required by my AWS Lambda which was creating more then the default open file descriptor setting in the Lambda environment. This is overridable via the following setting in https.Agent constructor... (I set it to 5000 below).

The resolved error message found in CloudFormation:

  NetworkingError: getaddrinfo EMFILE bucket_name.s3.amazonaws.com:443
    const awsOptions = { 
       httpOptions: { 
         agent: new https.Agent({ 
           maxSockets: 5000 
         }) 
       } 
    };  

Usage:

    const athenaExpressConfig = { 
        awsOptions,  
        aws: awsSdk,  
        db: dbName.toLowerCase(),  
        region,  
        workGroup: athenaWorkgroup,  
        s3: s3SQLLogOutputPath . 
    };
    const athenaExpress = new AthenaExpress(athenaExpressConfig);  

I hope this helps others.

bkcompton avatar Jul 23 '19 18:07 bkcompton