kaa*_*man 5 c# amazon-s3 amazon-web-services s3-bucket amazon-athena
我正在尝试使用 C# athena 驱动程序执行 athena 查询。
Amazon.Athena.Model.ResultConfiguration resultConfig = new Amazon.Athena.Model.ResultConfiguration();
resultConfig.OutputLocation = "https://s3.us-east-2.amazonaws.com/testbucket/one/2018-02-06/";
//other inputs i have tried
//"s3://testbucket/one/2018-02-06/"
//testbucket
//Populate the request object
Amazon.Athena.Model.StartQueryExecutionRequest queryExec = new Amazon.Athena.Model.StartQueryExecutionRequest();
queryExec.QueryString = query.QueryString;
queryExec.QueryExecutionContext = queryExecutionContext;
queryExec.ResultConfiguration = resultConfig;
StartQueryExecutionResponse athenaResponse = athenaClient.StartQueryExecution(queryExec);//throws exception
Run Code Online (Sandbox Code Playgroud)
不同情况的例外:
outputLocation 不是有效的 S3 路径。提供https://s3.us-east-2.amazonaws.com/testbucket/one/2018-02-06/
无法验证/创建输出存储桶 testbucket。提供 s3://testbucket/one/2018-02-06/
无法验证/创建输出存储桶 testbucket。提供测试桶
有人可以帮我找到正确的 s3 格式吗?
提前致谢。
输出位置需要采用以下格式:
s3://{bucketname}/{path}
Run Code Online (Sandbox Code Playgroud)
在您的情况下,这将导致以下位置:
resultConfig.OutputLocation = "s3://testbucket/one/2018-02-06/";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12970 次 |
| 最近记录: |