Skip to content
Advertisement

Concatenate variable in Athena SQL query from Python Lambda function

I have a Python Lambda function that creates a SQL table in Athena. How do I properly concatenate variables in my query? When I set the LOCATION value, I receive the error response below. The function runs successfully if I hard code the LOCATION value.

Error response:

Lambda function:

Thank you.

Advertisement

Answer

Have you tried to use Python’s format method? Something like this

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement