Giter VIP home page Giter VIP logo

Comments (1)

wjxiz1992 avatar wjxiz1992 commented on June 25, 2024

The UPDATE data contains some unnecessary data, we should drop them. See details in Specification(v3.2.0) pdf at Page 7 of 141

remove tables that are no longer part of the data maintenance refresh in TPC-DS v2.0 A-1 
(s_zip_to_cmt) A-3 (s_customer) A-7 (s_item) A-10 (s_store) A-11 (s_call_center) A-12 
(s_web_site) A-13 (s_warehouse) A-14 (s_web_page) A-15 (s_promotion) A-20 (s_catalog_page) 
(FogBugz 2178)

The Specification doc doesn't explicitly provide the DELETE query strings, I come up with the following SQLs.
See Section 5.3.11

-- DF_CS
-- for catalog_sales 
delete from catalog_sales where cs_sold_date_sk in (select d_date_sk from date_dim where d_date between DATE1 and DATE2);
-- for catalog_returns 
delete from catalog_returns where cr_order_number in (
select cs_order_number from catalog_sales where cs_sold_date_sk in (select d_date_sk from date_dim where d_date between DATE1 and DATE2)
);

-- DF_SS
-- for store_sales 
delete from store_sales 
where ss_sold_date_sk in 
(select d_date_sk from date_dim where d_date between DATE1 and DATE2);
-- for store_sales 
delete from store_returns where sr_ticket_number in (
select ss_ticket_number from store_sales where ss_sold_date_sk in (select d_date_sk from date_dim where d_date between DATE1 and DATE2)
);

-- DF_WS
-- for web_sales 
delete from web_sales where ws_sold_date_sk in (select d_date_sk from date_dim where d_date between DATE1 and DATE2);
-- for web_returns 
delete from web_returns where wr_order_number in (
select ws_order_number from web_sales where ws_sold_date_sk in (select d_date_sk from date_dim where d_date between DATE1 and DATE2)
);

-- DF_I
-- for inventory
delete from inventory where inv_date_sk in (select d_date_sk from date_dim where d_date between DATE1 and DATE2);

from spark-rapids-benchmarks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.