红移,创建一个带有生成系列的表的错误
我正在尝试将生成的日期系列保存在Redshit上的临时表中:
drop table if exists date_list;
create temporary table date_list as
with seq as(
select date '2020-02-27' + i as dt
from generate_series(1, (date '2020-12-01' - date '2020-02-27')) i
)
select * from seq;
但是收到以下错误:
[Code: 500310, SQL State: 0A000] [Amazon](500310) Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.;
我没有导致该错误的哪个部分,因为该语法应该正确。
I'm trying to save a generated date series in a temporary table on redshit:
drop table if exists date_list;
create temporary table date_list as
with seq as(
select date '2020-02-27' + i as dt
from generate_series(1, (date '2020-12-01' - date '2020-02-27')) i
)
select * from seq;
But received the following error:
[Code: 500310, SQL State: 0A000] [Amazon](500310) Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.;
I do not what part of the code caused this error since the syntax should be right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,generate_series()是一个仅领导者节点函数,其结果不能在计算节点上使用。这样做的方法是使用递归CTE。请参阅:
试图在Redshift
Yes, generate_series() is a leader-node-only function and its results cannot be used on the compute nodes. The way to do this is with a recursive cte. See:
trying to create a date table in Redshift