在macOS上在Excel中通过ODBC 访问Athena出现错误

0

【以下的问题经过翻译处理】 我有一个客户试图使用ODBC连接到Athena。他们按照“Configuring ODBC Connections on a NonWindows Machine”的文档进行设置:https://s3.amazonaws.com/athena-downloads/drivers/ODBC/SimbaAthenaODBC_1.0.5/Simba+Athena+ODBC+Install+and+Configuration+Guide.pdf

当AuthenticationType = IAM credentials时,在macOS上测试通过。

尝试按照此处建议的AuthenticationType = IAM Profile设置,遇到问题https://www.simba.com/products/Athena/doc/ODBC_InstallGuide/mac/content/odbc/ath/configuring/authenticating/iamprofile.htm

我按照客户设置进行了问题的重现。在使用AuthenticationType = IAM Profile时,遇到如下错误:

08S01
[Simba] [DriverIAMSupport] (8600) Connection Error: No AWS profile found: default

有人遇到过这个错误吗?请帮忙,谢谢。

profile picture
专家
已提问 5 个月前10 查看次数
1 回答
0

【以下的回答经过翻译处理】 这种情况,往往发生在当ODBC中设置的关键字AwsProfile对应的配置在.aws/credentials中缺失的时候。在您的测试环境中,您可能已经设置了AwsProfile=default,或者完全没有指定该配置文件,就会在凭证文件中查找名为default的配置。

您应该根据CLI文档在此处中的说明在.aws/credentials文件中配置凭证。

然后设置与以下内容相似的odbc.ini

[ODBC Data Sources]
Athena=Simba Athena ODBC Driver
[Athena]
Driver=/Library/simba/athenaodbc/lib/libathenaodbc_sbu.dylib
AwsRegion=us-west-2
S3OutputLocation=s3://query-results-bucket/testfolder-1
AuthenticationType=IAM Profile
AwsProfile=someprofilename

更新

尽管上述信息是正确的,但在这种特殊情况下,问题出现在Excel和MacOS [Application Sandboxes]中(https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html)。微软的Excel因受到限制,无法读取路径~/.aws/credentials来检索配置文件凭证。一种解决方法是在Excel沙箱目录sandbox directory内创建.aws目录,然后将凭证文件硬链接到~/.aws/credentials。这样就能解决问题并仍然使用原始凭证文件。

mkdir  ~/Library/Containers/com.microsoft.Excel/Data/.aws
ln ~/.aws/credentials  ~/Library/Containers/com.microsoft.Excel/Data/.aws/

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则