【发布时间】:2019-03-28 17:38:46
【问题描述】:
我正在尝试使用 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 输出位置是虚构的。那么有什么方法可以避免这种情况并仅在响应中获得结果呢?
【问题讨论】:
标签: amazon-web-services boto3 amazon-athena