红移,创建一个带有生成系列的表的错误

发布于 2025-02-10 00:11:31 字数 497 浏览 1 评论 0原文

我正在尝试将生成的日期系列保存在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酷炫老祖宗 2025-02-17 00:11:31

是的,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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文