Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

1.6 KB
Raw Blame
-- Automatically generated by Gravitino Spark SQL test
-- !query
select 
  c_last_name,c_first_name,substr(s_city,1,30),ss_ticket_number,amt,profit
  from
   (select ss_ticket_number
          ,ss_customer_sk
          ,store.s_city
          ,sum(ss_coupon_amt) amt
          ,sum(ss_net_profit) profit
    from store_sales,date_dim,store,household_demographics
    where store_sales.ss_sold_date_sk = date_dim.d_date_sk
    and store_sales.ss_store_sk = store.s_store_sk  
    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
    and (household_demographics.hd_dep_count = 8 or household_demographics.hd_vehicle_count > 0)
    and date_dim.d_dow = 1
    and date_dim.d_year in (1998,1998+1,1998+2) 
    and store.s_number_employees between 200 and 295
    group by ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city) ms,customer
    where ss_customer_sk = c_customer_sk
 order by c_last_name,c_first_name,substr(s_city,1,30), profit
limit 100
-- !query schema
struct<c_last_name:string,c_first_name:string,substr(s_city, 1, 30):string,ss_ticket_number:bigint,amt:decimal(17,2),profit:decimal(17,2)>
-- !query output
Breeden	April	Fairview	1574	8.71	-3718.25
Buck	John	Fairview	1278	202.31	-15447.44
Calderon	Betty	Midway	219	978.83	-289.14
Dupuis	Ami	Midway	1409	4883.49	-3635.08
Fortier	Susanna	Midway	979	5324.88	-20299.73
Levy	Jacqueline	Fairview	204	0.00	-12695.11
Murray	Kathy	Midway	519	0.00	-270.57
Murray	Kathy	Midway	519	469.26	-10880.20
Parks	Luz	Fairview	1598	1871.22	-91.45
Rice	Clifton	Midway	740	132.83	-7579.82
Stevens	Gudrun	Midway	2375	0.00	-4221.55
Weber	Eileen	Fairview	1821	3499.56	-8047.97