我正在尝试使用boto3运行一组查询,但不希望将数据保存到s3。相反,我只想获取结果并处理这些结果。我正在尝试执行以下操作
import boto3
client = boto3.client('athena')
response = client.start_query_execution(
QueryString='''SELECT * FROM mytable limit 10''',
QueryExecutionContext={
'Database': 'my_db'
}.
ResultConfiguration={
'OutputLocation': 's3://outputpath',
}
)
print(response)
但是在这里我不想提供ResultConfiguration
,因为我不想将结果写入任何地方。但如果我删除ResultConfiguration
参数,则会收到以下错误:
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in input: "ResultConfiguration"
看起来需要提供s3输出位置才能进行写入。那么有什么方法可以避免这种情况并仅通过响应获取结果呢?