ghdna / athena-express

Athena-Express can simplify executing SQL queries in Amazon Athena AND fetching cleaned-up JSON results in the same synchronous or asynchronous request - well suited for web applications.
https://www.npmjs.com/package/athena-express
MIT License
181 stars 70 forks source link

'SHOW TABLES' query is timing out #27

Closed GuidoS closed 4 years ago

GuidoS commented 4 years ago

Hello,

I am running into timing out issues with my queries, even the "SHOW TABLE" query is timing out and I know that one should always run within ~30ms.

Here is the function I am using:

'use strict'
const AWS = require('aws-sdk')
const AthenaExpress = require('athena-express')

const getData = async (event) => {
    if (!event.query) {
        event.query = 'SHOW TABLES'
    }

    const athenaExpressConfig = {
        aws: AWS
    }

    const athenaExpress = new AthenaExpress(athenaExpressConfig)
    event.data = await athenaExpress.query({
        sql: event.query
    })

    return event
}

Any suggestions on how I can get this to work would be appreciated.

ghdna commented 4 years ago

Show Tables shouldnt take long unless you have other issues related to network,. Can you check on Athena console how long these queries are taking?

GuidoS commented 4 years ago

Turns out this issue was one related to vpc settings that I added and I didn't realize that this was going to cause an issue.