1+ PRAGMA TablePathPrefix= ' /Root/test/ds' ;
2+
3+ -- NB: Subquerys
4+ $bla1 = (select distinct
5+ COALESCE(c_last_name,' ' ) as c_last_name,
6+ COALESCE(c_first_name,' ' ) as c_first_name,
7+ COALESCE(cast(d_date as date ), cast(0 as Date )) as d_date
8+ from store_sales as store_sales
9+ cross join date_dim as date_dim
10+ cross join customer as customer
11+ where store_sales .ss_sold_date_sk = date_dim .d_date_sk
12+ and store_sales .ss_customer_sk = customer .c_customer_sk
13+ and d_month_seq between 1221 and 1221 + 11 );
14+
15+ $bla2 = ((select distinct
16+ COALESCE(c_last_name,' ' ) as c_last_name,
17+ COALESCE(c_first_name,' ' ) as c_first_name,
18+ COALESCE(cast(d_date as date ), cast(0 as Date )) as d_date
19+ from catalog_sales as catalog_sales
20+ cross join date_dim as date_dim
21+ cross join customer as customer
22+ where catalog_sales .cs_sold_date_sk = date_dim .d_date_sk
23+ and catalog_sales .cs_bill_customer_sk = customer .c_customer_sk
24+ and d_month_seq between 1221 and 1221 + 11 )
25+ union all
26+ (select distinct
27+ COALESCE(c_last_name,' ' ) as c_last_name,
28+ COALESCE(c_first_name,' ' ) as c_first_name,
29+ COALESCE(cast(d_date as date ), cast(0 as Date )) as d_date
30+ from web_sales as web_sales
31+ cross join date_dim as date_dim
32+ cross join customer as customer
33+ where web_sales .ws_sold_date_sk = date_dim .d_date_sk
34+ and web_sales .ws_bill_customer_sk = customer .c_customer_sk
35+ and d_month_seq between 1221 and 1221 + 11 ));
36+
37+ -- start query 1 in stream 0 using template query87.tpl and seed 1819994127
38+ select count (* )
39+ from $bla1 bla1 left only join $bla2 bla2 using (c_last_name, c_first_name, d_date)
40+ ;
41+
42+ -- end query 1 in stream 0 using template query87.tpl
0 commit comments