【发布时间】:2021-02-19 15:14:29
【问题描述】:
经过几天的搜索,我还没有看到答案 - 所以这里是
我有一个带有 foo 表的 Athena 数据库。将它添加到 Redshift 我使用这个命令:
create external schema athena_schema from data catalog
database 'my-catalog-db'
iam_role '...role/my_redshift_role';
我的表 foo 有 45 个字段,其中一个是存储为字符串的时间戳。我想通过字符串的日期部分对表中的数据进行分区。
字符串看起来像“2021/02/09 20:10:09:001”,我们称之为 mydate
所以我试过这个:
alter table athena_schema.foo
partition(left(mydate, 10) = '2021/02/09')
location 's3://my s3 location/foo_2021_02_09/';
而且 Redshift 不喜欢现有字段上的子字符串命令。我试过了。 有任何想法吗? 感谢您的宝贵时间。
【问题讨论】:
标签: amazon-redshift partitioning external-tables