Run aws Athena query by Lambda: error name 'response' is not defined

I create an AWS lambda function with python 3.9 to run the Athena query and get the query result import time import boto3 # create Athena client client = boto3.client(‘athena’) # create Athena query varuable query = ‘select * from mydatabase.mytable limit 8’ DATABASE = ‘mydatabase’ output=’s3://mybucket/’ def lambda_handler(event, context): # Execution response = client.start_query_execution(… Read More Run aws Athena query by Lambda: error name 'response' is not defined

How do you escape underscores and single quotes in Amazon Athena queries?

I would like to run a query like the following on Amazon Athena Select * from my_table where my_table.my_field like ‘%’sample_text’%’ I want to match the single quotes and the underscore in ‘sample_text’. I’ve tried variations of escape characters like \_, \\_, [_], `_, and `_` without success. Is this possible? >Solution : To escape… Read More How do you escape underscores and single quotes in Amazon Athena queries?