简体   繁体   English

无法创建新的 AWS Athena 数据目录

[英]Cannot create new AWS Athena Data Catalog

I am trying to create new Glue data catalogs in Athena.我正在尝试在 Athena 中创建新的 Glue 数据目录。 It always fails with INVALID_INPUT, no other error context.它总是以 INVALID_INPUT 失败,没有其他错误上下文。

Here is the API that I am using https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Athena/Client.html#create_data_catalog-instance_method .这是我正在使用的 API https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Athena/Client.html#create_data_catalog-instance_method

It always fails with an invalid input when selecting type = GLUE.选择 type = GLUE 时,它总是因输入无效而失败。

require 'aws-sdk-athena'
Aws::Athena::Client.new.create_data_catalog(name: 'testing', type: "GLUE")
Aws::Athena::Errors::InvalidRequestException (INVALID_INPUT)
    from (irb):51:in `rescue in irb_binding'
    from (irb):51

Even using the AWS CLI it fails with the same cryptic error.即使使用 AWS CLI,它也会因相同的神秘错误而失败。

aws athena create-data-catalog --region us-west-1 --name testing --type GLUE                                                                                                                                                                               

An error occurred (InvalidRequestException) when calling the CreateDataCatalog operation: INVALID_INPUT

How do I create a new Glue Data Catalog for Athena?如何为 Athena 创建新的 Glue 数据目录? Or am I limited to the default, AwsDataCatalog ?还是我仅限于默认值AwsDataCatalog

TL; TL; DR: you already have a Glue Data Catalog, you can only have one, and this is a very poor error. DR:你已经有一个 Glue 数据目录,你只能有一个,这是一个非常糟糕的错误。

My guess is that this API is poorly documented and implemented.我的猜测是这个 API 的文档和实现很差。 When Athena was launched it had its own catalog implementation, because Glue didn't exist yet.当 Athena 推出时,它有自己的目录实现,因为 Glue 还不存在。 When Glue was launched you had to opt in to using Glue's catalog if you had started using Athena, while new users got the Glue catalog by default.启动 Glue 时,如果您已经开始使用 Athena,则必须选择使用 Glue 的目录,而新用户默认获得 Glue 目录。 I don't remember if this was the API call you used to migrate to the Glue catalog, but it might have been.我不记得这是否是您用来迁移到 Glue 目录的 API 调用,但可能是。

Either way, there is only one Glue Data Catalog per account, and you already have one, and I suspect the error is really just that you can't create another one.无论哪种方式,每个帐户只有一个 Glue 数据目录,而您已经有了一个,我怀疑错误实际上只是您无法创建另一个。 This is roughly how useful and helpful Athena's error messages used to be back in the day.这大致是 Athena 错误消息过去的有用和帮助程度。 "Something went wrong, you figure it out!" “出事了,你自己想办法!” When they added Federated Query and external Hive catalogs they could have improved this API call, added proper documentation about Glue, and meaningful error messages, but I guess they opted not to.当他们添加联合查询和外部 Hive 目录时,他们本可以改进这个 API 调用,添加有关 Glue 的适当文档和有意义的错误消息,但我猜他们选择不这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM