AWS Redshift - 无法将外部 table 合并到本地目录

AWS Redshift - Failed to incorporate external table into local catalog

在 redshift 中我们的外部 table 之一有问题。

我们在 AWS Glue 中有超过 300 个 table 已作为名为 events 的外部架构添加到我们的 redshift 集群中。 events 中的大多数 table 都可以很好地查询。但是当查询其中一个名为 item_loaded 的 table 时,我们得到以下错误;

select * from events.item_loaded limit 1;
ERROR:  XX000: Failed to incorporate external table "events"."item_loaded" into local catalog.
LOCATION:  localize_external_table, /home/ec2-user/padb/src/external_catalog/external_catalog_api.cpp:358

奇怪的是它们在目录中;

select *
from SVV_EXTERNAL_TABLES
where tablename = 'item_loaded';

-[ RECORD 1 ]-----+------------------------------------------
schemaname        | events
tablename         | item_loaded
location          | s3://my_bucket/item_loaded
input_format      | org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat
output_format     | org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat
serialization_lib | org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe 
serde_parameters  | {"serialization.format":"1"}
compressed        | 0
parameters        | {"EXTERNAL":"TRUE","parquet.compress":"SNAPPY","transient_lastDdlTime":"1504792238"}

AFAICT,此 table 的配置方式与同一模式中的其他 table 完全相同,并且工作正常。我尝试重新创建一个指向同一个 AWS Glue 数据库的新外部架构,但出现了同样的问题。

我还可以检查什么?是否有任何可能导致 table 从目录中删除的情况?

As per the forum post about the same:

外部 table 有许多列超过了 Redshift 限制:

  • 对于本地 Redshift table
  • ,每个 table 1,600 列
  • Redshift Spectrum 外部 1,598 列 table

可以通过查询svv_external_columns

来验证外部table的列数

我最近遇到了这个问题,

除了上面的方案,还有几个线程

  1. https://forums.aws.amazon.com/message.jspa?messageID=845538&tstart=0(Joe 的解决方案)
  2. https://forums.aws.amazon.com/thread.jspa?messageID=780552(表示包含修复程序)
  3. 我遇到了具有 AWS Glue 完全访问权限的 IAM 角色的问题。我也特意添加了 AthenaFullAccess 并重新启动了解决问题的 Redshift 集群。不确定是什么原因导致了这个问题以及在这种情况下是如何解决的

如果配置中有拼写错误,也会发生这种情况。 对于 ex 以下失败:

SECRET_ARN ' arn:aws:secretsmanager:us-east-1:123:secret:stage/data/redshift-rds'

及后续作品

SECRET_ARN 'arn:aws:secretsmanager:us-east-1:123:secret:stage/data/redshift-rds'

注意 arn

开头的附加 space