Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"UnexpectedParameter: Unexpected key 'Catalog' found in params.QueryExecutionContext" #82

Open
aaaferns opened this issue Apr 29, 2022 · 4 comments

Comments

@aaaferns
Copy link

I am getting this error message when I submit a query.
"UnexpectedParameter: Unexpected key 'Catalog' found in params.QueryExecutionContext"
Followed the instructions as per ReadMe.
I am not suppling this parameter at all. this is my config.
const athenaExpressConfig = {
aws: AWS,
s3: s3://${process.env.ENV_ATHENA_S3BUCKET},
};
Query
{
"query": "select datapointid, journeyid, capturedtimestamp, location from vehicle_movements_daily LIMIT 100",
"db": "vm_db"
}
First I thought that it was a configuration or IAM role issue and therefore I tried using athenaClient and I was able to get results without issue( only timeout issue which is expected).

@AreebWaseem
Copy link

I am experiencing the same issue on v7.1

@ghdna
Copy link
Owner

ghdna commented Jun 3, 2022

can you provide more steps for me to replicate this issue?

@AreebWaseem
Copy link

I have written an aws lambda node js script:

`
const AthenaExpress = require("athena-express"),
aws = require("aws-sdk");

const athenaExpressConfig = {
aws,
db: "db",
getStats: true
};

const athenaExpress = new AthenaExpress(athenaExpressConfig);

exports.handler = async (event, context, callback) => {
const sqlQuery = 'SELECT * FROM "tags"';

try {
	let results = await athenaExpress.query(sqlQuery);
	callback(null, results);
} catch (error) {
	callback(error, null);
}

};
`

@AreebWaseem
Copy link

Seems like removing Catalog from this function removes the issue:

  const params = {
    QueryString: config.sql,
    WorkGroup: config.workgroup,
    ResultConfiguration: {
      OutputLocation: config.s3Bucket,
    },
    QueryExecutionContext: {
      Database: config.db,
      Catalog: config.catalog,
    },
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants