Skip to content

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

2.5 KB
Raw Blame
-- Automatically generated by Gravitino Spark SQL test
-- !query
select  i_item_id
      ,i_item_desc 
      ,i_category 
      ,i_class 
      ,i_current_price
      ,sum(ws_ext_sales_price) as itemrevenue 
      ,sum(ws_ext_sales_price)*100/sum(sum(ws_ext_sales_price)) over
          (partition by i_class) as revenueratio
from	
	web_sales
    	,item 
    	,date_dim
where 
	ws_item_sk = i_item_sk 
  	and i_category in ('Jewelry', 'Sports', 'Books')
  	and ws_sold_date_sk = d_date_sk
	and d_date between cast('2001-01-12' as date) 
				and (cast('2001-01-12' as date) + interval 30 days)
group by 
	i_item_id
        ,i_item_desc 
        ,i_category
        ,i_class
        ,i_current_price
order by 
	i_category
        ,i_class
        ,i_item_id
        ,i_item_desc
        ,revenueratio
limit 100
-- !query schema
struct<i_item_id:string,i_item_desc:string,i_category:string,i_class:string,i_current_price:string,itemrevenue:decimal(17,2),revenueratio:decimal(38,17)>
-- !query output
AAAAAAAAAPBDAAAA	Financial, common films must save typically good, bea	Books	home repair	4.93	43.36	2.39272470422037789
AAAAAAAAAPDCAAAA	Little lights will not kill silent assumptions. Artists must go. Great, simple mi	Books	self-help	4.79	2082.33	100.00000000000000000
AAAAAAAAGCCAAAAA	Possible, responsible parents	Sports	sailing	7.91	7340.00	100.00000000000000000
AAAAAAAAGEIBAAAA	Kids should not spare originally british newspapers. Jobs co	Sports	optics	7.58	1885.50	100.00000000000000000
AAAAAAAAHGMAAAAA	Variables arrange hostile democrats. Original habits know as certain horses. Firm, technical pupils must see also never other	Books	home repair	9.17	1768.80	97.60727529577962211
AAAAAAAAIFPDAAAA	Principles would not instruct like the consumers. Calls should forget now by a outcomes. Enough burning islands shed highly other, remaining at	Sports	camping	4.71	5815.71	100.00000000000000000
AAAAAAAAIMMAAAAA	Decisions get quickly with a notes. Anywhere private journals can get. Front, secondary hands could see yet national i	Jewelry	costume	0.36	1031.94	100.00000000000000000
AAAAAAAAJOGCAAAA	Pounds would fit very significant weeks. Open, single churches provide. Meetings lose financial members. Things reduce too. Waters place usually determined agents. 	Books	science	4.57	144.21	100.00000000000000000
AAAAAAAAKNIBAAAA	Subjects will read too. Reduced, identical patients like through a animals. At least unable c	Jewelry	rings	4.90	230.88	100.00000000000000000
AAAAAAAALIJDAAAA	New 	Books	mystery	2.35	5944.62	100.00000000000000000