使用with as 查询报错
 
通知
清除全部

使用with as 查询报错


greenbeam
帖子: 1
Topic starter
初出茅庐
已加入: 3周 前

Greenplum 6.13.0/6.14.1/6.15.0都进行过测试。

查询代码如下:

with ssr as
(select s_store_id,
sum(sales_price) as sales,
sum(profit) as profit,
sum(return_amt) as returns,
sum(net_loss) as profit_loss
from
( select ss_store_sk as store_sk,
ss_sold_date_sk as date_sk,
ss_ext_sales_price as sales_price,
ss_net_profit as profit,
cast(0 as decimal(7,2)) as return_amt,
cast(0 as decimal(7,2)) as net_loss
from store_sales
union all
select sr_store_sk as store_sk,
sr_returned_date_sk as date_sk,
cast(0 as decimal(7,2)) as sales_price,
cast(0 as decimal(7,2)) as profit,
sr_return_amt as return_amt,
sr_net_loss as net_loss
from store_returns
) salesreturns,
date_dim,
store
where date_sk = d_date_sk
and d_date between cast('1999-08-08' as date)
and (cast('1999-08-08' as date) + '14 days'::interval)
and store_sk = s_store_sk
group by s_store_id)

select channel
, id
, sum(sales) as sales
, sum(returns) as returns
, sum(profit) as profit
from
(select 'store channel' as channel
, 'store' || s_store_id as id
, sales
, returns
, (profit - profit_loss) as profit
from ssr
) x
group by rollup (channel, id)
order by channel
,id
;

 

错误信息如下:

psql:/pivotalguru/TPC-DS/05_sql/105.tpcds.05.sql:127: WARNING: interconnect may encountered a network error, please check your network (seg2 slice3 192.168.251.203:6000 pid=3789)
DETAIL: Failed to send packet (seq 1) to 127.0.0.1:17916 (pid 11128 cid -1) after 100 retries.

是由于什么原因导致的呢?

问题标签
SQL

关注微信公众号

Greenplum中文社区

Greenplum官方微信群

扫码加入我们的技术讨论,请备注“网站”