diff --git a/build.gradle.kts b/build.gradle.kts index 73cbdd80f24..c921db3c92f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -488,11 +488,9 @@ tasks.rat { "dev/docker/kerberos-hive/kadm5.acl", "**/*.log", "**/*.out", - "**/testsets", + "**/trino-ci-testset", "**/licenses/*.txt", "**/licenses/*.md", - "integration-test/**/*.sql", - "integration-test/**/*.txt", "docs/**/*.md", "spark-connector/spark-common/src/test/resources/**", "web/web/.**", diff --git a/integration-test-common/docker-script/shutdown.sh b/integration-test-common/docker-script/shutdown.sh index 19955472879..f2a60d3d9d0 100755 --- a/integration-test-common/docker-script/shutdown.sh +++ b/integration-test-common/docker-script/shutdown.sh @@ -21,7 +21,9 @@ cd "$(dirname "$0")" LOG_DIR=../build/trino-ci-container-log -docker cp trino-ci-hive:/usr/local/hadoop/logs $LOG_DIR/hdfs -docker cp trino-ci-hive:/tmp/root $LOG_DIR/hive +if [ -d $LOG_DIR ]; then + docker cp trino-ci-hive:/usr/local/hadoop/logs $LOG_DIR/hdfs + docker cp trino-ci-hive:/tmp/root $LOG_DIR/hive +fi docker compose down diff --git a/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryIT.java b/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryIT.java index c737e762fab..eda4577efb2 100644 --- a/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryIT.java +++ b/trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryIT.java @@ -70,12 +70,6 @@ public class TrinoQueryIT extends TrinoQueryITBase { static { testsetsDir = TrinoQueryIT.class.getClassLoader().getResource("trino-ci-testset").getPath(); testsetsDir = ITUtils.joinPath(testsetsDir, "testsets"); - - ciTestsets.add("hive"); - ciTestsets.add("lakehouse-iceberg"); - ciTestsets.add("jdbc-mysql"); - ciTestsets.add("jdbc-postgresql"); - ciTestsets.add("tpch"); } @BeforeAll diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00000.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00000.sql new file mode 100644 index 00000000000..18a5ae1dd0b --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00000.sql @@ -0,0 +1,72 @@ +select count(*) from call_center; +select count(*) from catalog_page; +select count(*) from catalog_returns; +select count(*) from catalog_sales; +select count(*) from customer; +select count(*) from customer_address; +select count(*) from customer_demographics; +select count(*) from date_dim; +select count(*) from household_demographics; +select count(*) from income_band; +select count(*) from inventory; +select count(*) from item; +select count(*) from promotion; +select count(*) from reason; +select count(*) from ship_mode; +select count(*) from store; +select count(*) from store_returns; +select count(*) from store_sales; +select count(*) from time_dim; +select count(*) from warehouse; +select count(*) from web_page; +select count(*) from web_returns; +select count(*) from web_sales; +select count(*) from web_site; + +SELECT * FROM call_center ORDER BY cc_call_center_sk, cc_call_center_id, cc_rec_start_date LIMIT 10; + +SELECT * FROM catalog_page ORDER BY cp_catalog_page_sk, cp_catalog_page_id, cp_start_date_sk LIMIT 10; + +SELECT * FROM catalog_returns ORDER BY cr_returned_date_sk, cr_returned_time_sk, cr_item_sk LIMIT 10; + +SELECT * FROM catalog_sales ORDER BY cs_sold_date_sk, cs_sold_time_sk, cs_ship_date_sk LIMIT 10; + +SELECT * FROM customer ORDER BY c_customer_sk, c_customer_id, c_current_cdemo_sk LIMIT 10; + +SELECT * FROM customer_address ORDER BY ca_address_sk, ca_address_id, ca_street_number LIMIT 10; + +SELECT * FROM customer_demographics ORDER BY cd_demo_sk, cd_gender, cd_marital_status LIMIT 10; + +SELECT * FROM date_dim ORDER BY d_date_sk, d_date_id, d_date LIMIT 10; + +SELECT * FROM household_demographics ORDER BY hd_demo_sk, hd_income_band_sk, hd_buy_potential LIMIT 10; + +SELECT * FROM income_band ORDER BY ib_income_band_sk, ib_lower_bound, ib_upper_bound LIMIT 10; + +SELECT * FROM inventory ORDER BY inv_date_sk, inv_item_sk, inv_warehouse_sk LIMIT 10; + +SELECT * FROM item ORDER BY i_item_sk, i_item_id, i_rec_start_date LIMIT 10; + +SELECT * FROM promotion ORDER BY p_promo_sk, p_promo_id, p_start_date_sk LIMIT 10; + +SELECT * FROM reason ORDER BY r_reason_sk, r_reason_id, r_reason_desc LIMIT 10; + +SELECT * FROM ship_mode ORDER BY sm_ship_mode_sk, sm_ship_mode_id, sm_type LIMIT 10; + +SELECT * FROM store ORDER BY s_store_sk, s_store_id, s_rec_start_date LIMIT 10; + +SELECT * FROM store_returns ORDER BY sr_returned_date_sk, sr_return_time_sk, sr_item_sk LIMIT 10; + +SELECT * FROM store_sales ORDER BY ss_sold_date_sk, ss_sold_time_sk, ss_item_sk LIMIT 10; + +SELECT * FROM time_dim ORDER BY t_time_sk, t_time_id, t_time LIMIT 10; + +SELECT * FROM warehouse ORDER BY w_warehouse_sk, w_warehouse_id, w_warehouse_name LIMIT 10; + +SELECT * FROM web_page ORDER BY wp_web_page_sk, wp_web_page_id, wp_rec_start_date LIMIT 10; + +SELECT * FROM web_returns ORDER BY wr_returned_date_sk, wr_returned_time_sk, wr_item_sk LIMIT 10; + +SELECT * FROM web_sales ORDER BY ws_sold_date_sk, ws_sold_time_sk, ws_ship_date_sk LIMIT 10; + +SELECT * FROM web_site ORDER BY web_site_sk, web_site_id, web_rec_start_date LIMIT 10; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00000.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00000.txt new file mode 100644 index 00000000000..45eeb41876f --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00000.txt @@ -0,0 +1,278 @@ +"2" + +"11718" + +"8923" + +"89807" + +"1000" + +"1000" + +"1920800" + +"73049" + +"7200" + +"20" + +"261261" + +"2000" + +"3" + +"1" + +"20" + +"2" + +"11925" + +"120527" + +"86400" + +"1" + +"2" + +"1152" + +"11876" + +"2" + + +"1","AAAAAAAABAAAAAAA","1998-01-01","","","2450952","NY Metro","large","2","1138","8AM-4PM ","Bob Belcher","6","More than other authori ","Shared others could not count fully dollars. New members ca","Julius Tran","3","pri","6","cally ","730 ","Ash Hill","Boulevard ","Suite 0 ","Midway","Williamson County","TN","31904 ","United States","-5.00","0.11" +"2","AAAAAAAACAAAAAAA","1998-01-01","2000-12-31","","2450806","Mid Atlantic","medium","6","2268","8AM-8AM ","Felipe Perkins","2","A bit narrow forms matter animals. Consist ","Largely blank years put substantially deaf, new others. Question","Julius Durham","5","anti","1","ought ","984 ","Center Hill","Way ","Suite 70 ","Midway","Williamson County","TN","31904 ","United States","-5.00","0.12" + + +"1","AAAAAAAABAAAAAAA","2450815","2450996","DEPARTMENT","1","1","In general basic characters welcome. Clearly lively friends conv","bi-annual" +"2","AAAAAAAACAAAAAAA","2450815","2450996","DEPARTMENT","1","2","English areas will leave prisoners. Too public countries ought to become beneath the years. ","bi-annual" +"3","AAAAAAAADAAAAAAA","2450815","2450996","DEPARTMENT","1","3","Times could not address disabled indians. Effectively public ports c","bi-annual" +"4","AAAAAAAAEAAAAAAA","2450815","","","1","","","bi-annual" +"5","AAAAAAAAFAAAAAAA","2450815","2450996","DEPARTMENT","1","5","Classic buildings ensure in a tests. Real years may not receive open systems. Now broad m","bi-annual" +"6","AAAAAAAAGAAAAAAA","2450815","2450996","DEPARTMENT","1","6","Exciting principles wish greatly only excellent women. Appropriate fortunes shall not","bi-annual" +"7","AAAAAAAAHAAAAAAA","2450815","2450996","DEPARTMENT","1","7","National services must not come at least into a girls","bi-annual" +"8","AAAAAAAAIAAAAAAA","2450815","2450996","DEPARTMENT","1","8","Areas see early for a pounds. New goods study too serious women. Unwittingly sorry incentives shall","bi-annual" +"9","AAAAAAAAJAAAAAAA","2450815","2450996","DEPARTMENT","1","9","Intensive, economic changes resist bloody of course simple economies; ","bi-annual" +"10","AAAAAAAAKAAAAAAA","2450815","2450996","DEPARTMENT","1","10","Careful, intense funds balance perhaps boys. Romantic chips remove legs. Direct birds get ","bi-annual" + + +"2450851","76961","1850","24","552511","1551","838","397","1886218","6642","219","2","81","17","1","1","92","3","159.63","7.98","167.61","75.26","32.46","0.00","1.59","158.04","115.70" +"2450858","74844","361","305","527683","6708","486","422","1717248","6779","510","2","27","10","1","1","45","38","1472.50","103.07","1575.57","84.52","17.10","265.05","386.38","821.07","204.69" +"2450863","46270","1735","758","1148029","2853","124","919","1126300","3007","314","1","5","2","1","1","63","54","2701.08","162.06","2863.14","3.08","2132.46","594.23","1896.16","210.69","2297.60" +"2450868","29430","1369","111","1835190","5916","195","957","1480884","1910","936","1","214","14","1","1","103","9","61.11","3.66","64.77","74.43","48.87","8.55","33.63","18.93","126.96" +"2450869","71183","1430","242","541252","6015","978","328","1893150","6361","172","1","21","18","1","1","22","2","64.64","5.17","69.81","66.56","77.08","1.93","52.04","10.67","148.81" +"2450870","64669","370","22","1502404","6833","662","573","1482438","6726","614","2","43","18","1","1","13","18","100.44","5.02","105.46","70.47","196.92","9.03","82.26","9.15","272.41" +"2450883","78294","1588","227","1014475","7170","18","425","759563","33","856","1","66","19","1","1","150","20","702.60","7.02","709.62","36.30","154.40","330.22","264.38","108.00","197.72" +"2450886","38932","406","171","1861135","5946","957","425","540067","7007","194","2","60","1","1","1","174","8","975.44","78.03","1053.47","33.48","426.72","224.35","315.45","435.64","538.23" +"2450886","77970","1258","481","663720","3159","551","438","519045","5508","171","2","21","20","1","1","107","21","1340.22","26.80","1367.02","64.34","1235.01","1018.56","192.99","128.67","1326.15" +"2450887","20595","560","61","1286495","4976","457","250","349487","5628","816","2","103","13","1","1","38","68","9568.28","669.77","10238.05","71.11","2192.32","2105.02","3433.09","4030.17","2933.20" + + +"2450815","10687","2450820","572","437897","6622","147","572","437897","6622","147","2","77","7","1","247","3","3","56","12.62","28.39","20.72","429.52","1160.32","706.72","1589.84","4.87","1079.09","0.00","81.23","86.10","81.23","86.10","-625.49" +"2450815","10687","2450846","572","437897","6622","147","572","437897","6622","147","2","7","2","1","886","2","3","75","8.44","14.43","6.34","606.75","475.50","633.00","1082.25","33.28","0.00","10.50","475.50","508.78","486.00","519.28","-157.50" +"2450815","10687","2450864","572","437897","6622","147","572","437897","6622","147","2","28","5","1","1198","2","3","99","75.88","178.31","156.91","2118.60","15534.09","7512.12","17652.69","1398.06","0.00","6884.46","15534.09","16932.15","22418.55","23816.61","8021.97" +"2450815","10687","2450893","572","437897","6622","147","572","437897","6622","147","2","31","4","1","1826","2","3","33","89.04","217.25","52.14","5448.63","1720.62","2938.32","7169.25","68.82","0.00","3584.46","1720.62","1789.44","5305.08","5373.90","-1217.70" +"2450815","10687","2450900","572","437897","6622","147","572","437897","6622","147","2","67","7","1","1537","3","3","45","45.24","59.26","53.33","266.85","2399.85","2035.80","2666.70","191.98","0.00","479.70","2399.85","2591.83","2879.55","3071.53","364.05" +"2450815","10687","2450904","572","437897","6622","147","572","437897","6622","147","2","52","18","1","1238","1","3","25","72.16","98.13","29.43","1717.50","735.75","1804.00","2453.25","29.43","0.00","834.00","735.75","765.18","1569.75","1599.18","-1068.25" +"2450815","10687","2450905","572","437897","6622","147","572","437897","6622","147","2","47","10","1","1435","3","3","90","34.57","89.53","68.04","1934.10","6123.60","3111.30","8057.70","428.65","0.00","1449.90","6123.60","6552.25","7573.50","8002.15","3012.30" +"2450815","29485","2450822","601","797995","6189","583","601","797995","6189","583","2","106","16","1","952","3","2","59","78.90","84.42","82.73","99.71","4881.07","4655.10","4980.78","292.86","0.00","1444.32","4881.07","5173.93","6325.39","6618.25","225.97" +"2450815","29485","2450825","601","797995","6189","583","601","797995","6189","583","2","14","20","1","1762","2","2","45","5.95","12.97","8.81","187.20","396.45","267.75","583.65","3.96","0.00","17.10","396.45","400.41","413.55","417.51","128.70" +"2450815","29485","2450831","601","797995","6189","583","601","797995","6189","583","2","64","1","1","482","1","2","40","94.56","277.06","2.77","10971.60","110.80","3782.40","11082.40","2.21","0.00","664.80","110.80","113.01","775.60","777.81","-3671.60" + + +"1","AAAAAAAABAAAAAAA","980124","7135","946","2452238","2452208","Mr. ","Javier ","Lewis ","Y","9","12","1936","CHILE","","Javier.Lewis@VFAxlnZEvOx.org ","2452508" +"2","AAAAAAAACAAAAAAA","819667","1461","655","2452318","2452288","Dr. ","Amy ","Moses ","Y","9","4","1966","TOGO","","Amy.Moses@Ovk9KjHH.com ","2452318" +"3","AAAAAAAADAAAAAAA","1473522","6247","572","2449130","2449100","Miss ","Latisha ","Hamilton ","N","18","9","1979","NIUE","","Latisha.Hamilton@V.com ","2452313" +"4","AAAAAAAAEAAAAAAA","1703214","3986","558","2450030","2450000","Dr. ","Michael ","White ","N","7","6","1983","MEXICO","","Michael.White@i.org ","2452361" +"5","AAAAAAAAFAAAAAAA","953372","4470","368","2449438","2449408","Sir ","Robert ","Moran ","N","8","5","1956","FIJI","","Robert.Moran@Hh.edu ","2452469" +"6","AAAAAAAAGAAAAAAA","213219","6374","82","2451883","2451853","Ms. ","Brunilda ","Sharp ","N","4","12","1925","SURINAME","","Brunilda.Sharp@T3pylZEUQjm.org ","2452430" +"7","AAAAAAAAHAAAAAAA","68377","3219","814","2451438","2451408","Ms. ","Fonda ","Wiles ","Y","24","4","1985","GAMBIA","","Fonda.Wiles@S9KnyEtz9hv.org ","2452360" +"8","AAAAAAAAIAAAAAAA","1215897","2471","598","2449406","2449376","Sir ","Ollie ","Shipman ","N","26","12","1938","KOREA, REPUBLIC OF","","Ollie.Shipman@be.org ","2452334" +"9","AAAAAAAAJAAAAAAA","1168667","1404","388","2452275","2452245","Sir ","Karl ","Gilbert ","N","26","10","1966","MONTSERRAT","","Karl.Gilbert@Crg5KyP2IxX9C4d6.edu ","2452454" +"10","AAAAAAAAKAAAAAAA","1207553","5143","580","2451353","2451323","Ms. ","Albert ","Brunson ","N","15","10","1973","JORDAN","","Albert.Brunson@62.com ","2452641" + + +"1","AAAAAAAABAAAAAAA","18 ","Jackson ","Parkway ","Suite 280 ","Fairfield","Maricopa County","AZ","86192 ","United States","-7.00","condo " +"2","AAAAAAAACAAAAAAA","362 ","Washington 6th","RD ","Suite 80 ","Fairview","Taos County","NM","85709 ","United States","-7.00","condo " +"3","AAAAAAAADAAAAAAA","585 ","Dogwood Washington","Circle ","Suite Q ","Pleasant Valley","York County","PA","12477 ","United States","-5.00","single family " +"4","AAAAAAAAEAAAAAAA","111 ","Smith ","Wy ","Suite A ","Oak Ridge","Kit Carson County","CO","88371 ","United States","-7.00","condo " +"5","AAAAAAAAFAAAAAAA","31 ","College ","Blvd ","Suite 180 ","Glendale","Barry County","MO","63951 ","United States","-6.00","single family " +"6","AAAAAAAAGAAAAAAA","59 ","Williams Sixth","Parkway ","Suite 100 ","Lakeview","Chelan County","WA","98579 ","United States","-8.00","single family " +"7","AAAAAAAAHAAAAAAA","","Hill 7th","Road ","Suite U ","Farmington","","","39145 ","United States","","" +"8","AAAAAAAAIAAAAAAA","875 ","Lincoln ","Ct. ","Suite Y ","Union","Bledsoe County","TN","38721 ","United States","-5.00","apartment " +"9","AAAAAAAAJAAAAAAA","819 ","1st Laurel","Ave ","Suite 70 ","New Hope","Perry County","AL","39431 ","United States","-6.00","condo " +"10","AAAAAAAAKAAAAAAA","851 ","Woodland Poplar","ST ","Suite Y ","Martinsville","Haines Borough","AK","90419 ","United States","-9.00","condo " + + +"1","M","M","Primary ","500","Good ","0","0","0" +"2","F","M","Primary ","500","Good ","0","0","0" +"3","M","S","Primary ","500","Good ","0","0","0" +"4","F","S","Primary ","500","Good ","0","0","0" +"5","M","D","Primary ","500","Good ","0","0","0" +"6","F","D","Primary ","500","Good ","0","0","0" +"7","M","W","Primary ","500","Good ","0","0","0" +"8","F","W","Primary ","500","Good ","0","0","0" +"9","M","U","Primary ","500","Good ","0","0","0" +"10","F","U","Primary ","500","Good ","0","0","0" + + +"2415022","AAAAAAAAOKJNECAA","1900-01-02","0","1","1","1900","1","1","2","1","1900","1","1","Monday ","1900Q1","N","N","Y","2415021","2415020","2414657","2414930","N","N","N","N","N" +"2415023","AAAAAAAAPKJNECAA","1900-01-03","0","1","1","1900","2","1","3","1","1900","1","1","Tuesday ","1900Q1","N","N","N","2415021","2415020","2414658","2414931","N","N","N","N","N" +"2415024","AAAAAAAAALJNECAA","1900-01-04","0","1","1","1900","3","1","4","1","1900","1","1","Wednesday","1900Q1","N","N","N","2415021","2415020","2414659","2414932","N","N","N","N","N" +"2415025","AAAAAAAABLJNECAA","1900-01-05","0","1","1","1900","4","1","5","1","1900","1","1","Thursday ","1900Q1","N","N","N","2415021","2415020","2414660","2414933","N","N","N","N","N" +"2415026","AAAAAAAACLJNECAA","1900-01-06","0","1","1","1900","5","1","6","1","1900","1","1","Friday ","1900Q1","N","Y","N","2415021","2415020","2414661","2414934","N","N","N","N","N" +"2415027","AAAAAAAADLJNECAA","1900-01-07","0","1","1","1900","6","1","7","1","1900","1","1","Saturday ","1900Q1","N","Y","N","2415021","2415020","2414662","2414935","N","N","N","N","N" +"2415028","AAAAAAAAELJNECAA","1900-01-08","0","1","1","1900","0","1","8","1","1900","1","1","Sunday ","1900Q1","N","N","N","2415021","2415020","2414663","2414936","N","N","N","N","N" +"2415029","AAAAAAAAFLJNECAA","1900-01-09","0","2","1","1900","1","1","9","1","1900","1","2","Monday ","1900Q1","N","N","N","2415021","2415020","2414664","2414937","N","N","N","N","N" +"2415030","AAAAAAAAGLJNECAA","1900-01-10","0","2","1","1900","2","1","10","1","1900","1","2","Tuesday ","1900Q1","N","N","N","2415021","2415020","2414665","2414938","N","N","N","N","N" +"2415031","AAAAAAAAHLJNECAA","1900-01-11","0","2","1","1900","3","1","11","1","1900","1","2","Wednesday","1900Q1","N","N","N","2415021","2415020","2414666","2414939","N","N","N","N","N" + + +"1","2","0-500 ","0","0" +"2","3","0-500 ","0","0" +"3","4","0-500 ","0","0" +"4","5","0-500 ","0","0" +"5","6","0-500 ","0","0" +"6","7","0-500 ","0","0" +"7","8","0-500 ","0","0" +"8","9","0-500 ","0","0" +"9","10","0-500 ","0","0" +"10","11","0-500 ","0","0" + + +"1","0","10000" +"2","10001","20000" +"3","20001","30000" +"4","30001","40000" +"5","40001","50000" +"6","50001","60000" +"7","60001","70000" +"8","70001","80000" +"9","80001","90000" +"10","90001","100000" + + +"2450815","1","1","211" +"2450815","2","1","235" +"2450815","4","1","859" +"2450815","7","1","704" +"2450815","8","1","891" +"2450815","10","1","834" +"2450815","13","1","591" +"2450815","14","1","579" +"2450815","16","1","622" +"2450815","19","1","745" + + +"1","AAAAAAAABAAAAAAA","1997-10-27","","Powers will not get influences. Electoral ports should show low, annual chains. Now young visitors may pose now however final pages. Bitterly right children suit increasing, leading el","27.02","23.23","5003002","exportischolar #2 ","3","pop ","5","Music ","52","ableanti ","N/A ","3663peru009490160959","spring ","Tsp ","Unknown ","6","ought " +"2","AAAAAAAACAAAAAAA","1997-10-27","2000-10-26","False opportunities would run alone with a views. Early approaches would show inc, european intentions; important, main passages shall know urban, ","1.12","0.38","1001001","amalgamalg #1 ","1","dresses ","1","Women ","294","esen stable ","petite ","516steel060826230906","rosy ","Bunch ","Unknown ","98","able " +"3","AAAAAAAACAAAAAAA","2000-10-27","","False opportunities would run alone with a views. Early approaches would show inc, european intentions; important, main passages shall know urban, ","7.11","0.38","1001001","brandbrand #4 ","7","decor ","7","Home ","294","esen stable ","N/A ","516steel060826230906","sienna ","Cup ","Unknown ","18","pri " +"4","AAAAAAAAEAAAAAAA","1997-10-27","1999-10-27","Normal systems would join simply different theories. Full, new clothes may eat instead achievements. D","1.35","0.85","3002001","importoexporti #1 ","2","infants ","3","Children ","479","n stationese ","extra large ","610157moccasin018327","red ","Tbl ","Unknown ","26","ese " +"5","AAAAAAAAEAAAAAAA","1999-10-28","2001-10-26","Normal systems would join simply different theories. Full, new clothes may eat instead achievements. D","4.00","1.76","2002002","importoimporto #2 ","2","shirts ","2","Men ","220","barableable ","petite ","42214rosy28066558020","pink ","Cup ","Unknown ","27","anti " +"6","AAAAAAAAEAAAAAAA","2001-10-27","","Normal systems would join simply different theories. Full, new clothes may eat instead achievements. D","0.85","1.76","2002002","exportiimporto #1 ","3","pants ","2","Men ","212","barableable ","large ","42214rosy28066558020","moccasin ","Bundle ","Unknown ","6","cally " +"7","AAAAAAAAHAAAAAAA","1997-10-27","","Anxious accounts must catch also years. Revolutionary, large directors used to embrace then mo","9.94","6.75","3001002","amalgexporti #2 ","1","newborn ","3","Children ","214","eseoughtable ","petite ","6moccasin24027188872","spring ","Tsp ","Unknown ","64","ation " +"8","AAAAAAAAIAAAAAAA","1997-10-27","2000-10-26","F","2.76","0.85","3003001","exportiexporti #1 ","3","toddlers ","3","Children ","630","barprically ","extra large ","35123wheat3256343398","turquoise ","Carton ","Unknown ","25","eing " +"9","AAAAAAAAIAAAAAAA","2000-10-27","","F","4.46","0.85","1004002","edu packamalg #2 ","3","swimwear ","1","Women ","630","barprically ","medium ","35123wheat3256343398","wheat ","Tbl ","Unknown ","3","n st " +"10","AAAAAAAAKAAAAAAA","1997-10-27","1999-10-27","Classical services go trousers. However great galleries might say needs. Assumptions change very in favour of the notes. Teeth woul","8.94","4.11","10008011","namelessunivamalg #11 ","8","scanners ","10","Electronics ","350","barantipri ","N/A ","8159007505thistle447","pale ","Tsp ","Unknown ","34","barought " + + +"1","AAAAAAAABAAAAAAA","2450164","2450185","686","1000.00","1","ought ","Y","N","N","N","N","N","N","N","Men will not say merely. Old, available ","Unknown ","N" +"2","AAAAAAAACAAAAAAA","2450118","2450150","1264","1000.00","1","able ","Y","N","N","N","N","N","N","N","So willing buildings coul","Unknown ","N" +"3","AAAAAAAADAAAAAAA","2450675","2450712","1468","1000.00","1","pri ","Y","N","N","N","N","N","N","N","Companies shall not pr","Unknown ","N" + + +"1","AAAAAAAABAAAAAAA","Package was damaged " + + +"1","AAAAAAAABAAAAAAA","EXPRESS ","AIR ","UPS ","YvxVaJI10 " +"2","AAAAAAAACAAAAAAA","NEXT DAY ","AIR ","FEDEX ","ldhM8IvpzHgdbBgDfI " +"3","AAAAAAAADAAAAAAA","OVERNIGHT ","AIR ","AIRBORNE ","6Hzzp4JkzjqD8MGXLCDa" +"4","AAAAAAAAEAAAAAAA","TWO DAY ","AIR ","USPS ","UaAJjKDnL4gTOqbpj " +"5","AAAAAAAAFAAAAAAA","LIBRARY ","AIR ","DHL ","HVDFCcQ " +"6","AAAAAAAAGAAAAAAA","REGULAR ","SURFACE ","TBS ","Ek " +"7","AAAAAAAAHAAAAAAA","EXPRESS ","SURFACE ","ZHOU ","hGoF18SLDDPBj " +"8","AAAAAAAAIAAAAAAA","NEXT DAY ","SURFACE ","ZOUROS ","yVfotg7Tio3MVhBg6Bkn" +"9","AAAAAAAAJAAAAAAA","OVERNIGHT ","SURFACE ","MSC ","Xjy3ZPuiDjzHlRx14Z3 " +"10","AAAAAAAAKAAAAAAA","TWO DAY ","SURFACE ","LATVIAN ","P7FBIt8yd " + + +"1","AAAAAAAABAAAAAAA","1997-03-13","","2451189","ought","245","5250760","8AM-4PM ","William Ward","2","Unknown","Enough high areas stop expectations. Elaborate, local is","Charles Bartley","1","Unknown","1","Unknown","767","Spring ","Wy ","Suite 250 ","Midway","Williamson County","TN","31904 ","United States","-5.00","0.03" +"2","AAAAAAAACAAAAAAA","1997-03-13","2000-03-12","","able","236","5285950","8AM-4PM ","Scott Smith","8","Unknown","Parliamentary candidates wait then heavy, keen mil","David Lamontagne","1","Unknown","1","Unknown","255","Sycamore ","Dr. ","Suite 410 ","Midway","Williamson County","TN","31904 ","United States","-5.00","0.03" + + +"2450822","52583","535","536","266002","2391","827","2","1","7548","31","555.52","33.33","588.85","79.71","79.36","372.19","91.66","91.67","192.40" +"2450837","32636","343","630","949229","2665","654","2","1","3945","77","1402.17","42.06","1444.23","54.10","130.90","841.30","28.04","532.83","227.06" +"2450838","54872","271","456","72439","6292","98","1","1","4609","25","358.50","17.92","376.42","33.01","450.50","129.06","57.36","172.08","501.43" +"2450839","35421","1870","276","1522064","4727","37","2","1","2379","57","644.10","19.32","663.42","47.25","0.00","347.81","14.81","281.48","66.57" +"2450839","39106","1856","627","786473","751","782","1","1","1080","37","730.75","29.23","759.98","17.55","569.80","577.29","21.48","131.98","616.58" +"2450841","38729","202","909","1363392","3307","575","2","1","3246","13","994.50","39.78","1034.28","58.24","761.41","188.95","386.66","418.89","859.43" +"2450842","43809","145","692","106562","5225","535","1","1","840","4","22.32","1.33","23.65","77.85","183.32","8.92","0.40","13.00","262.50" +"2450842","46368","1400","669","82247","1041","35","1","1","452","21","1543.71","46.31","1590.02","80.23","434.07","1250.40","38.13","255.18","560.61" +"2450846","55903","662","581","1799451","2246","841","2","1","2552","29","3019.48","181.16","3200.64","72.59","1998.97","1841.88","612.35","565.25","2252.72" +"2450846","58962","1936","550","404594","350","906","1","1","7462","6","44.22","2.65","46.87","57.08","116.10","34.93","2.60","6.69","175.83" + + +"2450816","33592","152","373","861379","2338","944","2","1","6435","48","88.05","110.06","102.35","0.00","4912.80","4226.40","5282.88","343.89","0.00","4912.80","5256.69","686.40" +"2450816","33592","1096","373","861379","2338","944","2","2","6435","12","5.94","6.71","3.95","9.95","47.40","71.28","80.52","2.99","9.95","37.45","40.44","-33.83" +"2450816","33592","1636","373","861379","2338","944","2","2","6435","18","77.82","147.85","57.66","0.00","1037.88","1400.76","2661.30","51.89","0.00","1037.88","1089.77","-362.88" +"2450816","33592","1810","373","861379","2338","944","2","2","6435","88","41.17","53.10","7.43","0.00","653.84","3622.96","4672.80","13.07","0.00","653.84","666.91","-2969.12" +"2450816","33592","1882","373","861379","2338","944","2","2","6435","83","43.21","52.28","50.18","0.00","4164.94","3586.43","4339.24","0.00","0.00","4164.94","4164.94","578.51" +"2450816","33592","1954","373","861379","2338","944","2","2","6435","12","25.41","27.18","9.51","4.56","114.12","304.92","326.16","4.38","4.56","109.56","113.94","-195.36" +"2450816","59782","367","550","79105","3860","215","2","2","7462","21","2.85","2.96","2.07","0.00","43.47","59.85","62.16","0.86","0.00","43.47","44.33","-16.38" +"2450816","59782","572","550","79105","3860","215","2","3","7462","92","75.22","93.27","29.84","0.00","2745.28","6920.24","8580.84","137.26","0.00","2745.28","2882.54","-4174.96" +"2450816","59782","1228","550","79105","3860","215","2","1","7462","95","59.48","93.97","41.34","0.00","3927.30","5650.60","8927.15","78.54","0.00","3927.30","4005.84","-1723.30" +"2450816","59782","1573","550","79105","3860","215","2","2","7462","96","35.72","55.00","53.90","0.00","5174.40","3429.12","5280.00","103.48","0.00","5174.40","5277.88","1745.28" + + +"0","AAAAAAAABAAAAAAA","0","0","0","0","AM","third ","night "," " +"1","AAAAAAAACAAAAAAA","1","0","0","1","AM","third ","night "," " +"2","AAAAAAAADAAAAAAA","2","0","0","2","AM","third ","night "," " +"3","AAAAAAAAEAAAAAAA","3","0","0","3","AM","third ","night "," " +"4","AAAAAAAAFAAAAAAA","4","0","0","4","AM","third ","night "," " +"5","AAAAAAAAGAAAAAAA","5","0","0","5","AM","third ","night "," " +"6","AAAAAAAAHAAAAAAA","6","0","0","6","AM","third ","night "," " +"7","AAAAAAAAIAAAAAAA","7","0","0","7","AM","third ","night "," " +"8","AAAAAAAAJAAAAAAA","8","0","0","8","AM","third ","night "," " +"9","AAAAAAAAKAAAAAAA","9","0","0","9","AM","third ","night "," " + + +"1","AAAAAAAABAAAAAAA","Conventional childr","977787","651 ","6th ","Parkway ","Suite 470 ","Midway","Williamson County","TN","31904 ","United States","-5.00" + + +"1","AAAAAAAABAAAAAAA","1997-09-03","","2450810","2452620","Y","539","http://www.foo.com","welcome ","2531","8","3","4" +"2","AAAAAAAACAAAAAAA","1997-09-03","2000-09-02","2450814","2452580","N","","http://www.foo.com","protected ","1564","4","3","1" + + +"2450901","35146","1294","990","1024677","4011","498","990","1024677","4011","498","2","1","751","4","186.20","11.17","197.37","45.26","20.96","104.27","18.84","63.09","77.39" +"2450911","70001","1699","33","934543","1500","610","33","934543","1500","610","2","1","238","2","56.52","3.39","59.91","43.73","56.52","41.82","5.29","9.41","103.64" +"2450916","36053","187","645","1473236","1027","218","645","1473236","1027","218","2","1","920","32","1060.16","42.40","1102.56","74.87","1120.64","106.01","95.41","858.74","1237.91" +"2450925","16066","925","275","363739","4156","820","275","363739","4156","820","1","1","281","51","2536.74","76.10","2612.84","85.91","164.73","228.30","946.46","1361.98","326.74" +"2450937","46424","973","334","1139245","2956","67","334","1139245","2956","67","2","1","600","35","672.35","47.06","719.41","12.05","288.05","349.62","287.22","35.51","347.16" +"2450946","53668","412","104","213066","5181","496","104","213066","5181","496","2","1","600","27","126.36","3.79","130.15","53.80","221.40","111.19","8.49","6.68","278.99" +"2450966","33696","1903","617","351772","374","529","617","351772","374","529","1","1","336","18","1731.42","103.88","1835.30","96.01","255.06","1523.64","149.60","58.18","454.95" +"2450973","8897","1993","297","143976","3855","334","297","143976","3855","334","1","1","910","4","535.00","32.10","567.10","3.94","145.28","160.50","348.28","26.22","181.32" +"2450974","68133","1330","369","1234242","2915","788","369","1234242","2915","788","1","1","352","29","350.61","0.00","350.61","47.54","267.09","115.70","70.47","164.44","314.63" +"2450976","42382","274","968","169725","1529","286","968","169725","1529","286","1","1","27","11","380.49","15.21","395.70","76.70","77.66","144.58","11.79","224.12","169.57" + + +"2450818","17496","2450824","1714","759","1892819","326","833","759","1892819","326","833","1","1","15","1","1","410","29","65.83","156.01","117.00","1131.29","3393.00","1909.07","4524.29","305.37","0.00","1221.48","3393.00","3698.37","4614.48","4919.85","1483.93" +"2450818","17496","2450837","578","759","1892819","326","833","759","1892819","326","833","2","1","15","1","3","410","34","13.25","38.02","1.52","1241.00","51.68","450.50","1292.68","0.00","0.00","439.28","51.68","51.68","490.96","490.96","-398.82" +"2450818","17496","2450846","1531","759","1892819","326","833","759","1892819","326","833","2","2","2","1","3","410","7","62.73","138.00","52.44","598.92","367.08","439.11","966.00","25.69","0.00","367.08","367.08","392.77","734.16","759.85","-72.03" +"2450818","17496","2450862","1778","759","1892819","326","833","759","1892819","326","833","2","1","12","1","2","410","26","93.15","136.93","75.31","1602.12","1958.06","2421.90","3560.18","39.16","0.00","106.60","1958.06","1997.22","2064.66","2103.82","-463.84" +"2450818","17496","2450878","476","759","1892819","326","833","759","1892819","326","833","2","1","19","1","1","410","30","16.12","37.72","28.66","271.80","859.80","483.60","1131.60","68.78","0.00","294.00","859.80","928.58","1153.80","1222.58","376.20" +"2450818","17496","2450881","1345","759","1892819","326","833","759","1892819","326","833","2","2","9","1","3","410","72","83.07","235.91","158.05","5605.92","11379.60","5981.04","16985.52","682.77","0.00","0.00","11379.60","12062.37","11379.60","12062.37","5398.56" +"2450818","17496","2450896","1978","759","1892819","326","833","759","1892819","326","833","2","2","3","1","1","410","13","40.74","41.96","27.69","185.51","359.97","529.62","545.48","32.39","0.00","27.17","359.97","392.36","387.14","419.53","-169.65" +"2450818","17496","2450901","217","759","1892819","326","833","759","1892819","326","833","2","1","14","1","3","410","29","21.82","55.64","25.03","887.69","725.87","632.78","1613.56","50.81","0.00","806.78","725.87","776.68","1532.65","1583.46","93.09" +"2450818","17496","2450923","985","759","1892819","326","833","759","1892819","326","833","2","2","13","1","2","410","29","22.82","31.71","23.14","248.53","671.06","661.78","919.59","40.26","0.00","229.68","671.06","711.32","900.74","941.00","9.28" +"2450818","17496","2450927","373","759","1892819","326","833","759","1892819","326","833","2","1","6","1","2","410","95","96.94","157.04","117.78","3729.70","11189.10","9209.30","14918.80","288.67","1566.47","447.45","9622.63","9911.30","10070.08","10358.75","413.33" + + +"1","AAAAAAAABAAAAAAA","1997-08-16","","site_0","2450807","","Unknown","Ronald Shaffer","4","Grey lines ought to result indeed centres. Tod","Well similar decisions used to keep hardly democratic, personal priorities.","Joe George","6","cally ","51 ","Dogwood Sunset","Ln ","Suite 330 ","Midway","Williamson County","TN","31904 ","United States","-5.00","0.10" +"2","AAAAAAAACAAAAAAA","1997-08-16","2000-08-15","site_0","2450798","2448973","Unknown","Tommy Jones","6","Completely excellent things ought to pro","Lucky passengers know. Red details will not hang alive, international s","David Myers","4","ese ","358 ","Ridge Wilson","Cir. ","Suite 150 ","Midway","Williamson County","TN","31904 ","United States","-5.00","0.00" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00001.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00001.sql new file mode 100644 index 00000000000..fbb0d4f8d13 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00001.sql @@ -0,0 +1,31 @@ +WITH + customer_total_return AS ( + SELECT + "sr_customer_sk" "ctr_customer_sk" + , "sr_store_sk" "ctr_store_sk" + , "sum"("sr_return_amt") "ctr_total_return" + FROM + store_returns + , date_dim + WHERE ("sr_returned_date_sk" = "d_date_sk") + AND ("d_year" = 2000) + GROUP BY "sr_customer_sk", "sr_store_sk" +) +SELECT "c_customer_id" +FROM + customer_total_return ctr1 +, store +, customer +WHERE ("ctr1"."ctr_total_return" > ( + SELECT ("avg"("ctr_total_return") * DECIMAL '1.2') + FROM + customer_total_return ctr2 + WHERE ("ctr1"."ctr_store_sk" = "ctr2"."ctr_store_sk") + )) + AND ("s_store_sk" = "ctr1"."ctr_store_sk") + AND ("s_state" = 'TN') + AND ("ctr1"."ctr_customer_sk" = "c_customer_sk") +ORDER BY "c_customer_id" ASC + -- additional columns to assure results stability for larger scale factors this is a deviation from TPC-DS specification +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00001.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00001.txt new file mode 100644 index 00000000000..3aa6d9d9016 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00001.txt @@ -0,0 +1,100 @@ +"AAAAAAAAAACAAAAA" +"AAAAAAAAAADAAAAA" +"AAAAAAAAACCAAAAA" +"AAAAAAAAADDAAAAA" +"AAAAAAAAAEAAAAAA" +"AAAAAAAAAHCAAAAA" +"AAAAAAAAAIDAAAAA" +"AAAAAAAAAJBAAAAA" +"AAAAAAAAAJCAAAAA" +"AAAAAAAAAKBAAAAA" +"AAAAAAAAALDAAAAA" +"AAAAAAAAAMDAAAAA" +"AAAAAAAAAODAAAAA" +"AAAAAAAAAODAAAAA" +"AAAAAAAABBAAAAAA" +"AAAAAAAABBBAAAAA" +"AAAAAAAABBDAAAAA" +"AAAAAAAABCAAAAAA" +"AAAAAAAABCAAAAAA" +"AAAAAAAABCBAAAAA" +"AAAAAAAABCCAAAAA" +"AAAAAAAABEAAAAAA" +"AAAAAAAABEDAAAAA" +"AAAAAAAABGAAAAAA" +"AAAAAAAABGBAAAAA" +"AAAAAAAABGDAAAAA" +"AAAAAAAABHAAAAAA" +"AAAAAAAABIBAAAAA" +"AAAAAAAABIDAAAAA" +"AAAAAAAABJDAAAAA" +"AAAAAAAABKCAAAAA" +"AAAAAAAABKCAAAAA" +"AAAAAAAABLAAAAAA" +"AAAAAAAABLCAAAAA" +"AAAAAAAABMCAAAAA" +"AAAAAAAABMDAAAAA" +"AAAAAAAABNBAAAAA" +"AAAAAAAABNBAAAAA" +"AAAAAAAABNDAAAAA" +"AAAAAAAABOAAAAAA" +"AAAAAAAABODAAAAA" +"AAAAAAAABPBAAAAA" +"AAAAAAAACAAAAAAA" +"AAAAAAAACABAAAAA" +"AAAAAAAACACAAAAA" +"AAAAAAAACACAAAAA" +"AAAAAAAACBAAAAAA" +"AAAAAAAACCAAAAAA" +"AAAAAAAACDAAAAAA" +"AAAAAAAACGBAAAAA" +"AAAAAAAACGDAAAAA" +"AAAAAAAACHAAAAAA" +"AAAAAAAACHBAAAAA" +"AAAAAAAACHDAAAAA" +"AAAAAAAACICAAAAA" +"AAAAAAAACJAAAAAA" +"AAAAAAAACJBAAAAA" +"AAAAAAAACJDAAAAA" +"AAAAAAAACJDAAAAA" +"AAAAAAAACLBAAAAA" +"AAAAAAAACLCAAAAA" +"AAAAAAAACNBAAAAA" +"AAAAAAAACNBAAAAA" +"AAAAAAAACOCAAAAA" +"AAAAAAAACOCAAAAA" +"AAAAAAAACPAAAAAA" +"AAAAAAAACPCAAAAA" +"AAAAAAAADBAAAAAA" +"AAAAAAAADBDAAAAA" +"AAAAAAAADCAAAAAA" +"AAAAAAAADDAAAAAA" +"AAAAAAAADDDAAAAA" +"AAAAAAAADFAAAAAA" +"AAAAAAAADFBAAAAA" +"AAAAAAAADGBAAAAA" +"AAAAAAAADGDAAAAA" +"AAAAAAAADHDAAAAA" +"AAAAAAAADJAAAAAA" +"AAAAAAAADKBAAAAA" +"AAAAAAAADMAAAAAA" +"AAAAAAAADMDAAAAA" +"AAAAAAAADNBAAAAA" +"AAAAAAAADNCAAAAA" +"AAAAAAAADOAAAAAA" +"AAAAAAAADOCAAAAA" +"AAAAAAAADODAAAAA" +"AAAAAAAADPBAAAAA" +"AAAAAAAADPCAAAAA" +"AAAAAAAAEAAAAAAA" +"AAAAAAAAEAAAAAAA" +"AAAAAAAAEACAAAAA" +"AAAAAAAAEBAAAAAA" +"AAAAAAAAEBBAAAAA" +"AAAAAAAAEBCAAAAA" +"AAAAAAAAECAAAAAA" +"AAAAAAAAECBAAAAA" +"AAAAAAAAEDBAAAAA" +"AAAAAAAAEDBAAAAA" +"AAAAAAAAEHBAAAAA" +"AAAAAAAAEHDAAAAA" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00002.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00002.sql new file mode 100644 index 00000000000..0e797b63953 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00002.sql @@ -0,0 +1,82 @@ +WITH + wscs AS ( + SELECT + "sold_date_sk" + , "sales_price" + FROM + ( + SELECT + "ws_sold_date_sk" "sold_date_sk" + , "ws_ext_sales_price" "sales_price" + FROM + web_sales + ) +UNION ALL ( + SELECT + "cs_sold_date_sk" "sold_date_sk" + , "cs_ext_sales_price" "sales_price" + FROM + catalog_sales + ) ) +, wswscs AS ( + SELECT + "d_week_seq" + , "sum"((CASE WHEN ("d_day_name" = 'Sunday') THEN "sales_price" ELSE null END)) "sun_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Monday') THEN "sales_price" ELSE null END)) "mon_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Tuesday') THEN "sales_price" ELSE null END)) "tue_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Wednesday') THEN "sales_price" ELSE null END)) "wed_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Thursday') THEN "sales_price" ELSE null END)) "thu_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Friday') THEN "sales_price" ELSE null END)) "fri_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Saturday') THEN "sales_price" ELSE null END)) "sat_sales" + FROM + wscs + , date_dim + WHERE ("d_date_sk" = "sold_date_sk") + GROUP BY "d_week_seq" +) +SELECT + "d_week_seq1" +, "round"(("sun_sales1" / "sun_sales2"), 2) +, "round"(("mon_sales1" / "mon_sales2"), 2) +, "round"(("tue_sales1" / "tue_sales2"), 2) +, "round"(("wed_sales1" / "wed_sales2"), 2) +, "round"(("thu_sales1" / "thu_sales2"), 2) +, "round"(("fri_sales1" / "fri_sales2"), 2) +, "round"(("sat_sales1" / "sat_sales2"), 2) +FROM + ( + SELECT + "wswscs"."d_week_seq" "d_week_seq1" + , "sun_sales" "sun_sales1" + , "mon_sales" "mon_sales1" + , "tue_sales" "tue_sales1" + , "wed_sales" "wed_sales1" + , "thu_sales" "thu_sales1" + , "fri_sales" "fri_sales1" + , "sat_sales" "sat_sales1" + FROM + wswscs + , date_dim + WHERE ("date_dim"."d_week_seq" = "wswscs"."d_week_seq") + AND ("d_year" = 2001) +) y +, ( + SELECT + "wswscs"."d_week_seq" "d_week_seq2" + , "sun_sales" "sun_sales2" + , "mon_sales" "mon_sales2" + , "tue_sales" "tue_sales2" + , "wed_sales" "wed_sales2" + , "thu_sales" "thu_sales2" + , "fri_sales" "fri_sales2" + , "sat_sales" "sat_sales2" + FROM + wswscs + , date_dim + WHERE ("date_dim"."d_week_seq" = "wswscs"."d_week_seq") + AND ("d_year" = (2001 + 1)) +) z +WHERE ("d_week_seq1" = ("d_week_seq2" - 53)) +ORDER BY "d_week_seq1" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00002.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00002.txt new file mode 100644 index 00000000000..1460ba4fbb2 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00002.txt @@ -0,0 +1,100 @@ +"5270","6.05","1.12","3.93","1.24","1.22","5.52","3.90" +"5270","6.05","1.12","3.93","1.24","1.22","5.52","3.90" +"5270","6.05","1.12","3.93","1.24","1.22","5.52","3.90" +"5270","6.05","1.12","3.93","1.24","1.22","5.52","3.90" +"5270","6.05","1.12","3.93","1.24","1.22","5.52","3.90" +"5270","6.05","1.12","3.93","1.24","1.22","5.52","3.90" +"5270","6.05","1.12","3.93","1.24","1.22","5.52","3.90" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5271","0.88","2.15","0.82","0.85","0.49","0.48","0.54" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" +"5272","0.66","0.42","0.78","0.41","0.55","1.04","0.66" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00003.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00003.sql new file mode 100644 index 00000000000..779da83851a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00003.sql @@ -0,0 +1,17 @@ +SELECT + "dt"."d_year" +, "item"."i_brand_id" "brand_id" +, "item"."i_brand" "brand" +, "sum"("ss_ext_sales_price") "sum_agg" +FROM + date_dim dt +, store_sales +, item +WHERE ("dt"."d_date_sk" = "store_sales"."ss_sold_date_sk") + AND ("store_sales"."ss_item_sk" = "item"."i_item_sk") + AND ("item"."i_manufact_id" = 128) + AND ("dt"."d_moy" = 11) +GROUP BY "dt"."d_year", "item"."i_brand", "item"."i_brand_id" +ORDER BY "dt"."d_year" ASC, "sum_agg" DESC, "brand_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00003.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00003.txt new file mode 100644 index 00000000000..d31a2dc0338 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00003.txt @@ -0,0 +1,20 @@ +"1998","7007010","brandbrand #10 ","14247.33" +"1998","3001001","amalgexporti #1 ","8134.69" +"1998","1004001","edu packamalg #1 ","2206.52" +"1998","6004008","edu packcorp #8 ","984.85" +"1999","3001001","amalgexporti #1 ","7830.78" +"1999","6004008","edu packcorp #8 ","6224.95" +"1999","1004001","edu packamalg #1 ","6131.62" +"1999","7007010","brandbrand #10 ","4792.90" +"2000","6004008","edu packcorp #8 ","9502.59" +"2000","3001001","amalgexporti #1 ","6823.96" +"2000","7007010","brandbrand #10 ","3967.52" +"2000","1004001","edu packamalg #1 ","565.55" +"2001","7007010","brandbrand #10 ","16255.97" +"2001","3001001","importoscholar #2 ","12456.75" +"2001","1004001","exportiexporti #2 ","7825.52" +"2001","6004008","edu packcorp #8 ","4965.77" +"2002","7007010","brandbrand #10 ","13046.07" +"2002","1004001","exportiexporti #2 ","9056.36" +"2002","3001001","importoscholar #2 ","3553.74" +"2002","6004008","edu packcorp #8 ","1446.48" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00004.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00004.sql new file mode 100644 index 00000000000..006a64e2ada --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00004.sql @@ -0,0 +1,94 @@ +WITH + year_total AS ( + SELECT + "c_customer_id" "customer_id" + , "c_first_name" "customer_first_name" + , "c_last_name" "customer_last_name" + , "c_preferred_cust_flag" "customer_preferred_cust_flag" + , "c_birth_country" "customer_birth_country" + , "c_login" "customer_login" + , "c_email_address" "customer_email_address" + , "d_year" "dyear" + , "sum"((((("ss_ext_list_price" - "ss_ext_wholesale_cost") - "ss_ext_discount_amt") + "ss_ext_sales_price") / 2)) "year_total" + , 's' "sale_type" + FROM + customer + , store_sales + , date_dim + WHERE ("c_customer_sk" = "ss_customer_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + GROUP BY "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", "c_email_address", "d_year" +UNION ALL SELECT + "c_customer_id" "customer_id" + , "c_first_name" "customer_first_name" + , "c_last_name" "customer_last_name" + , "c_preferred_cust_flag" "customer_preferred_cust_flag" + , "c_birth_country" "customer_birth_country" + , "c_login" "customer_login" + , "c_email_address" "customer_email_address" + , "d_year" "dyear" + , "sum"((((("cs_ext_list_price" - "cs_ext_wholesale_cost") - "cs_ext_discount_amt") + "cs_ext_sales_price") / 2)) "year_total" + , 'c' "sale_type" + FROM + customer + , catalog_sales + , date_dim + WHERE ("c_customer_sk" = "cs_bill_customer_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + GROUP BY "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", "c_email_address", "d_year" +UNION ALL SELECT + "c_customer_id" "customer_id" + , "c_first_name" "customer_first_name" + , "c_last_name" "customer_last_name" + , "c_preferred_cust_flag" "customer_preferred_cust_flag" + , "c_birth_country" "customer_birth_country" + , "c_login" "customer_login" + , "c_email_address" "customer_email_address" + , "d_year" "dyear" + , "sum"((((("ws_ext_list_price" - "ws_ext_wholesale_cost") - "ws_ext_discount_amt") + "ws_ext_sales_price") / 2)) "year_total" + , 'w' "sale_type" + FROM + customer + , web_sales + , date_dim + WHERE ("c_customer_sk" = "ws_bill_customer_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + GROUP BY "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", "c_email_address", "d_year" +) +SELECT + "t_s_secyear"."customer_id" +, "t_s_secyear"."customer_first_name" +, "t_s_secyear"."customer_last_name" +, "t_s_secyear"."customer_preferred_cust_flag" +FROM + year_total t_s_firstyear +, year_total t_s_secyear +, year_total t_c_firstyear +, year_total t_c_secyear +, year_total t_w_firstyear +, year_total t_w_secyear +WHERE ("t_s_secyear"."customer_id" = "t_s_firstyear"."customer_id") + AND ("t_s_firstyear"."customer_id" = "t_c_secyear"."customer_id") + AND ("t_s_firstyear"."customer_id" = "t_c_firstyear"."customer_id") + AND ("t_s_firstyear"."customer_id" = "t_w_firstyear"."customer_id") + AND ("t_s_firstyear"."customer_id" = "t_w_secyear"."customer_id") + AND ("t_s_firstyear"."sale_type" = 's') + AND ("t_c_firstyear"."sale_type" = 'c') + AND ("t_w_firstyear"."sale_type" = 'w') + AND ("t_s_secyear"."sale_type" = 's') + AND ("t_c_secyear"."sale_type" = 'c') + AND ("t_w_secyear"."sale_type" = 'w') + AND ("t_s_firstyear"."dyear" = 2001) + AND ("t_s_secyear"."dyear" = (2001 + 1)) + AND ("t_c_firstyear"."dyear" = 2001) + AND ("t_c_secyear"."dyear" = (2001 + 1)) + AND ("t_w_firstyear"."dyear" = 2001) + AND ("t_w_secyear"."dyear" = (2001 + 1)) + AND ("t_s_firstyear"."year_total" > 0) + AND ("t_c_firstyear"."year_total" > 0) + AND ("t_w_firstyear"."year_total" > 0) + AND ((CASE WHEN ("t_c_firstyear"."year_total" > 0) THEN ("t_c_secyear"."year_total" / "t_c_firstyear"."year_total") ELSE null END) > (CASE WHEN ("t_s_firstyear"."year_total" > 0) THEN ("t_s_secyear"."year_total" / "t_s_firstyear"."year_total") ELSE null END)) + AND ((CASE WHEN ("t_c_firstyear"."year_total" > 0) THEN ("t_c_secyear"."year_total" / "t_c_firstyear"."year_total") ELSE null END) > (CASE WHEN ("t_w_firstyear"."year_total" > 0) THEN ("t_w_secyear"."year_total" / "t_w_firstyear"."year_total") ELSE null END)) +ORDER BY "t_s_secyear"."customer_id" ASC, "t_s_secyear"."customer_first_name" ASC, "t_s_secyear"."customer_last_name" ASC, "t_s_secyear"."customer_preferred_cust_flag" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00004.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00004.txt new file mode 100644 index 00000000000..4c497346178 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00004.txt @@ -0,0 +1,7 @@ +"AAAAAAAADOCAAAAA","Joy ","Baker ","Y" +"AAAAAAAAHMBAAAAA","Eunice ","Shaw ","N" +"AAAAAAAAIICAAAAA","Sherri ","Tyler ","Y" +"AAAAAAAAJCAAAAAA","Maxine ","Carlson ","N" +"AAAAAAAAJGBAAAAA","Bonnie ","Harrison ","Y" +"AAAAAAAALJBAAAAA","Cleo ","Spangler ","N" +"AAAAAAAAMOAAAAAA","Becky ","Downey ","N" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00005.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00005.sql new file mode 100644 index 00000000000..0d699ec7a3d --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00005.sql @@ -0,0 +1,145 @@ +WITH + ssr AS ( + SELECT + "s_store_id" + , "sum"("sales_price") "sales" + , "sum"("profit") "profit" + , "sum"("return_amt") "returns" + , "sum"("net_loss") "profit_loss" + FROM + ( + SELECT + "ss_store_sk" "store_sk" + , "ss_sold_date_sk" "date_sk" + , "ss_ext_sales_price" "sales_price" + , "ss_net_profit" "profit" + , CAST(0 AS DECIMAL(7,2)) "return_amt" + , CAST(0 AS DECIMAL(7,2)) "net_loss" + FROM + store_sales +UNION ALL SELECT + "sr_store_sk" "store_sk" + , "sr_returned_date_sk" "date_sk" + , CAST(0 AS DECIMAL(7,2)) "sales_price" + , CAST(0 AS DECIMAL(7,2)) "profit" + , "sr_return_amt" "return_amt" + , "sr_net_loss" "net_loss" + FROM + store_returns + ) salesreturns + , date_dim + , store + WHERE ("date_sk" = "d_date_sk") + AND ("d_date" BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '14' DAY)) + AND ("store_sk" = "s_store_sk") + GROUP BY "s_store_id" +) +, csr AS ( + SELECT + "cp_catalog_page_id" + , "sum"("sales_price") "sales" + , "sum"("profit") "profit" + , "sum"("return_amt") "returns" + , "sum"("net_loss") "profit_loss" + FROM + ( + SELECT + "cs_catalog_page_sk" "page_sk" + , "cs_sold_date_sk" "date_sk" + , "cs_ext_sales_price" "sales_price" + , "cs_net_profit" "profit" + , CAST(0 AS DECIMAL(7,2)) "return_amt" + , CAST(0 AS DECIMAL(7,2)) "net_loss" + FROM + catalog_sales +UNION ALL SELECT + "cr_catalog_page_sk" "page_sk" + , "cr_returned_date_sk" "date_sk" + , CAST(0 AS DECIMAL(7,2)) "sales_price" + , CAST(0 AS DECIMAL(7,2)) "profit" + , "cr_return_amount" "return_amt" + , "cr_net_loss" "net_loss" + FROM + catalog_returns + ) salesreturns + , date_dim + , catalog_page + WHERE ("date_sk" = "d_date_sk") + AND ("d_date" BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '14' DAY)) + AND ("page_sk" = "cp_catalog_page_sk") + GROUP BY "cp_catalog_page_id" +) +, wsr AS ( + SELECT + "web_site_id" + , "sum"("sales_price") "sales" + , "sum"("profit") "profit" + , "sum"("return_amt") "returns" + , "sum"("net_loss") "profit_loss" + FROM + ( + SELECT + "ws_web_site_sk" "wsr_web_site_sk" + , "ws_sold_date_sk" "date_sk" + , "ws_ext_sales_price" "sales_price" + , "ws_net_profit" "profit" + , CAST(0 AS DECIMAL(7,2)) "return_amt" + , CAST(0 AS DECIMAL(7,2)) "net_loss" + FROM + web_sales +UNION ALL SELECT + "ws_web_site_sk" "wsr_web_site_sk" + , "wr_returned_date_sk" "date_sk" + , CAST(0 AS DECIMAL(7,2)) "sales_price" + , CAST(0 AS DECIMAL(7,2)) "profit" + , "wr_return_amt" "return_amt" + , "wr_net_loss" "net_loss" + FROM + (web_returns + LEFT JOIN web_sales ON ("wr_item_sk" = "ws_item_sk") + AND ("wr_order_number" = "ws_order_number")) + ) salesreturns + , date_dim + , web_site + WHERE ("date_sk" = "d_date_sk") + AND ("d_date" BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '14' DAY)) + AND ("wsr_web_site_sk" = "web_site_sk") + GROUP BY "web_site_id" +) +SELECT + "channel" +, "id" +, "sum"("sales") "sales" +, "sum"("returns") "returns" +, "sum"("profit") "profit" +FROM + ( + SELECT + 'store channel' "channel" + , "concat"('store', "s_store_id") "id" + , "sales" + , "returns" + , ("profit" - "profit_loss") "profit" + FROM + ssr +UNION ALL SELECT + 'catalog channel' "channel" + , "concat"('catalog_page', "cp_catalog_page_id") "id" + , "sales" + , "returns" + , ("profit" - "profit_loss") "profit" + FROM + csr +UNION ALL SELECT + 'web channel' "channel" + , "concat"('web_site', "web_site_id") "id" + , "sales" + , "returns" + , ("profit" - "profit_loss") "profit" + FROM + wsr +) x +GROUP BY ROLLUP (channel, id) +ORDER BY "channel" ASC, "id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00005.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00005.txt new file mode 100644 index 00000000000..80a31731605 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00005.txt @@ -0,0 +1,100 @@ +"catalog channel","catalog_pageAAAAAAAAAAABAAAA","3565.53","0.00","-7892.57" +"catalog channel","catalog_pageAAAAAAAAABABAAAA","17651.76","0.00","4226.70" +"catalog channel","catalog_pageAAAAAAAAADCBAAAA","8320.65","0.00","-944.83" +"catalog channel","catalog_pageAAAAAAAAAEABAAAA","6839.68","0.00","1031.84" +"catalog channel","catalog_pageAAAAAAAAAECBAAAA","19248.58","0.00","277.31" +"catalog channel","catalog_pageAAAAAAAAAEPAAAAA","0.00","3679.83","-2898.27" +"catalog channel","catalog_pageAAAAAAAAAFABAAAA","19046.96","0.00","8598.04" +"catalog channel","catalog_pageAAAAAAAAAFCBAAAA","1198.75","0.00","-4111.59" +"catalog channel","catalog_pageAAAAAAAAAGABAAAA","2600.87","0.00","-2694.00" +"catalog channel","catalog_pageAAAAAAAAAHABAAAA","7900.51","0.00","2836.92" +"catalog channel","catalog_pageAAAAAAAAAHCBAAAA","2059.90","0.00","-116.80" +"catalog channel","catalog_pageAAAAAAAAAICBAAAA","21505.83","0.00","7798.08" +"catalog channel","catalog_pageAAAAAAAAAJCBAAAA","11942.55","0.00","4908.10" +"catalog channel","catalog_pageAAAAAAAAAKPAAAAA","6111.82","0.00","-5263.85" +"catalog channel","catalog_pageAAAAAAAAALPAAAAA","24636.69","0.00","1235.33" +"catalog channel","catalog_pageAAAAAAAAAMPAAAAA","12916.30","0.00","-2168.01" +"catalog channel","catalog_pageAAAAAAAAANBBAAAA","0.00","41.72","-110.06" +"catalog channel","catalog_pageAAAAAAAAANPAAAAA","4649.26","0.00","-2422.18" +"catalog channel","catalog_pageAAAAAAAAAOPAAAAA","20623.11","0.00","-6627.93" +"catalog channel","catalog_pageAAAAAAAAAPCBAAAA","7328.24","0.00","-840.13" +"catalog channel","catalog_pageAAAAAAAAAPPAAAAA","11329.40","0.00","-1437.70" +"catalog channel","catalog_pageAAAAAAAABAABAAAA","14627.47","0.00","1701.56" +"catalog channel","catalog_pageAAAAAAAABBABAAAA","1643.40","0.00","-1355.83" +"catalog channel","catalog_pageAAAAAAAABCABAAAA","1498.20","0.00","-1851.85" +"catalog channel","catalog_pageAAAAAAAABDCBAAAA","11484.94","0.00","-7221.57" +"catalog channel","catalog_pageAAAAAAAABEABAAAA","6853.88","0.00","1465.92" +"catalog channel","catalog_pageAAAAAAAABECBAAAA","3492.71","0.00","817.01" +"catalog channel","catalog_pageAAAAAAAABFABAAAA","1849.51","0.00","-220.59" +"catalog channel","catalog_pageAAAAAAAABFCBAAAA","280.94","0.00","-1016.15" +"catalog channel","catalog_pageAAAAAAAABGABAAAA","1923.86","0.00","-166.64" +"catalog channel","catalog_pageAAAAAAAABGCBAAAA","2490.23","0.00","-1563.99" +"catalog channel","catalog_pageAAAAAAAABHABAAAA","9766.77","0.00","2298.86" +"catalog channel","catalog_pageAAAAAAAABHCBAAAA","1945.62","0.00","141.21" +"catalog channel","catalog_pageAAAAAAAABICBAAAA","16580.06","0.00","-13193.14" +"catalog channel","catalog_pageAAAAAAAABIPAAAAA","0.00","16.33","-126.54" +"catalog channel","catalog_pageAAAAAAAABKPAAAAA","15027.67","0.00","-13977.82" +"catalog channel","catalog_pageAAAAAAAABLPAAAAA","11534.40","63.08","3966.13" +"catalog channel","catalog_pageAAAAAAAABMPAAAAA","1108.42","0.00","-4070.82" +"catalog channel","catalog_pageAAAAAAAABOCBAAAA","8156.04","0.00","2262.16" +"catalog channel","catalog_pageAAAAAAAABOPAAAAA","7011.36","0.00","-11893.40" +"catalog channel","catalog_pageAAAAAAAABPPAAAAA","7885.70","0.00","999.16" +"catalog channel","catalog_pageAAAAAAAACAABAAAA","5169.96","0.00","-5763.98" +"catalog channel","catalog_pageAAAAAAAACBABAAAA","14547.28","0.00","-2667.67" +"catalog channel","catalog_pageAAAAAAAACCABAAAA","12355.51","0.00","1506.90" +"catalog channel","catalog_pageAAAAAAAACDABAAAA","4359.56","0.00","-5260.52" +"catalog channel","catalog_pageAAAAAAAACDCBAAAA","10415.54","0.00","-2439.54" +"catalog channel","catalog_pageAAAAAAAACDPAAAAA","0.00","1402.33","-1325.70" +"catalog channel","catalog_pageAAAAAAAACEABAAAA","661.81","0.00","-329.47" +"catalog channel","catalog_pageAAAAAAAACECBAAAA","1.75","0.00","-84.30" +"catalog channel","catalog_pageAAAAAAAACFABAAAA","3525.95","0.00","-223.51" +"catalog channel","catalog_pageAAAAAAAACFCBAAAA","6005.60","0.00","-4394.01" +"catalog channel","catalog_pageAAAAAAAACGABAAAA","2062.23","0.00","-2986.28" +"catalog channel","catalog_pageAAAAAAAACGCBAAAA","12805.23","0.00","306.65" +"catalog channel","catalog_pageAAAAAAAACHABAAAA","5087.83","0.00","-7094.43" +"catalog channel","catalog_pageAAAAAAAACHCBAAAA","17870.61","0.00","9002.25" +"catalog channel","catalog_pageAAAAAAAACICBAAAA","800.18","0.00","34.65" +"catalog channel","catalog_pageAAAAAAAACKPAAAAA","29964.44","0.00","247.66" +"catalog channel","catalog_pageAAAAAAAACMPAAAAA","9590.19","0.00","630.54" +"catalog channel","catalog_pageAAAAAAAACNPAAAAA","26930.63","0.00","-4904.30" +"catalog channel","catalog_pageAAAAAAAACOPAAAAA","24922.64","0.00","1430.27" +"catalog channel","catalog_pageAAAAAAAACPPAAAAA","9936.50","0.00","-6510.90" +"catalog channel","catalog_pageAAAAAAAADAABAAAA","9551.74","0.00","562.36" +"catalog channel","catalog_pageAAAAAAAADBABAAAA","924.53","0.00","-2770.53" +"catalog channel","catalog_pageAAAAAAAADCABAAAA","347.79","0.00","80.25" +"catalog channel","catalog_pageAAAAAAAADDABAAAA","20303.22","0.00","-4657.56" +"catalog channel","catalog_pageAAAAAAAADDCBAAAA","22001.93","0.00","117.60" +"catalog channel","catalog_pageAAAAAAAADEABAAAA","31934.88","0.00","6004.01" +"catalog channel","catalog_pageAAAAAAAADECBAAAA","8979.60","0.00","5106.85" +"catalog channel","catalog_pageAAAAAAAADEPAAAAA","0.00","4403.81","-4953.87" +"catalog channel","catalog_pageAAAAAAAADFCBAAAA","61.02","0.00","-168.12" +"catalog channel","catalog_pageAAAAAAAADGABAAAA","7119.80","0.00","1579.16" +"catalog channel","catalog_pageAAAAAAAADGCBAAAA","5957.75","0.00","-4127.14" +"catalog channel","catalog_pageAAAAAAAADHABAAAA","8134.58","0.00","-3640.90" +"catalog channel","catalog_pageAAAAAAAADHCBAAAA","10919.29","0.00","2016.69" +"catalog channel","catalog_pageAAAAAAAADHPAAAAA","0.00","1536.00","-1225.45" +"catalog channel","catalog_pageAAAAAAAADICBAAAA","4858.78","0.00","-1875.60" +"catalog channel","catalog_pageAAAAAAAADKPAAAAA","10164.76","0.00","-3140.08" +"catalog channel","catalog_pageAAAAAAAADLPAAAAA","7003.62","0.00","-3181.16" +"catalog channel","catalog_pageAAAAAAAADMCBAAAA","647.10","0.00","-768.90" +"catalog channel","catalog_pageAAAAAAAADMPAAAAA","12780.00","0.00","-3954.48" +"catalog channel","catalog_pageAAAAAAAADNPAAAAA","2991.34","0.00","-753.46" +"catalog channel","catalog_pageAAAAAAAADOPAAAAA","6866.76","2782.31","-1333.76" +"catalog channel","catalog_pageAAAAAAAADPPAAAAA","2515.29","0.00","-3985.53" +"catalog channel","catalog_pageAAAAAAAAEAABAAAA","20127.42","0.00","7401.78" +"catalog channel","catalog_pageAAAAAAAAEBABAAAA","236.88","0.00","117.24" +"catalog channel","catalog_pageAAAAAAAAECABAAAA","295.33","0.00","-583.27" +"catalog channel","catalog_pageAAAAAAAAEDABAAAA","15797.44","757.70","6114.49" +"catalog channel","catalog_pageAAAAAAAAEDCBAAAA","16867.17","0.00","-1198.11" +"catalog channel","catalog_pageAAAAAAAAEDPAAAAA","0.00","744.12","-971.34" +"catalog channel","catalog_pageAAAAAAAAEEABAAAA","3463.00","0.00","69.00" +"catalog channel","catalog_pageAAAAAAAAEFCBAAAA","4182.97","0.00","1407.15" +"catalog channel","catalog_pageAAAAAAAAEGABAAAA","8290.62","0.00","-3776.54" +"catalog channel","catalog_pageAAAAAAAAEGCBAAAA","19809.94","0.00","-2687.29" +"catalog channel","catalog_pageAAAAAAAAEHABAAAA","252.48","0.00","-1514.40" +"catalog channel","catalog_pageAAAAAAAAEHCBAAAA","28252.16","0.00","12970.10" +"catalog channel","catalog_pageAAAAAAAAEICBAAAA","3983.61","0.00","-442.94" +"catalog channel","catalog_pageAAAAAAAAEKCBAAAA","1009.59","0.00","-1972.97" +"catalog channel","catalog_pageAAAAAAAAEKPAAAAA","3952.76","0.00","139.44" +"catalog channel","catalog_pageAAAAAAAAELPAAAAA","4038.84","0.00","-3359.88" +"catalog channel","catalog_pageAAAAAAAAEMCBAAAA","1684.80","0.00","-373.87" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00006.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00006.sql new file mode 100644 index 00000000000..71f608461bb --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00006.sql @@ -0,0 +1,31 @@ +SELECT + "a"."ca_state" "STATE" +, "count"(*) "cnt" +FROM + customer_address a +, customer c +, store_sales s +, date_dim d +, item i +WHERE ("a"."ca_address_sk" = "c"."c_current_addr_sk") + AND ("c"."c_customer_sk" = "s"."ss_customer_sk") + AND ("s"."ss_sold_date_sk" = "d"."d_date_sk") + AND ("s"."ss_item_sk" = "i"."i_item_sk") + AND ("d"."d_month_seq" = ( + SELECT DISTINCT "d_month_seq" + FROM + date_dim + WHERE ("d_year" = 2001) + AND ("d_moy" = 1) + )) + AND ("i"."i_current_price" > (DECIMAL '1.2' * ( + SELECT "avg"("j"."i_current_price") + FROM + item j + WHERE ("j"."i_category" = "i"."i_category") + ))) +GROUP BY "a"."ca_state" +HAVING ("count"(*) >= 10) +ORDER BY "cnt" ASC, "a"."ca_state" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00006.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00006.txt new file mode 100644 index 00000000000..2aa1b9f2728 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00006.txt @@ -0,0 +1 @@ +"TX","10" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00007.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00007.sql new file mode 100644 index 00000000000..c46292a3ce1 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00007.sql @@ -0,0 +1,26 @@ +SELECT + "i_item_id" +, "avg"("ss_quantity") "agg1" +, "avg"("ss_list_price") "agg2" +, "avg"("ss_coupon_amt") "agg3" +, "avg"("ss_sales_price") "agg4" +FROM + store_sales +, customer_demographics +, date_dim +, item +, promotion +WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("ss_cdemo_sk" = "cd_demo_sk") + AND ("ss_promo_sk" = "p_promo_sk") + AND ("cd_gender" = 'M') + AND ("cd_marital_status" = 'S') + AND ("cd_education_status" = 'College') + AND (("p_channel_email" = 'N') + OR ("p_channel_event" = 'N')) + AND ("d_year" = 2000) +GROUP BY "i_item_id" +ORDER BY "i_item_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00007.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00007.txt new file mode 100644 index 00000000000..a3bbb7a81b8 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00007.txt @@ -0,0 +1,100 @@ +"AAAAAAAAAAFAAAAA","71.0","49.34","0.00","35.94" +"AAAAAAAAABEAAAAA","78.5","41.97","0.21","16.70" +"AAAAAAAAABGAAAAA","47.0","4.34","0.00","0.78" +"AAAAAAAAACCAAAAA","56.0","122.37","0.00","83.21" +"AAAAAAAAADFAAAAA","5.0","92.80","0.00","56.60" +"AAAAAAAAADHAAAAA","80.0","122.00","0.00","97.60" +"AAAAAAAAAEEAAAAA","48.0","10.91","0.00","4.55" +"AAAAAAAAAEHAAAAA","93.0","112.05","1313.94","108.68" +"AAAAAAAAAFCAAAAA","21.0","86.70","540.72","85.83" +"AAAAAAAAAFDAAAAA","78.0","167.49","6923.28","88.76" +"AAAAAAAAAGCAAAAA","18.0","48.99","0.00","27.43" +"AAAAAAAAAGFAAAAA","5.0","80.80","0.00","71.10" +"AAAAAAAAAHAAAAAA","46.0","110.85","0.00","11.08" +"AAAAAAAAAIFAAAAA","3.0","100.66","0.00","47.31" +"AAAAAAAAAJEAAAAA","49.0","13.66","0.00","11.61" +"AAAAAAAAAKAAAAAA","43.0","74.92","0.00","8.24" +"AAAAAAAAAKHAAAAA","51.0","25.86","0.00","20.17" +"AAAAAAAAAMCAAAAA","70.0","23.58","0.00","18.15" +"AAAAAAAAAMEAAAAA","3.0","34.78","0.00","4.52" +"AAAAAAAAANBAAAAA","18.0","157.41","0.00","119.63" +"AAAAAAAAANDAAAAA","90.0","117.84","0.00","16.49" +"AAAAAAAAANGAAAAA","57.0","61.10","1367.61","31.16" +"AAAAAAAAANHAAAAA","61.0","101.94","0.00","90.72" +"AAAAAAAABADAAAAA","12.0","170.05","0.00","22.10" +"AAAAAAAABBCAAAAA","55.0","57.32","0.00","26.94" +"AAAAAAAABBFAAAAA","51.0","18.33","0.00","0.73" +"AAAAAAAABCEAAAAA","82.0","137.58","0.00","49.52" +"AAAAAAAABCHAAAAA","8.0","44.95","0.00","25.62" +"AAAAAAAABDDAAAAA","7.0","131.80","0.00","109.39" +"AAAAAAAABECAAAAA","32.0","136.44","0.00","73.67" +"AAAAAAAABFHAAAAA","67.0","81.55","0.00","14.67" +"AAAAAAAABHCAAAAA","76.0","20.63","0.00","20.01" +"AAAAAAAABLEAAAAA","24.0","5.59","0.00","4.36" +"AAAAAAAABNCAAAAA","74.0","49.54","0.00","29.72" +"AAAAAAAABPDAAAAA","64.0","8.85","36.24","3.54" +"AAAAAAAABPGAAAAA","16.0","116.91","0.00","112.23" +"AAAAAAAACAFAAAAA","23.0","78.36","1642.53","76.79" +"AAAAAAAACAGAAAAA","56.0","135.34","557.70","21.65" +"AAAAAAAACBEAAAAA","1.0","53.97","20.88","26.44" +"AAAAAAAACBHAAAAA","61.0","2.83","0.00","1.44" +"AAAAAAAACEBAAAAA","27.0","50.84","0.00","26.94" +"AAAAAAAACEFAAAAA","65.0","102.21","0.00","49.06" +"AAAAAAAACGCAAAAA","40.0","83.30","0.00","56.64" +"AAAAAAAACHHAAAAA","93.0","57.41","575.02","8.03" +"AAAAAAAACJCAAAAA","72.0","110.10","1639.85","83.39" +"AAAAAAAACJFAAAAA","5.0","63.29","0.00","20.88" +"AAAAAAAACJGAAAAA","44.0","92.94","3573.97","88.29" +"AAAAAAAACLDAAAAA","53.5","62.17","0.00","24.86" +"AAAAAAAACLEAAAAA","46.0","103.72","0.00","58.08" +"AAAAAAAACNFAAAAA","48.0","63.48","670.32","55.86" +"AAAAAAAACOAAAAAA","64.0","39.68","0.00","6.74" +"AAAAAAAADAEAAAAA","17.0","17.95","0.00","0.35" +"AAAAAAAADBDAAAAA","68.33333333333333","60.57","242.52","44.02" +"AAAAAAAADEDAAAAA","21.0","113.11","0.00","66.73" +"AAAAAAAADGHAAAAA","58.0","130.70","0.00","36.59" +"AAAAAAAADJBAAAAA","74.0","99.33","0.00","54.63" +"AAAAAAAADKAAAAAA","9.0","79.71","0.00","31.08" +"AAAAAAAADMBAAAAA","6.0","49.85","0.00","17.44" +"AAAAAAAADMHAAAAA","64.0","108.76","0.00","14.13" +"AAAAAAAAEABAAAAA","41.0","123.92","704.12","40.89" +"AAAAAAAAEAEAAAAA","16.0","147.86","0.00","143.42" +"AAAAAAAAEAGAAAAA","16.0","86.83","0.00","6.07" +"AAAAAAAAEBFAAAAA","8.0","140.25","0.00","51.89" +"AAAAAAAAEBGAAAAA","14.0","34.94","0.00","14.67" +"AAAAAAAAECHAAAAA","28.0","132.63","0.00","45.09" +"AAAAAAAAEDDAAAAA","55.0","141.45","0.00","48.09" +"AAAAAAAAEEAAAAAA","15.0","133.73","0.00","13.37" +"AAAAAAAAEEFAAAAA","10.0","84.82","0.00","71.24" +"AAAAAAAAEGBAAAAA","32.0","87.35","0.00","38.43" +"AAAAAAAAEGDAAAAA","63.0","30.71","0.00","28.86" +"AAAAAAAAEGHAAAAA","31.0","131.76","0.00","96.18" +"AAAAAAAAEIBAAAAA","80.0","71.67","0.00","5.01" +"AAAAAAAAEJDAAAAA","49.0","41.72","0.00","10.01" +"AAAAAAAAEJGAAAAA","65.0","82.21","0.00","55.08" +"AAAAAAAAEKDAAAAA","6.0","129.78","0.00","23.36" +"AAAAAAAAEKFAAAAA","63.0","18.40","139.10","13.80" +"AAAAAAAAELBAAAAA","10.0","80.85","0.00","31.53" +"AAAAAAAAELHAAAAA","56.0","89.33","1500.57","44.66" +"AAAAAAAAEMAAAAAA","70.0","114.70","51.38","73.40" +"AAAAAAAAEMGAAAAA","78.0","119.31","0.00","57.26" +"AAAAAAAAENAAAAAA","75.0","137.82","0.00","88.20" +"AAAAAAAAENFAAAAA","97.0","73.09","733.53","33.59" +"AAAAAAAAENGAAAAA","36.0","21.38","0.00","4.91" +"AAAAAAAAEOBAAAAA","14.0","171.45","735.88","125.15" +"AAAAAAAAEPAAAAAA","","","0.00","53.85" +"AAAAAAAAEPEAAAAA","82.0","43.75","0.00","22.31" +"AAAAAAAAFACAAAAA","86.0","122.59","0.00","91.94" +"AAAAAAAAFAFAAAAA","73.0","193.68","0.00","187.86" +"AAAAAAAAFDFAAAAA","84.0","56.59","0.00","27.72" +"AAAAAAAAFHEAAAAA","62.0","76.29","0.00","76.29" +"AAAAAAAAFIAAAAAA","83.0","26.81","0.00","10.99" +"AAAAAAAAFJCAAAAA","93.0","24.82","0.00","4.96" +"AAAAAAAAFKHAAAAA","51.0","85.14","315.87","11.06" +"AAAAAAAAFMCAAAAA","85.0","38.96","0.00","34.28" +"AAAAAAAAFMFAAAAA","64.0","11.27","596.42","10.59" +"AAAAAAAAFNBAAAAA","79.0","135.06","0.00","43.21" +"AAAAAAAAGAFAAAAA","100.0","46.03","2301.74","28.07" +"AAAAAAAAGBBAAAAA","94.0","18.33","369.06","5.86" +"AAAAAAAAGBDAAAAA","37.0","51.90","0.00","26.46" +"AAAAAAAAGBHAAAAA","96.0","101.54","0.00","99.50" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00009.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00009.sql new file mode 100644 index 00000000000..30b476a7a82 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00009.sql @@ -0,0 +1,85 @@ +SELECT + (CASE WHEN (( + SELECT "count"(*) + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 1 AND 20) + ) > 74129) THEN ( + SELECT "avg"("ss_ext_discount_amt") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 1 AND 20) +) ELSE ( + SELECT "avg"("ss_net_paid") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 1 AND 20) +) END) "bucket1" +, (CASE WHEN (( + SELECT "count"(*) + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 21 AND 40) + ) > 122840) THEN ( + SELECT "avg"("ss_ext_discount_amt") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 21 AND 40) +) ELSE ( + SELECT "avg"("ss_net_paid") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 21 AND 40) +) END) "bucket2" +, (CASE WHEN (( + SELECT "count"(*) + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 41 AND 60) + ) > 56580) THEN ( + SELECT "avg"("ss_ext_discount_amt") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 41 AND 60) +) ELSE ( + SELECT "avg"("ss_net_paid") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 41 AND 60) +) END) "bucket3" +, (CASE WHEN (( + SELECT "count"(*) + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 61 AND 80) + ) > 10097) THEN ( + SELECT "avg"("ss_ext_discount_amt") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 61 AND 80) +) ELSE ( + SELECT "avg"("ss_net_paid") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 61 AND 80) +) END) "bucket4" +, (CASE WHEN (( + SELECT "count"(*) + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 81 AND 100) + ) > 165306) THEN ( + SELECT "avg"("ss_ext_discount_amt") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 81 AND 100) +) ELSE ( + SELECT "avg"("ss_net_paid") + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 81 AND 100) +) END) "bucket5" +FROM + reason +WHERE ("r_reason_sk" = 1) +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00009.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00009.txt new file mode 100644 index 00000000000..405b8e2d408 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00009.txt @@ -0,0 +1 @@ +"357.51","1022.51","1733.56","262.32","3077.37" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00011.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00011.sql new file mode 100644 index 00000000000..4f8cfcafe1b --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00011.sql @@ -0,0 +1,68 @@ +WITH + year_total AS ( + SELECT + "c_customer_id" "customer_id" + , "c_first_name" "customer_first_name" + , "c_last_name" "customer_last_name" + , "c_preferred_cust_flag" "customer_preferred_cust_flag" + , "c_birth_country" "customer_birth_country" + , "c_login" "customer_login" + , "c_email_address" "customer_email_address" + , "d_year" "dyear" + , "sum"(("ss_ext_list_price" - "ss_ext_discount_amt")) "year_total" + , 's' "sale_type" + FROM + customer + , store_sales + , date_dim + WHERE ("c_customer_sk" = "ss_customer_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + GROUP BY "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", "c_email_address", "d_year" +UNION ALL SELECT + "c_customer_id" "customer_id" + , "c_first_name" "customer_first_name" + , "c_last_name" "customer_last_name" + , "c_preferred_cust_flag" "customer_preferred_cust_flag" + , "c_birth_country" "customer_birth_country" + , "c_login" "customer_login" + , "c_email_address" "customer_email_address" + , "d_year" "dyear" + , "sum"(("ws_ext_list_price" - "ws_ext_discount_amt")) "year_total" + , 'w' "sale_type" + FROM + customer + , web_sales + , date_dim + WHERE ("c_customer_sk" = "ws_bill_customer_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + GROUP BY "c_customer_id", "c_first_name", "c_last_name", "c_preferred_cust_flag", "c_birth_country", "c_login", "c_email_address", "d_year" +) +SELECT + "t_s_secyear"."customer_id" +, "t_s_secyear"."customer_first_name" +, "t_s_secyear"."customer_last_name" +, "t_s_secyear"."customer_preferred_cust_flag" +, "t_s_secyear"."customer_birth_country" +, "t_s_secyear"."customer_login" +FROM + year_total t_s_firstyear +, year_total t_s_secyear +, year_total t_w_firstyear +, year_total t_w_secyear +WHERE ("t_s_secyear"."customer_id" = "t_s_firstyear"."customer_id") + AND ("t_s_firstyear"."customer_id" = "t_w_secyear"."customer_id") + AND ("t_s_firstyear"."customer_id" = "t_w_firstyear"."customer_id") + AND ("t_s_firstyear"."sale_type" = 's') + AND ("t_w_firstyear"."sale_type" = 'w') + AND ("t_s_secyear"."sale_type" = 's') + AND ("t_w_secyear"."sale_type" = 'w') + AND ("t_s_firstyear"."dyear" = 2001) + AND ("t_s_secyear"."dyear" = (2001 + 1)) + AND ("t_w_firstyear"."dyear" = 2001) + AND ("t_w_secyear"."dyear" = (2001 + 1)) + AND ("t_s_firstyear"."year_total" > 0) + AND ("t_w_firstyear"."year_total" > 0) + AND ((CASE WHEN ("t_w_firstyear"."year_total" > 0) THEN ("t_w_secyear"."year_total" / "t_w_firstyear"."year_total") ELSE DECIMAL '0.0' END) > (CASE WHEN ("t_s_firstyear"."year_total" > 0) THEN ("t_s_secyear"."year_total" / "t_s_firstyear"."year_total") ELSE DECIMAL '0.0' END)) +ORDER BY "t_s_secyear"."customer_id" ASC, "t_s_secyear"."customer_first_name" ASC, "t_s_secyear"."customer_last_name" ASC, "t_s_secyear"."customer_preferred_cust_flag" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00011.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00011.txt new file mode 100644 index 00000000000..b34e35827f8 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00011.txt @@ -0,0 +1,9 @@ +"AAAAAAAABMDAAAAA","Jose ","Guzman ","N","MARSHALL ISLANDS","" +"AAAAAAAAFLAAAAAA","Joseph ","Riley ","N","BELIZE","" +"AAAAAAAAFNCAAAAA","Jennifer ","Fitzpatrick ","N","UNITED ARAB EMIRATES","" +"AAAAAAAAJCAAAAAA","Maxine ","Carlson ","N","ISLE OF MAN","" +"AAAAAAAAJGBAAAAA","Bonnie ","Harrison ","Y","EL SALVADOR","" +"AAAAAAAAKMDAAAAA","Alexander ","White ","N","FRANCE","" +"AAAAAAAAOFCAAAAA","Timothy ","Grogan ","Y","SPAIN","" +"AAAAAAAAPCBAAAAA","Luz ","Ransom ","N","ANDORRA","" +"AAAAAAAAPDDAAAAA","Reginald ","Garcia ","N","HONDURAS","" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00012.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00012.sql new file mode 100644 index 00000000000..e2a834b3a12 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00012.sql @@ -0,0 +1,20 @@ +SELECT + "i_item_id" +, "i_item_desc" +, "i_category" +, "i_class" +, "i_current_price" +, "sum"("ws_ext_sales_price") "itemrevenue" +, (("sum"("ws_ext_sales_price") * 100) / "sum"("sum"("ws_ext_sales_price"+0.000001)) OVER (PARTITION BY "i_class")) "revenueratio" +FROM + web_sales +, item +, date_dim +WHERE ("ws_item_sk" = "i_item_sk") + AND ("i_category" IN ('Sports', 'Books', 'Home')) + AND ("ws_sold_date_sk" = "d_date_sk") + AND (CAST("d_date" AS DATE) BETWEEN CAST('1999-02-22' AS DATE) AND (CAST('1999-02-22' AS DATE) + INTERVAL '30' DAY)) +GROUP BY "i_item_id", "i_item_desc", "i_category", "i_class", "i_current_price" +ORDER BY "i_category" ASC, "i_class" ASC, "i_item_id" ASC, "i_item_desc" ASC, "revenueratio" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00012.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00012.txt new file mode 100644 index 00000000000..e8fb0cd8464 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00012.txt @@ -0,0 +1,33 @@ +"AAAAAAAAKGBAAAAA","Light moments cannot date following sy","Books ","arts ","5.60","7915.50","100.000000" +"AAAAAAAAHDDAAAAA","Remote, japanese things would not need at all","Books ","fiction ","45.99","1027.26","100.000000" +"AAAAAAAACIBAAAAA","Surely specific clubs must remember necessary, big duties. There final words learn practically standard lands. Private, clear companies must see","Books ","history ","4.94","78.28","99.999999" +"AAAAAAAAPNGAAAAA","Unusually small programmes would lift recently social, small workshops. Offices s","Books ","home repair ","1.73","6276.69","100.000000" +"AAAAAAAACLBAAAAA","Common, logical babies must take somehow general months. Costs drag. Big, british areas give dramatic, effective clot","Books ","mystery ","3.00","0.00","0.000000" +"AAAAAAAAJDHAAAAA","Continued ideas reflect only still other prices. Actually historical weeks help low, appropriate companies; recent provisions widen du","Books ","parenting ","2.16","589.12","8.505920" +"AAAAAAAANMAAAAAA","Over wide attacks agree i","Books ","parenting ","7.30","2170.80","31.342766" +"AAAAAAAAPMHAAAAA","Right social years would fit indirectly creatures. Very suspicious words should not write particular, typical views. Rarely evident hours wish more lucky others. So racial loans imitate a","Books ","parenting ","6.39","4166.08","60.151314" +"AAAAAAAAHMGAAAAA","Words bear international, expected countries. Apparent, misleading years get ever rich grounds. Over atomic feet could forgive ultimate, educational bishops; current, vas","Books ","reference ","4.95","5225.60","81.912632" +"AAAAAAAALIDAAAAA","Largely substantial contracts facilitate. Yet full values can advise extremely plants. Men classify empty contacts. Private, common events can want more just central patients. Enti","Books ","reference ","1.55","1153.88","18.087368" +"AAAAAAAACDFAAAAA","Asleep, philos","Books ","science ","4.18","1795.05","100.000000" +"AAAAAAAAHHCAAAAA","Old, cultural workers ought to take both now everyday budgets. Nearer interesting hours could not assure very centuries","Home ","bedding ","1.65","1047.88","98.402652" +"AAAAAAAAMDFAAAAA","Black, old things prove. Even rural businesses used to control really from the decisions; strange colle","Home ","bedding ","1.79","17.01","1.597348" +"AAAAAAAAAGEAAAAA","Foreign conditions could not think scientists. Big, applicable jobs could not perform social, high profits. Even young orde","Home ","curtains/drapes ","7.02","4524.96","60.462431" +"AAAAAAAAAIAAAAAA","Wrong limits could not accompany now perhaps lonely customers. Anxious, neighbouring principles might arise molecules. Useful, short nerves think advantages. Angry, parental prices fly t","Home ","curtains/drapes ","4.06","2934.00","39.204053" +"AAAAAAAAGKDAAAAA","More expensive men used to become most current offices. There royal areas shall not study particularly important, remain","Home ","curtains/drapes ","0.46","24.96","0.333515" +"AAAAAAAAMOFAAAAA","Political shares become then firmly english men. Hardly young police ","Home ","decor ","1.89","544.30","100.000000" +"AAAAAAAAANDAAAAA","Beautiful areas know ever actually chief patterns. International, simple feelings like in a russians. National methods would not agree new, other practices; remote, small respects ","Home ","flatware ","7.13","803.60","100.000000" +"AAAAAAAADHAAAAAA","Enough apparent elements reverse actu","Home ","furniture ","2.68","2138.67","64.860463" +"AAAAAAAAMOCAAAAA","Weeks will claim at a hands. Cuts meet smart, relevant lawyers. Enormous sides should ","Home ","furniture ","23.89","1158.67","35.139537" +"AAAAAAAAHOEAAAAA","Main, aware rights will not escape under the systems. Circumstances must introduce just as a children. Publ","Home ","lighting ","1.46","59.95","15.326601" +"AAAAAAAAOJAAAAAA","General personnel should take by the pictures; personal, ol","Home ","lighting ","9.17","331.20","84.673399" +"AAAAAAAANAGAAAAA","Managers may not come slightly possible occasions; naked, organisational goods could pull. Things put much little, experimental mistakes. Healthy, cruel hours acknowledge red doubts. Citie","Home ","paint ","7.24","496.93","100.000000" +"AAAAAAAAMNGAAAAA","Nice organs exceed apart sure areas. Adult, islamic christians identify then with a countries. Happ","Sports ","archery ","4.80","510.08","100.000000" +"AAAAAAAAOFGAAAAA","Main, agricultural issues mature usually terms. Powers return units. Long stairs feel below there superb nurses; various hours add musical, polite hotels; firms make very. As other defences may s","Sports ","athletic shoes ","2.14","7044.14","100.000000" +"AAAAAAAAAAHAAAAA","Likely doctors give most. Awful problems att","Sports ","basketball ","2.16","294.86","100.000000" +"AAAAAAAAKFFAAAAA","Full-time, lovely miles employ home. Regular assets may not protect much for the relationships. So good guidelines may care small figures. Financial, happy parents call also much real op","Sports ","camping ","51.70","8958.60","100.000000" +"AAAAAAAANOEAAAAA","Mean, recent sequences throw separate, other eyes. Sudden, cold roots take just general relations. Advantages could meet. Then annual page","Sports ","football ","4.83","810.05","100.000000" +"AAAAAAAABIHAAAAA","Profitable documents would apply now. Literary, nuclear magazines might run general, proposed details. C","Sports ","golf ","4.18","2757.30","100.000000" +"AAAAAAAADFFAAAAA","Necessary, social bedrooms think so full poles; babies prove now. Profitable payments used to break there. Major, radical households ","Sports ","optics ","1.51","10585.16","100.000000" +"AAAAAAAAAKHAAAAA","Key names make somewhere. Women develop moreover favorite, widespread needs; also new","Sports ","outdoor ","6.76","4112.82","100.000000" +"AAAAAAAAEKGAAAAA","Good, dependent houses can prevent different eyes. Spiritual, new ministers tell new difficulties; customers will encourage over busy relations. Modern, substantial far","Sports ","sailing ","1.58","9856.14","100.000000" +"AAAAAAAAALCAAAAA","Now new goods get outstanding, surprising changes; almost new advertisements pay successful, concerned member","Sports ","tennis ","2.87","188.18","99.999999" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00013.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00013.sql new file mode 100644 index 00000000000..02e05403f9a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00013.sql @@ -0,0 +1,46 @@ +SELECT + "avg"("ss_quantity") +, "avg"("ss_ext_sales_price") +, "avg"("ss_ext_wholesale_cost") +, "sum"("ss_ext_wholesale_cost") +FROM + store_sales +, store +, customer_demographics +, household_demographics +, customer_address +, date_dim +WHERE ("s_store_sk" = "ss_store_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ((("ss_hdemo_sk" = "hd_demo_sk") + AND ("cd_demo_sk" = "ss_cdemo_sk") + AND ("cd_marital_status" = 'M') + AND ("cd_education_status" = 'Advanced Degree') + AND ("ss_sales_price" BETWEEN DECIMAL '100.00' AND DECIMAL '150.00') + AND ("hd_dep_count" = 3)) + OR (("ss_hdemo_sk" = "hd_demo_sk") + AND ("cd_demo_sk" = "ss_cdemo_sk") + AND ("cd_marital_status" = 'S') + AND ("cd_education_status" = 'College') + AND ("ss_sales_price" BETWEEN DECIMAL '50.00' AND DECIMAL '100.00') + AND ("hd_dep_count" = 1)) + OR (("ss_hdemo_sk" = "hd_demo_sk") + AND ("cd_demo_sk" = "ss_cdemo_sk") + AND ("cd_marital_status" = 'W') + AND ("cd_education_status" = '2 yr Degree') + AND ("ss_sales_price" BETWEEN DECIMAL '150.00' AND DECIMAL '200.00') + AND ("hd_dep_count" = 1))) + AND ((("ss_addr_sk" = "ca_address_sk") + AND ("ca_country" = 'United States') + AND ("ca_state" IN ('TX' , 'OH' , 'TX')) + AND ("ss_net_profit" BETWEEN 100 AND 200)) + OR (("ss_addr_sk" = "ca_address_sk") + AND ("ca_country" = 'United States') + AND ("ca_state" IN ('OR' , 'NM' , 'KY')) + AND ("ss_net_profit" BETWEEN 150 AND 300)) + OR (("ss_addr_sk" = "ca_address_sk") + AND ("ca_country" = 'United States') + AND ("ca_state" IN ('VA' , 'TX' , 'MS')) + AND ("ss_net_profit" BETWEEN 50 AND 250))) +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00013.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00013.txt new file mode 100644 index 00000000000..faabed90b93 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00013.txt @@ -0,0 +1 @@ +"55.0","3582.70","3466.65","3466.65" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00014.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00014.sql new file mode 100644 index 00000000000..cb67ada847d --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00014.sql @@ -0,0 +1,166 @@ +WITH + cross_items AS ( + SELECT "i_item_sk" "ss_item_sk" + FROM + item + , ( + SELECT + "iss"."i_brand_id" "brand_id" + , "iss"."i_class_id" "class_id" + , "iss"."i_category_id" "category_id" + FROM + store_sales + , item iss + , date_dim d1 + WHERE ("ss_item_sk" = "iss"."i_item_sk") + AND ("ss_sold_date_sk" = "d1"."d_date_sk") + AND ("d1"."d_year" BETWEEN 1999 AND (1999 + 2)) +INTERSECT SELECT + "ics"."i_brand_id" + , "ics"."i_class_id" + , "ics"."i_category_id" + FROM + catalog_sales + , item ics + , date_dim d2 + WHERE ("cs_item_sk" = "ics"."i_item_sk") + AND ("cs_sold_date_sk" = "d2"."d_date_sk") + AND ("d2"."d_year" BETWEEN 1999 AND (1999 + 2)) +INTERSECT SELECT + "iws"."i_brand_id" + , "iws"."i_class_id" + , "iws"."i_category_id" + FROM + web_sales + , item iws + , date_dim d3 + WHERE ("ws_item_sk" = "iws"."i_item_sk") + AND ("ws_sold_date_sk" = "d3"."d_date_sk") + AND ("d3"."d_year" BETWEEN 1999 AND (1999 + 2)) + ) + WHERE ("i_brand_id" = "brand_id") + AND ("i_class_id" = "class_id") + AND ("i_category_id" = "category_id") +) +, avg_sales AS ( + SELECT "avg"(("quantity" * "list_price")) "average_sales" + FROM + ( + SELECT + "ss_quantity" "quantity" + , "ss_list_price" "list_price" + FROM + store_sales + , date_dim + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" BETWEEN 1999 AND (1999 + 2)) +UNION ALL SELECT + "cs_quantity" "quantity" + , "cs_list_price" "list_price" + FROM + catalog_sales + , date_dim + WHERE ("cs_sold_date_sk" = "d_date_sk") + AND ("d_year" BETWEEN 1999 AND (1999 + 2)) +UNION ALL SELECT + "ws_quantity" "quantity" + , "ws_list_price" "list_price" + FROM + web_sales + , date_dim + WHERE ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" BETWEEN 1999 AND (1999 + 2)) + ) x +) +SELECT + "channel" +, "i_brand_id" +, "i_class_id" +, "i_category_id" +, "sum"("sales") +, "sum"("number_sales") +FROM + ( + SELECT + 'store' "channel" + , "i_brand_id" + , "i_class_id" + , "i_category_id" + , "sum"(("ss_quantity" * "ss_list_price")) "sales" + , "count"(*) "number_sales" + FROM + store_sales + , item + , date_dim + WHERE ("ss_item_sk" IN ( + SELECT "ss_item_sk" + FROM + cross_items + )) + AND ("ss_item_sk" = "i_item_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = (1999 + 2)) + AND ("d_moy" = 11) + GROUP BY "i_brand_id", "i_class_id", "i_category_id" + HAVING ("sum"(("ss_quantity" * "ss_list_price")) > ( + SELECT "average_sales" + FROM + avg_sales + )) +UNION ALL SELECT + 'catalog' "channel" + , "i_brand_id" + , "i_class_id" + , "i_category_id" + , "sum"(("cs_quantity" * "cs_list_price")) "sales" + , "count"(*) "number_sales" + FROM + catalog_sales + , item + , date_dim + WHERE ("cs_item_sk" IN ( + SELECT "ss_item_sk" + FROM + cross_items + )) + AND ("cs_item_sk" = "i_item_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("d_year" = (1999 + 2)) + AND ("d_moy" = 11) + GROUP BY "i_brand_id", "i_class_id", "i_category_id" + HAVING ("sum"(("cs_quantity" * "cs_list_price")) > ( + SELECT "average_sales" + FROM + avg_sales + )) +UNION ALL SELECT + 'web' "channel" + , "i_brand_id" + , "i_class_id" + , "i_category_id" + , "sum"(("ws_quantity" * "ws_list_price")) "sales" + , "count"(*) "number_sales" + FROM + web_sales + , item + , date_dim + WHERE ("ws_item_sk" IN ( + SELECT "ss_item_sk" + FROM + cross_items + )) + AND ("ws_item_sk" = "i_item_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" = (1999 + 2)) + AND ("d_moy" = 11) + GROUP BY "i_brand_id", "i_class_id", "i_category_id" + HAVING ("sum"(("ws_quantity" * "ws_list_price")) > ( + SELECT "average_sales" + FROM + avg_sales + )) +) y +GROUP BY ROLLUP (channel, i_brand_id, i_class_id, i_category_id) +ORDER BY "channel" ASC, "i_brand_id" ASC, "i_class_id" ASC, "i_category_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00014.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00014.txt new file mode 100644 index 00000000000..a5422ce4360 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00014.txt @@ -0,0 +1,100 @@ +"catalog","1001001","1","5","24855.29","3" +"catalog","1001001","1","","24855.29","3" +"catalog","1001001","2","2","14819.17","3" +"catalog","1001001","2","","14819.17","3" +"catalog","1001001","3","2","30974.65","6" +"catalog","1001001","3","5","4674.00","1" +"catalog","1001001","3","","35648.65","7" +"catalog","1001001","7","7","5462.35","4" +"catalog","1001001","7","","5462.35","4" +"catalog","1001001","","","80785.46","17" +"catalog","1001002","1","1","155319.40","40" +"catalog","1001002","1","","155319.40","40" +"catalog","1001002","5","1","13269.46","4" +"catalog","1001002","5","","13269.46","4" +"catalog","1001002","8","1","9996.30","2" +"catalog","1001002","8","","9996.30","2" +"catalog","1001002","","","178585.16","46" +"catalog","1002001","1","2","13845.89","5" +"catalog","1002001","1","9","13353.60","1" +"catalog","1002001","1","","27199.49","6" +"catalog","1002001","2","5","16192.92","3" +"catalog","1002001","2","6","38261.66","8" +"catalog","1002001","2","","54454.58","11" +"catalog","1002001","4","5","23862.46","6" +"catalog","1002001","4","9","12308.04","3" +"catalog","1002001","4","","36170.50","9" +"catalog","1002001","","","117824.57","26" +"catalog","1002002","1","1","9521.79","3" +"catalog","1002002","1","","9521.79","3" +"catalog","1002002","2","1","325770.37","46" +"catalog","1002002","2","","325770.37","46" +"catalog","1002002","3","1","15726.31","6" +"catalog","1002002","3","","15726.31","6" +"catalog","1002002","5","1","5063.40","1" +"catalog","1002002","5","","5063.40","1" +"catalog","1002002","9","1","8857.93","3" +"catalog","1002002","9","","8857.93","3" +"catalog","1002002","","","364939.80","59" +"catalog","1003001","3","1","9353.44","1" +"catalog","1003001","3","4","28949.22","7" +"catalog","1003001","3","","38302.66","8" +"catalog","1003001","7","6","13884.97","2" +"catalog","1003001","7","","13884.97","2" +"catalog","1003001","11","8","24198.10","3" +"catalog","1003001","11","9","24451.31","7" +"catalog","1003001","11","","48649.41","10" +"catalog","1003001","","","100837.04","20" +"catalog","1003002","3","1","192184.02","35" +"catalog","1003002","3","","192184.02","35" +"catalog","1003002","9","1","86237.04","12" +"catalog","1003002","9","","86237.04","12" +"catalog","1003002","","","278421.06","47" +"catalog","1004001","3","3","20119.86","6" +"catalog","1004001","3","5","23375.25","4" +"catalog","1004001","3","","43495.11","10" +"catalog","1004001","4","2","13468.32","1" +"catalog","1004001","4","3","21393.38","3" +"catalog","1004001","4","4","32960.60","8" +"catalog","1004001","4","9","14220.09","3" +"catalog","1004001","4","","82042.39","15" +"catalog","1004001","13","9","32337.03","4" +"catalog","1004001","13","","32337.03","4" +"catalog","1004001","16","9","18406.23","5" +"catalog","1004001","16","","18406.23","5" +"catalog","1004001","","","176280.76","34" +"catalog","1004002","3","1","16773.37","5" +"catalog","1004002","3","","16773.37","5" +"catalog","1004002","4","1","137062.94","32" +"catalog","1004002","4","","137062.94","32" +"catalog","1004002","5","1","4719.25","3" +"catalog","1004002","5","","4719.25","3" +"catalog","1004002","","","158555.56","40" +"catalog","2001001","1","4","42017.63","5" +"catalog","2001001","1","8","10271.87","1" +"catalog","2001001","1","9","7459.68","3" +"catalog","2001001","1","","59749.18","9" +"catalog","2001001","4","3","17901.48","4" +"catalog","2001001","4","","17901.48","4" +"catalog","2001001","","","77650.66","13" +"catalog","2001002","1","2","153377.52","33" +"catalog","2001002","1","","153377.52","33" +"catalog","2001002","2","2","9622.32","2" +"catalog","2001002","2","","9622.32","2" +"catalog","2001002","3","2","31646.80","5" +"catalog","2001002","3","","31646.80","5" +"catalog","2001002","","","194646.64","40" +"catalog","2002001","1","5","19734.85","3" +"catalog","2002001","1","","19734.85","3" +"catalog","2002001","2","2","31618.27","7" +"catalog","2002001","2","6","23886.32","3" +"catalog","2002001","2","7","9696.19","2" +"catalog","2002001","2","10","11657.62","2" +"catalog","2002001","2","","76858.40","14" +"catalog","2002001","4","5","11959.92","1" +"catalog","2002001","4","","11959.92","1" +"catalog","2002001","12","8","22556.63","6" +"catalog","2002001","12","","22556.63","6" +"catalog","2002001","","","131109.80","24" +"catalog","2002002","2","2","210509.96","40" +"catalog","2002002","2","","210509.96","40" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00015.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00015.sql new file mode 100644 index 00000000000..c0a9d9a2815 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00015.sql @@ -0,0 +1,20 @@ +SELECT + "ca_zip" +, "sum"("cs_sales_price") +FROM + catalog_sales +, customer +, customer_address +, date_dim +WHERE ("cs_bill_customer_sk" = "c_customer_sk") + AND ("c_current_addr_sk" = "ca_address_sk") + AND (("substr"("ca_zip", 1, 5) IN ('85669' , '86197' , '88274' , '83405' , '86475' , '85392' , '85460' , '80348' , '81792')) + OR ("ca_state" IN ('CA' , 'WA' , 'GA')) + OR ("cs_sales_price" > 500)) + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("d_qoy" = 2) + AND ("d_year" = 2001) +GROUP BY "ca_zip" +ORDER BY "ca_zip" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00015.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00015.txt new file mode 100644 index 00000000000..86edd3aa793 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00015.txt @@ -0,0 +1,27 @@ +"30059 ","581.35" +"30399 ","1175.80" +"30411 ","1307.33" +"30534 ","244.73" +"32293 ","731.64" +"33394 ","196.27" +"34136 ","1118.87" +"36060 ","378.46" +"36557 ","483.62" +"36787 ","405.22" +"36909 ","177.12" +"38252 ","151.86" +"38371 ","140.39" +"39145 ","1156.56" +"91675 ","93.62" +"91757 ","132.03" +"91904 ","528.95" +"92724 ","685.95" +"94642 ","636.63" +"95817 ","451.11" +"96192 ","158.77" +"96871 ","251.25" +"98059 ","469.63" +"98482 ","207.65" +"98579 ","617.14" +"99532 ","634.89" +"","481.17" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00016.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00016.sql new file mode 100644 index 00000000000..543df2c21bc --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00016.sql @@ -0,0 +1,31 @@ +SELECT + "count"(DISTINCT "cs_order_number") "order count" +, "sum"("cs_ext_ship_cost") "total shipping cost" +, "sum"("cs_net_profit") "total net profit" +FROM + catalog_sales cs1 +, date_dim +, customer_address +, call_center +WHERE ("d_date" BETWEEN CAST('2002-2-01' AS DATE) AND (CAST('2002-2-01' AS DATE) + INTERVAL '60' DAY)) + AND ("cs1"."cs_ship_date_sk" = "d_date_sk") + AND ("cs1"."cs_ship_addr_sk" = "ca_address_sk") + AND ("ca_state" = 'GA') + AND ("cs1"."cs_call_center_sk" = "cc_call_center_sk") + AND ("cc_county" IN ('Williamson County', 'Williamson County', 'Williamson County', 'Williamson County', 'Williamson County')) + AND (EXISTS ( + SELECT * + FROM + catalog_sales cs2 + WHERE ("cs1"."cs_order_number" = "cs2"."cs_order_number") + AND ("cs1"."cs_warehouse_sk" <> "cs2"."cs_warehouse_sk") +)) + AND (NOT (EXISTS ( + SELECT * + FROM + catalog_returns cr1 + WHERE ("cs1"."cs_order_number" = "cr1"."cr_order_number") +))) +ORDER BY "count"(DISTINCT "cs_order_number") ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00016.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00016.txt new file mode 100644 index 00000000000..8afe38954de --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00016.txt @@ -0,0 +1 @@ +"0","","" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00017.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00017.sql new file mode 100644 index 00000000000..45c61f77343 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00017.sql @@ -0,0 +1,42 @@ +SELECT + "i_item_id" +, "i_item_desc" +, "s_state" +, "count"("ss_quantity") "store_sales_quantitycount" +, "avg"("ss_quantity") "store_sales_quantityave" +, "stddev_samp"("ss_quantity") "store_sales_quantitystdev" +, ("stddev_samp"("ss_quantity") / "avg"("ss_quantity")) "store_sales_quantitycov" +, "count"("sr_return_quantity") "store_returns_quantitycount" +, "avg"("sr_return_quantity") "store_returns_quantityave" +, "stddev_samp"("sr_return_quantity") "store_returns_quantitystdev" +, ("stddev_samp"("sr_return_quantity") / "avg"("sr_return_quantity")) "store_returns_quantitycov" +, "count"("cs_quantity") "catalog_sales_quantitycount" +, "avg"("cs_quantity") "catalog_sales_quantityave" +, "stddev_samp"("cs_quantity") "catalog_sales_quantitystdev" +, ("stddev_samp"("cs_quantity") / "avg"("cs_quantity")) "catalog_sales_quantitycov" +FROM + store_sales +, store_returns +, catalog_sales +, date_dim d1 +, date_dim d2 +, date_dim d3 +, store +, item +WHERE ("d1"."d_quarter_name" = '2001Q1') + AND ("d1"."d_date_sk" = "ss_sold_date_sk") + AND ("i_item_sk" = "ss_item_sk") + AND ("s_store_sk" = "ss_store_sk") + AND ("ss_customer_sk" = "sr_customer_sk") + AND ("ss_item_sk" = "sr_item_sk") + AND ("ss_ticket_number" = "sr_ticket_number") + AND ("sr_returned_date_sk" = "d2"."d_date_sk") + AND ("d2"."d_quarter_name" IN ('2001Q1', '2001Q2', '2001Q3')) + AND ("sr_customer_sk" = "cs_bill_customer_sk") + AND ("sr_item_sk" = "cs_item_sk") + AND ("cs_sold_date_sk" = "d3"."d_date_sk") + AND ("d3"."d_quarter_name" IN ('2001Q1', '2001Q2', '2001Q3')) +GROUP BY "i_item_id", "i_item_desc", "s_state" +ORDER BY "i_item_id" ASC, "i_item_desc" ASC, "s_state" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00017.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00017.txt new file mode 100644 index 00000000000..2d5c4b7ba3e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00017.txt @@ -0,0 +1,5 @@ +"AAAAAAAAJDBAAAAA","Schools check by a machines. Main units will involve hands. All large orders will not date so findings. Strongly brilliant roots reduce. Members bring behind a services. Surprisingly econom","TN","1","4.0","","","1","4.0","","","1","6.0","","" +"AAAAAAAAJHDAAAAA","Available, lucky groups spread entirely always similar societies; things shall not get at a hours. So closed birds can turn","TN","1","97.0","","","1","33.0","","","1","45.0","","" +"AAAAAAAALEEAAAAA","Terms cannot enc","TN","1","56.0","","","1","21.0","","","1","3.0","","" +"AAAAAAAAOFDAAAAA","Candidates will hold. Chief ages used to choose with the foundations; horrible, complex rates meet","TN","1","16.0","","","1","13.0","","","1","12.0","","" +"AAAAAAAAOIAAAAAA","Desperately general missiles ought to know here other far talks. New times could exercise too young months. Unpleasant, likely countries explain.","TN","1","18.0","","","1","9.0","","","1","64.0","","" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00018.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00018.sql new file mode 100644 index 00000000000..a1b3f0fc2b0 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00018.sql @@ -0,0 +1,35 @@ +SELECT + "i_item_id" +, "ca_country" +, "ca_state" +, "ca_county" +, "avg"(CAST("cs_quantity" AS DECIMAL(12,2))) "agg1" +, "avg"(CAST("cs_list_price" AS DECIMAL(12,2))) "agg2" +, "avg"(CAST("cs_coupon_amt" AS DECIMAL(12,2))) "agg3" +, "avg"(CAST("cs_sales_price" AS DECIMAL(12,2))) "agg4" +, "avg"(CAST("cs_net_profit" AS DECIMAL(12,2))) "agg5" +, "avg"(CAST("c_birth_year" AS DECIMAL(12,2))) "agg6" +, "avg"(CAST("cd1"."cd_dep_count" AS DECIMAL(12,2))) "agg7" +FROM + catalog_sales +, customer_demographics cd1 +, customer_demographics cd2 +, customer +, customer_address +, date_dim +, item +WHERE ("cs_sold_date_sk" = "d_date_sk") + AND ("cs_item_sk" = "i_item_sk") + AND ("cs_bill_cdemo_sk" = "cd1"."cd_demo_sk") + AND ("cs_bill_customer_sk" = "c_customer_sk") + AND ("cd1"."cd_gender" = 'F') + AND ("cd1"."cd_education_status" = 'Unknown') + AND ("c_current_cdemo_sk" = "cd2"."cd_demo_sk") + AND ("c_current_addr_sk" = "ca_address_sk") + AND ("c_birth_month" IN (1, 6, 8, 9, 12, 2)) + AND ("d_year" = 1998) + AND ("ca_state" IN ('MS', 'IN', 'ND', 'OK', 'NM', 'VA', 'MS')) +GROUP BY ROLLUP (i_item_id, ca_country, ca_state, ca_county) +ORDER BY "ca_country" ASC, "ca_state" ASC, "ca_county" ASC, "i_item_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00018.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00018.txt new file mode 100644 index 00000000000..f98e06e3cc8 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00018.txt @@ -0,0 +1,100 @@ +"AAAAAAAAAAFAAAAA","United States","IN","Jefferson County","34.00","54.81","0.00","51.52","72.76","1935.00","6.00" +"AAAAAAAAACFAAAAA","United States","IN","Jefferson County","84.00","38.86","849.89","24.09","11.95","1935.00","6.00" +"AAAAAAAAAEAAAAAA","United States","IN","Jefferson County","53.00","53.31","0.00","39.98","1151.16","1935.00","2.00" +"AAAAAAAAAJHAAAAA","United States","IN","Jefferson County","90.00","25.65","0.00","13.33","-15.30","1935.00","6.00" +"AAAAAAAABAAAAAAA","United States","IN","Jefferson County","56.00","131.95","0.00","55.41","260.96","1935.00","2.00" +"AAAAAAAABFBAAAAA","United States","IN","Jefferson County","53.00","100.71","0.00","78.55","-399.09","1935.00","6.00" +"AAAAAAAABNFAAAAA","United States","IN","Jefferson County","61.00","132.80","0.00","88.97","976.00","1935.00","2.00" +"AAAAAAAACJDAAAAA","United States","IN","Jefferson County","70.00","127.72","0.00","8.94","-3295.60","1935.00","6.00" +"AAAAAAAADBAAAAAA","United States","IN","Jefferson County","32.00","71.18","0.00","32.03","175.04","1935.00","6.00" +"AAAAAAAAGAHAAAAA","United States","IN","Jefferson County","57.00","27.78","0.00","10.83","-257.64","1935.00","6.00" +"AAAAAAAAGJFAAAAA","United States","IN","Jefferson County","74.00","64.69","0.00","61.45","2669.92","1935.00","6.00" +"AAAAAAAAGODAAAAA","United States","IN","Jefferson County","88.00","27.28","0.00","19.36","265.76","1935.00","2.00" +"AAAAAAAAJICAAAAA","United States","IN","Jefferson County","61.00","89.94","3987.24","82.74","-1422.80","1935.00","2.00" +"AAAAAAAAKGDAAAAA","United States","IN","Jefferson County","76.00","104.55","0.00","61.68","1026.00","1935.00","6.00" +"AAAAAAAAKLFAAAAA","United States","IN","Jefferson County","44.00","18.09","0.00","0.54","-336.60","1935.00","6.00" +"AAAAAAAAKMGAAAAA","United States","IN","Jefferson County","22.00","86.13","0.00","15.50","-1139.38","1935.00","6.00" +"AAAAAAAAMAEAAAAA","United States","IN","Jefferson County","64.00","86.58","0.00","84.84","2208.00","1935.00","2.00" +"AAAAAAAAOHFAAAAA","United States","IN","Jefferson County","39.00","183.40","0.00","23.84","-1494.87","1935.00","6.00" +"AAAAAAAAOOGAAAAA","United States","IN","Jefferson County","49.00","238.06","0.00","185.68","5019.56","1935.00","2.00" +"AAAAAAAAFFAAAAAA","United States","IN","Whitley County","90.00","62.28","0.00","15.57","-3741.30","1947.00","2.00" +"AAAAAAAAIBEAAAAA","United States","IN","Whitley County","91.00","163.71","0.00","139.15","5176.08","1947.00","2.00" +"AAAAAAAAJAEAAAAA","United States","IN","Whitley County","45.00","201.72","6251.55","143.22","-2863.05","1947.00","2.00" +"AAAAAAAAJAHAAAAA","United States","IN","Whitley County","45.00","97.76","0.00","87.98","816.75","1947.00","2.00" +"AAAAAAAAKOFAAAAA","United States","IN","Whitley County","19.00","240.94","0.00","33.73","-1126.70","1947.00","2.00" +"AAAAAAAAAAFAAAAA","United States","IN","","34.00","54.81","0.00","51.52","72.76","1935.00","6.00" +"AAAAAAAAACFAAAAA","United States","IN","","84.00","38.86","849.89","24.09","11.95","1935.00","6.00" +"AAAAAAAAAEAAAAAA","United States","IN","","53.00","53.31","0.00","39.98","1151.16","1935.00","2.00" +"AAAAAAAAAJHAAAAA","United States","IN","","90.00","25.65","0.00","13.33","-15.30","1935.00","6.00" +"AAAAAAAABAAAAAAA","United States","IN","","56.00","131.95","0.00","55.41","260.96","1935.00","2.00" +"AAAAAAAABFBAAAAA","United States","IN","","53.00","100.71","0.00","78.55","-399.09","1935.00","6.00" +"AAAAAAAABNFAAAAA","United States","IN","","61.00","132.80","0.00","88.97","976.00","1935.00","2.00" +"AAAAAAAACJDAAAAA","United States","IN","","70.00","127.72","0.00","8.94","-3295.60","1935.00","6.00" +"AAAAAAAADBAAAAAA","United States","IN","","32.00","71.18","0.00","32.03","175.04","1935.00","6.00" +"AAAAAAAAFFAAAAAA","United States","IN","","90.00","62.28","0.00","15.57","-3741.30","1947.00","2.00" +"AAAAAAAAGAHAAAAA","United States","IN","","57.00","27.78","0.00","10.83","-257.64","1935.00","6.00" +"AAAAAAAAGJFAAAAA","United States","IN","","74.00","64.69","0.00","61.45","2669.92","1935.00","6.00" +"AAAAAAAAGODAAAAA","United States","IN","","88.00","27.28","0.00","19.36","265.76","1935.00","2.00" +"AAAAAAAAIBEAAAAA","United States","IN","","91.00","163.71","0.00","139.15","5176.08","1947.00","2.00" +"AAAAAAAAJAEAAAAA","United States","IN","","45.00","201.72","6251.55","143.22","-2863.05","1947.00","2.00" +"AAAAAAAAJAHAAAAA","United States","IN","","45.00","97.76","0.00","87.98","816.75","1947.00","2.00" +"AAAAAAAAJICAAAAA","United States","IN","","61.00","89.94","3987.24","82.74","-1422.80","1935.00","2.00" +"AAAAAAAAKGDAAAAA","United States","IN","","76.00","104.55","0.00","61.68","1026.00","1935.00","6.00" +"AAAAAAAAKLFAAAAA","United States","IN","","44.00","18.09","0.00","0.54","-336.60","1935.00","6.00" +"AAAAAAAAKMGAAAAA","United States","IN","","22.00","86.13","0.00","15.50","-1139.38","1935.00","6.00" +"AAAAAAAAKOFAAAAA","United States","IN","","19.00","240.94","0.00","33.73","-1126.70","1947.00","2.00" +"AAAAAAAAMAEAAAAA","United States","IN","","64.00","86.58","0.00","84.84","2208.00","1935.00","2.00" +"AAAAAAAAOHFAAAAA","United States","IN","","39.00","183.40","0.00","23.84","-1494.87","1935.00","6.00" +"AAAAAAAAOOGAAAAA","United States","IN","","49.00","238.06","0.00","185.68","5019.56","1935.00","2.00" +"AAAAAAAACKEAAAAA","United States","MS","Chickasaw County","67.00","167.82","0.00","120.83","3787.51","1953.00","6.00" +"AAAAAAAAIOGAAAAA","United States","MS","Chickasaw County","42.00","44.41","0.00","26.20","380.10","1953.00","6.00" +"AAAAAAAANMDAAAAA","United States","MS","Chickasaw County","100.00","185.31","0.00","111.18","3554.00","1953.00","6.00" +"AAAAAAAAOLHAAAAA","United States","MS","Chickasaw County","46.00","68.52","0.00","28.77","-1120.10","1953.00","6.00" +"AAAAAAAABMGAAAAA","United States","MS","Lamar County","21.00","7.44","0.00","0.59","-46.20","1973.00","4.00" +"AAAAAAAAGKHAAAAA","United States","MS","Lamar County","81.00","82.65","0.00","77.69","3277.26","1973.00","4.00" +"AAAAAAAAIKHAAAAA","United States","MS","Lamar County","58.00","59.12","0.00","41.97","580.58","1973.00","4.00" +"AAAAAAAALKHAAAAA","United States","MS","Lamar County","95.00","267.24","0.00","88.18","-85.50","1973.00","4.00" +"AAAAAAAANGAAAAAA","United States","MS","Lamar County","62.00","32.98","0.00","8.57","-1362.14","1973.00","4.00" +"AAAAAAAAABGAAAAA","United States","MS","Washington County","86.00","29.35","0.00","17.31","-50.74","1957.00","4.00" +"AAAAAAAAALDAAAAA","United States","MS","Washington County","22.00","154.63","0.00","105.14","766.70","1957.00","4.00" +"AAAAAAAAHCEAAAAA","United States","MS","Washington County","33.00","28.37","43.75","1.70","-862.81","1957.00","4.00" +"AAAAAAAAHDGAAAAA","United States","MS","Washington County","22.00","69.98","1077.69","69.98","-311.87","1957.00","4.00" +"AAAAAAAAIAGAAAAA","United States","MS","Washington County","33.00","195.26","0.00","115.20","924.99","1957.00","4.00" +"AAAAAAAAIDCAAAAA","United States","MS","Washington County","96.00","82.53","0.00","59.42","2725.44","1957.00","4.00" +"AAAAAAAAKAHAAAAA","United States","MS","Washington County","5.00","135.95","0.00","53.02","33.10","1957.00","4.00" +"AAAAAAAAKLCAAAAA","United States","MS","Washington County","4.00","13.36","0.00","1.60","-12.04","1957.00","4.00" +"AAAAAAAAOLDAAAAA","United States","MS","Washington County","42.00","222.57","0.00","95.70","-98.70","1957.00","4.00" +"AAAAAAAAOLHAAAAA","United States","MS","Washington County","85.00","92.62","0.00","47.23","-2714.90","1957.00","4.00" +"AAAAAAAAPBDAAAAA","United States","MS","Washington County","65.00","133.44","0.00","60.04","804.70","1957.00","4.00" +"AAAAAAAAABGAAAAA","United States","MS","","86.00","29.35","0.00","17.31","-50.74","1957.00","4.00" +"AAAAAAAAALDAAAAA","United States","MS","","22.00","154.63","0.00","105.14","766.70","1957.00","4.00" +"AAAAAAAABMGAAAAA","United States","MS","","21.00","7.44","0.00","0.59","-46.20","1973.00","4.00" +"AAAAAAAACKEAAAAA","United States","MS","","67.00","167.82","0.00","120.83","3787.51","1953.00","6.00" +"AAAAAAAAGKHAAAAA","United States","MS","","81.00","82.65","0.00","77.69","3277.26","1973.00","4.00" +"AAAAAAAAHCEAAAAA","United States","MS","","33.00","28.37","43.75","1.70","-862.81","1957.00","4.00" +"AAAAAAAAHDGAAAAA","United States","MS","","22.00","69.98","1077.69","69.98","-311.87","1957.00","4.00" +"AAAAAAAAIAGAAAAA","United States","MS","","33.00","195.26","0.00","115.20","924.99","1957.00","4.00" +"AAAAAAAAIDCAAAAA","United States","MS","","96.00","82.53","0.00","59.42","2725.44","1957.00","4.00" +"AAAAAAAAIKHAAAAA","United States","MS","","58.00","59.12","0.00","41.97","580.58","1973.00","4.00" +"AAAAAAAAIOGAAAAA","United States","MS","","42.00","44.41","0.00","26.20","380.10","1953.00","6.00" +"AAAAAAAAKAHAAAAA","United States","MS","","5.00","135.95","0.00","53.02","33.10","1957.00","4.00" +"AAAAAAAAKLCAAAAA","United States","MS","","4.00","13.36","0.00","1.60","-12.04","1957.00","4.00" +"AAAAAAAALKHAAAAA","United States","MS","","95.00","267.24","0.00","88.18","-85.50","1973.00","4.00" +"AAAAAAAANGAAAAAA","United States","MS","","62.00","32.98","0.00","8.57","-1362.14","1973.00","4.00" +"AAAAAAAANMDAAAAA","United States","MS","","100.00","185.31","0.00","111.18","3554.00","1953.00","6.00" +"AAAAAAAAOLDAAAAA","United States","MS","","42.00","222.57","0.00","95.70","-98.70","1957.00","4.00" +"AAAAAAAAOLHAAAAA","United States","MS","","65.50","80.57","0.00","38.00","-1917.50","1955.00","5.00" +"AAAAAAAAPBDAAAAA","United States","MS","","65.00","133.44","0.00","60.04","804.70","1957.00","4.00" +"AAAAAAAAABEAAAAA","United States","VA","Arlington County","29.00","114.35","0.00","114.35","1892.83","1934.00","0.00" +"AAAAAAAABFEAAAAA","United States","VA","Arlington County","65.00","22.72","0.00","5.45","-930.15","1934.00","0.00" +"AAAAAAAABLEAAAAA","United States","VA","Arlington County","10.00","57.49","0.00","50.01","133.90","1934.00","5.00" +"AAAAAAAAECFAAAAA","United States","VA","Arlington County","76.00","63.66","0.00","56.02","2367.40","1934.00","0.00" +"AAAAAAAAFHHAAAAA","United States","VA","Arlington County","27.00","45.39","0.00","42.21","405.81","1934.00","0.00" +"AAAAAAAAGHAAAAAA","United States","VA","Arlington County","40.00","74.42","0.00","56.55","-628.40","1934.00","5.00" +"AAAAAAAAGHGAAAAA","United States","VA","Arlington County","69.00","48.93","0.00","22.99","246.33","1934.00","0.00" +"AAAAAAAAHFBAAAAA","United States","VA","Arlington County","64.00","176.78","0.00","0.00","-4084.48","1934.00","0.00" +"AAAAAAAAHIBAAAAA","United States","VA","Arlington County","71.00","64.96","0.00","36.37","-230.04","1934.00","5.00" +"AAAAAAAAIEBAAAAA","United States","VA","Arlington County","83.00","73.73","4317.33","62.67","-2388.41","1934.00","5.00" +"AAAAAAAAIECAAAAA","United States","VA","Arlington County","46.00","99.53","0.00","90.57","218.96","1934.00","5.00" +"AAAAAAAAJFCAAAAA","United States","VA","Arlington County","23.00","99.93","1274.12","76.94","-753.63","1934.00","5.00" +"AAAAAAAAKMHAAAAA","United States","VA","Arlington County","73.00","146.19","0.00","5.84","-3929.59","1934.00","5.00" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00019.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00019.sql new file mode 100644 index 00000000000..a22f025d8e0 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00019.sql @@ -0,0 +1,26 @@ +SELECT + "i_brand_id" "brand_id" +, "i_brand" "brand" +, "i_manufact_id" +, "i_manufact" +, "sum"("ss_ext_sales_price") "ext_price" +FROM + date_dim +, store_sales +, item +, customer +, customer_address +, store +WHERE ("d_date_sk" = "ss_sold_date_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("i_manager_id" = 8) + AND ("d_moy" = 11) + AND ("d_year" = 1998) + AND ("ss_customer_sk" = "c_customer_sk") + AND ("c_current_addr_sk" = "ca_address_sk") + AND ("substr"("ca_zip", 1, 5) <> "substr"("s_zip", 1, 5)) + AND ("ss_store_sk" = "s_store_sk") +GROUP BY "i_brand", "i_brand_id", "i_manufact_id", "i_manufact" +ORDER BY "ext_price" DESC, "i_brand" ASC, "i_brand_id" ASC, "i_manufact_id" ASC, "i_manufact" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00019.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00019.txt new file mode 100644 index 00000000000..c9c60ef9efe --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00019.txt @@ -0,0 +1,15 @@ +"8003007","exportinameless #7 ","85","antieing ","15688.10" +"9005009","scholarmaxi #9 ","255","antiantiable ","13609.55" +"8012001","importomaxi #1 ","277","ationationable ","11761.30" +"3001002","amalgexporti #2 ","448","eingeseese ","10758.12" +"1002002","importoamalg #2 ","50","baranti ","10446.47" +"5003002","exportischolar #2 ","162","ablecallyought ","10124.68" +"8016009","corpmaxi #9 ","734","esepriation ","9292.73" +"3002002","importoexporti #2 ","597","ationn stanti ","9082.33" +"1002002","importoamalg #2 ","489","n steingese ","6426.98" +"10009003","maxiunivamalg #3 ","389","n steingpri ","5481.57" +"4003001","exportiedu pack #1 ","659","n stantically ","4388.32" +"9002011","importomaxi #11 ","606","callybarcally ","3993.69" +"3004001","edu packexporti #1 ","119","n stoughtought ","3816.01" +"8014007","edu packmaxi #7 ","350","barantipri ","2920.85" +"6011004","amalgbrand #4 ","9","n st ","2790.86" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00020.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00020.sql new file mode 100644 index 00000000000..7f28d3700aa --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00020.sql @@ -0,0 +1,20 @@ +SELECT + "i_item_id" +, "i_item_desc" +, "i_category" +, "i_class" +, "i_current_price" +, "sum"("cs_ext_sales_price") "itemrevenue" +, (("sum"("cs_ext_sales_price") * 100) / "sum"("sum"("cs_ext_sales_price")) OVER (PARTITION BY "i_class")) "revenueratio" +FROM + catalog_sales +, item +, date_dim +WHERE ("cs_item_sk" = "i_item_sk") + AND ("i_category" IN ('Sports', 'Books', 'Home')) + AND ("cs_sold_date_sk" = "d_date_sk") + AND (CAST("d_date" AS DATE) BETWEEN CAST('1999-02-22' AS DATE) AND (CAST('1999-02-22' AS DATE) + INTERVAL '30' DAY)) +GROUP BY "i_item_id", "i_item_desc", "i_category", "i_class", "i_current_price" +ORDER BY "i_category" ASC, "i_class" ASC, "i_item_id" ASC, "i_item_desc" ASC, "revenueratio" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00020.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00020.txt new file mode 100644 index 00000000000..e52bb32c95c --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00020.txt @@ -0,0 +1,100 @@ +"AAAAAAAACKEAAAAA","Legs appear eventually soci","Books ","arts ","35.27","2797.92","42.94" +"AAAAAAAAMFFAAAAA","Communities used to relocate clearly strange, new walls; european, rich championships make current depths. Sure studies may reflect only instinctively old forces. Foreign, diverse","Books ","arts ","8.22","150.80","2.31" +"AAAAAAAANIBAAAAA","Beneath decent wives write t","Books ","arts ","2.72","3566.52","54.74" +"AAAAAAAAADFAAAAA","Satisfactory, technical shadows get. Lexical structures would not blame. Only hard ","Books ","business ","78.25","721.68","6.94" +"AAAAAAAAEICAAAAA","Cases include proudly without a columns. Solid, pre","Books ","business ","2.42","1781.00","17.13" +"AAAAAAAAIKEAAAAA","All ","Books ","business ","9.44","608.88","5.85" +"AAAAAAAAMKHAAAAA","Unions shall see enough over true attitudes; of course full variable","Books ","business ","8.90","7288.00","70.08" +"AAAAAAAAEMHAAAAA","Boots recommend usually just local centres; c","Books ","computers ","7.56","2287.80","15.44" +"AAAAAAAAGMCAAAAA","More important names induce; now similar standards will train correctly times. Ex","Books ","computers ","9.23","1240.47","8.37" +"AAAAAAAALCDAAAAA","Clearly actual places would supply apparently only rats.","Books ","computers ","4.34","9187.71","62.01" +"AAAAAAAAMJEAAAAA","Local pro","Books ","computers ","1.04","1342.14","9.06" +"AAAAAAAAOMDAAAAA","Together hot rights ","Books ","computers ","4.99","758.40","5.12" +"AAAAAAAALIGAAAAA","There superb accidents may strike individual results. Quiet, only forests drop as little unlikely towns. Observations can discern with a points. Substantial banks dest","Books ","cooking ","0.88","18517.32","100.00" +"AAAAAAAACIDAAAAA","Millions might answer. Attractive rules might beat coloured volunteers. Scottis","Books ","entertainments ","3.51","0.00","0.00" +"AAAAAAAAKDEAAAAA","Yet national bodies could answer on behalf of a hours. Features use later workers. Fortunes placa","Books ","entertainments ","6.46","8730.35","45.07" +"AAAAAAAAMKDAAAAA","Too big interests ought to go annually old real classes; little edges entail still electoral matters. Sure bonds make wonderful, central provisions. Internation","Books ","entertainments ","1.52","2449.22","12.64" +"AAAAAAAAOOEAAAAA","Companies reveal national reforms; kinds initiate in a languages. Positive miles ought to hesitate thick priorities. Large, cons","Books ","entertainments ","1.45","8190.78","42.29" +"AAAAAAAABGAAAAAA","Quite different services promote all the same. Private, marginal colleagues play of course similar, different girls. French, local girls reap here. Bad movies shorten relatively. Terms","Books ","fiction ","57.09","327.93","7.20" +"AAAAAAAAOCGAAAAA","Well different problems must not disrupt","Books ","fiction ","8.69","2637.18","57.91" +"AAAAAAAAOHHAAAAA","Private children used to stop really national, mate","Books ","fiction ","2.82","1589.00","34.89" +"AAAAAAAAAMEAAAAA","Very, true women eat. Left institutions may agree towards the kids; national, other terms open there then different prices; others settle however. Apparently normal ","Books ","history ","9.64","106.20","2.29" +"AAAAAAAACIBAAAAA","Surely specific clubs must remember necessary, big duties. There final words learn practically standard lands. Private, clear companies must see","Books ","history ","4.94","591.92","12.75" +"AAAAAAAAIIHAAAAA","Expensive services ensur","Books ","history ","2.88","2125.68","45.79" +"AAAAAAAAJGEAAAAA","Fully powerful qualities pinpoint thus movements. Domestic officers continue in a cases. Teachers shall introduce indeed other, good","Books ","history ","0.65","1818.18","39.17" +"AAAAAAAAGBEAAAAA","Later wonderful authorities must get famous terms. Articles shall vary to a shoulders. Exhibitions replace far good councillors. Feet can increase rarely later high sales. Open c","Books ","home repair ","2.10","12790.44","100.00" +"AAAAAAAAADCAAAAA","Nice knees help be","Books ","mystery ","1.55","5853.12","14.84" +"AAAAAAAACECAAAAA","Human, possible rumours buy then both following sides; continuous hands use again in the writers; distinctive others increase afterwards wild s","Books ","mystery ","4.92","13592.28","34.46" +"AAAAAAAACLBAAAAA","Common, logical babies must take somehow general months. Costs drag. Big, british areas give dramatic, effective clot","Books ","mystery ","3.00","14868.35","37.70" +"AAAAAAAAMABAAAAA","Small designs may not guide sure single things","Books ","mystery ","3.73","5125.38","13.00" +"AAAAAAAAEFEAAAAA","Considerations might make of course clear services. Political, beautiful germans can become in a contents; famous areas r","Books ","parenting ","2.15","686.24","24.19" +"AAAAAAAAGFCAAAAA","Departmen","Books ","parenting ","2.09","1617.70","57.02" +"AAAAAAAAKHAAAAAA","Generally french beds will ask amounts. Difficult, difficult workers would come once again in a resources. So inc","Books ","parenting ","2.62","533.00","18.79" +"AAAAAAAAAODAAAAA","Secondary, economic pupils loo","Books ","reference ","3.68","135.24","0.88" +"AAAAAAAALIDAAAAA","Largely substantial contracts facilitate. Yet full values can advise extremely plants. Men classify empty contacts. Private, common events can want more just central patients. Enti","Books ","reference ","1.55","12588.64","81.52" +"AAAAAAAANJAAAAAA","Young, white workers may not wreck british, statistical explanations. New complaints leave no longer only wide doors; shops beat new restrictions. Horses must not test by now anonym","Books ","reference ","2.21","2718.46","17.60" +"AAAAAAAABOBAAAAA","Old, revolutionary eyes may not serve fully by","Books ","romance ","2.38","4954.44","23.30" +"AAAAAAAAFCDAAAAA","Live, late activities feel principles. In","Books ","romance ","4.50","8188.01","38.51" +"AAAAAAAAMOAAAAAA","Sympathetically scottish things should take regularly on a programmes. Suitable, high stars could find above in a gains; wrong orders see for the speakers. English, grand groups shall not m","Books ","romance ","0.75","572.60","2.69" +"AAAAAAAAMPEAAAAA","Relations marry in a attacks. Prime books ma","Books ","romance ","2.81","5611.05","26.39" +"AAAAAAAAOKCAAAAA","There welcome references must lower. Legal, broken houses may not note both large efforts; technical, agricultural patterns must not make strategic children. ","Books ","romance ","2.33","1936.12","9.11" +"AAAAAAAACDFAAAAA","Asleep, philos","Books ","science ","4.18","1082.75","63.18" +"AAAAAAAADPEAAAAA","Catholic years st","Books ","science ","0.45","631.02","36.82" +"AAAAAAAABJAAAAAA","Members begin together industrial, re","Books ","self-help ","59.77","1629.12","26.47" +"AAAAAAAAEMGAAAAA","Decent times will exist increasingly. Hospitals stand medical tears; families cover years. Foreign firms would","Books ","self-help ","27.81","4524.85","73.53" +"AAAAAAAADJEAAAAA","Specific, temporary goals take. Ideas might reduce economic authorities. Fundamentally external prayers matter really","Books ","travel ","84.79","2780.82","27.83" +"AAAAAAAAKPAAAAAA","Effects ought","Books ","travel ","4.16","1513.01","15.14" +"AAAAAAAALCAAAAAA","Thus present women should hear for a shares; leaders must come early; immediate men will want exactly young groups. Insects may ask narrow variations. New leaders should deal ","Books ","travel ","6.08","3887.28","38.90" +"AAAAAAAAMGBAAAAA","Home certain acts adopt then new women. Statements reinforce thus mainly new rates. Real, other men must find. Late new children should not achieve years. Extr","Books ","travel ","8.58","828.96","8.30" +"AAAAAAAAPCCAAAAA","Tall relationships may not determine upon a relations. Again popular children would base cold, old boundaries;","Books ","travel ","3.30","983.20","9.84" +"AAAAAAAAABDAAAAA","Goods mean so correct, legal systems. Just alternative banks tend then more concrete edges. Close, united chapters get only rus","Home ","accent ","1.06","4402.09","63.73" +"AAAAAAAACFHAAAAA","Asleep, regular month","Home ","accent ","0.91","2307.66","33.41" +"AAAAAAAAGHBAAAAA","Doubts could not think. Acres shall live tired ways. Obvious interests pay seldom severe images. Quick officials should no","Home ","accent ","8.82","197.19","2.85" +"AAAAAAAAADEAAAAA","Days stick fairly big, integrated women. Much other fortunes ought to work so to the losses. Subsidies take ","Home ","bathroom ","2.57","9146.60","95.96" +"AAAAAAAAHBFAAAAA","Dollars prove everywhere o","Home ","bathroom ","7.89","384.66","4.04" +"AAAAAAAAEKDAAAAA","Now short views cannot include. Real, northern interests may build. Fresh","Home ","bedding ","1.78","2928.42","65.46" +"AAAAAAAAHHCAAAAA","Old, cultural workers ought to take both now everyday budgets. Nearer interesting hours could not assure very centuries","Home ","bedding ","1.65","1544.96","34.54" +"AAAAAAAACAFAAAAA","Catholic, favorite interests may decide agents. Extraordinary office","Home ","blinds/shades ","29.09","357.57","1.03" +"AAAAAAAAEJGAAAAA","Careful houses put right odds. Open, unchanged examples must light well things. Once great days enter even weakly medium routes. Old-fashioned, economic implications try. Ever left courts decide dev","Home ","blinds/shades ","5.49","17099.17","49.09" +"AAAAAAAAGHDAAAAA","In common academic pupils know highly joint sites. Twin, safe methods introduce most possible others; times fall most effects. Highest parliamentary performances used ","Home ","blinds/shades ","6.97","6807.68","19.55" +"AAAAAAAAIJFAAAAA","Nice things would coincide still satisfactory students. Now oth","Home ","blinds/shades ","1.08","7674.40","22.03" +"AAAAAAAAPOCAAAAA","Bishops could confirm; rates rot very pp.. Prisoners will want old countries. Too po","Home ","blinds/shades ","3.71","2891.70","8.30" +"AAAAAAAAACAAAAAA","Different numbers might not visit; rights used to remember. Labour students must put as slowly possible children. Never","Home ","curtains/drapes ","1.77","7744.11","66.53" +"AAAAAAAAAGEAAAAA","Foreign conditions could not think scientists. Big, applicable jobs could not perform social, high profits. Even young orde","Home ","curtains/drapes ","7.02","1.88","0.02" +"AAAAAAAAAIAAAAAA","Wrong limits could not accompany now perhaps lonely customers. Anxious, neighbouring principles might arise molecules. Useful, short nerves think advantages. Angry, parental prices fly t","Home ","curtains/drapes ","4.06","3057.10","26.26" +"AAAAAAAAIAGAAAAA","Social wor","Home ","curtains/drapes ","0.79","837.68","7.20" +"AAAAAAAALLGAAAAA","Pp. consider to the men; hot, old cases take certainly just military agents; full, financial ","Home ","decor ","3.23","19528.74","96.97" +"AAAAAAAAMOFAAAAA","Political shares become then firmly english men. Hardly young police ","Home ","decor ","1.89","609.84","3.03" +"AAAAAAAAANDAAAAA","Beautiful areas know ever actually chief patterns. International, simple feelings like in a russians. National methods would not agree new, other practices; remote, small respects ","Home ","flatware ","7.13","13717.32","43.14" +"AAAAAAAABNCAAAAA","Criminal companies may emerge sometimes children. Urban, other efforts dominate policies. Very right fans drive briti","Home ","flatware ","9.67","4707.80","14.81" +"AAAAAAAAKDHAAAAA","National, wrong sources must rot. Cases take often for a words. Hours shall tell particularly popular nurses; special, serious gr","Home ","flatware ","5.00","13315.20","41.88" +"AAAAAAAANMDAAAAA","Major, spanish limits cover too in the group","Home ","flatware ","2.03","54.42","0.17" +"AAAAAAAAABGAAAAA","Otherwise suitable products consider too technical techniques; common women spend quickly assessments; chemical habits develop more. Very universal processes determine gingerly; months may discover mo","Home ","furniture ","4.64","1881.84","12.23" +"AAAAAAAAAFDAAAAA","New relations should get ideal shapes. Revolutionary settings forget however soviet institutions. Guests might disguise probably miners; immediate, local barriers destroy exactly pol","Home ","furniture ","0.85","0.00","0.00" +"AAAAAAAADHAAAAAA","Enough apparent elements reverse actu","Home ","furniture ","2.68","2183.02","14.19" +"AAAAAAAAEADAAAAA","So good choices accept good events; mean, effective birds remember away of course mixed vegetables. Requirements concede quite worth the steps. Heavy, big war","Home ","furniture ","2.70","265.54","1.73" +"AAAAAAAAFNBAAAAA","Happy laws sit on the powers. Quickly convenient newspapers ","Home ","furniture ","0.16","8739.01","56.79" +"AAAAAAAAKHFAAAAA","Subsequent, serious gene","Home ","furniture ","4.93","476.71","3.10" +"AAAAAAAAMDHAAAAA","Asleep rights continue over papers. Yesterday poor combinations ought to like votes. Hardly similar manufacturers used to see groups. Rel","Home ","furniture ","65.51","43.60","0.28" +"AAAAAAAAMOCAAAAA","Weeks will claim at a hands. Cuts meet smart, relevant lawyers. Enormous sides should ","Home ","furniture ","23.89","184.00","1.20" +"AAAAAAAAONEAAAAA","Social, young days guide presumably. Somehow old servants return so","Home ","furniture ","2.18","1614.58","10.49" +"AAAAAAAAJFFAAAAA","Exact jews make again regional times","Home ","glassware ","0.82","15750.90","100.00" +"AAAAAAAAEHFAAAAA","Actively fair matches will like even; brit","Home ","kids ","3.14","2802.09","45.41" +"AAAAAAAALPCAAAAA","Sorts might think full birds. New packages shall exceed sad arrangements. Problems cannot come together other employees.","Home ","kids ","1.54","3368.73","54.59" +"AAAAAAAAGKBAAAAA","As other folk can remain quickly methods. Easy, othe","Home ","lighting ","1.87","1729.38","23.92" +"AAAAAAAAICAAAAAA","Deep good activities should resist to a substances; that is beautiful businessmen like problems. Late huge meet","Home ","lighting ","9.93","5499.16","76.08" +"AAAAAAAAHAGAAAAA","Black, successive interactions u","Home ","mattresses ","2.75","2731.26","53.05" +"AAAAAAAALGCAAAAA","Voters cause already urban, formal children. Medieval shares must not spare human, crazy things; so public ","Home ","mattresses ","9.27","2417.60","46.95" +"AAAAAAAABDGAAAAA","Blue, financial opportunities could hope social humans. Lights must vote states. Then new companies make important, a","Home ","paint ","4.83","2504.67","65.84" +"AAAAAAAAKOBAAAAA","Modern men would not ask girls. Often p","Home ","paint ","6.55","326.64","8.59" +"AAAAAAAANAGAAAAA","Managers may not come slightly possible occasions; naked, organisational goods could pull. Things put much little, experimental mistakes. Healthy, cruel hours acknowledge red doubts. Citie","Home ","paint ","7.24","972.89","25.57" +"AAAAAAAAHKFAAAAA","Friends tell. Living times should no","Home ","rugs ","4.43","23584.96","95.36" +"AAAAAAAANGAAAAAA","Rightly central others concentrate often mental s","Home ","rugs ","9.46","1148.40","4.64" +"AAAAAAAAAICAAAAA","Urgent, simple cases may not help. Industrial, other pp. reverse as a schools. Asleep, free systems make then more available discussions. Soci","Home ","wallpaper ","4.82","238.45","0.71" +"AAAAAAAAGCFAAAAA","Hard british units see so different communities.","Home ","wallpaper ","8.17","10321.34","30.63" +"AAAAAAAAJKDAAAAA","Yet equal pa","Home ","wallpaper ","57.16","17172.70","50.96" +"AAAAAAAAKEFAAAAA","Social quantities shoul","Home ","wallpaper ","0.75","2688.88","7.98" +"AAAAAAAAKPBAAAAA","Simply scottish corporations join whole, practical concerns. Ma","Home ","wallpaper ","6.27","3079.30","9.14" +"AAAAAAAAMNDAAAAA","Successful, warm employers can show easily true, handsome brothers. Bad, great men return great, linguistic gardens. Both political tra","Home ","wallpaper ","4.16","199.92","0.59" +"AAAAAAAAEFCAAAAA","Eligible, stupid attitudes used to protect so. Alone, good sciences concentrate suddenly liable eyes. Revolutionary students should punch f","Sports ","archery ","0.35","13989.42","100.00" +"AAAAAAAAOFGAAAAA","Main, agricultural issues mature usually terms. Powers return units. Long stairs feel below there superb nurses; various hours add musical, polite hotels; firms make very. As other defences may s","Sports ","athletic shoes ","2.14","7619.35","47.94" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00021.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00021.sql new file mode 100644 index 00000000000..fa10e6ffc12 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00021.sql @@ -0,0 +1,24 @@ +SELECT * +FROM + ( + SELECT + "w_warehouse_name" + , "i_item_id" + , "sum"((CASE WHEN (CAST("d_date" AS DATE) < CAST('2000-03-11' AS DATE)) THEN "inv_quantity_on_hand" ELSE 0 END)) "inv_before" + , "sum"((CASE WHEN (CAST("d_date" AS DATE) >= CAST('2000-03-11' AS DATE)) THEN "inv_quantity_on_hand" ELSE 0 END)) "inv_after" + FROM + inventory + , warehouse + , item + , date_dim + WHERE ("i_current_price" BETWEEN DECIMAL '0.99' AND DECIMAL '1.49') + AND ("i_item_sk" = "inv_item_sk") + AND ("inv_warehouse_sk" = "w_warehouse_sk") + AND ("inv_date_sk" = "d_date_sk") + AND ("d_date" BETWEEN (CAST('2000-03-11' AS DATE) - INTERVAL '30' DAY) AND (CAST('2000-03-11' AS DATE) + INTERVAL '30' DAY)) + GROUP BY "w_warehouse_name", "i_item_id" +) x +WHERE ((CASE WHEN ("inv_before" > 0) THEN (CAST("inv_after" AS DECIMAL(7,2)) / "inv_before") ELSE null END) BETWEEN (DECIMAL '2.00' / DECIMAL '3.00') AND (DECIMAL '3.00' / DECIMAL '2.00')) +ORDER BY "w_warehouse_name" ASC, "i_item_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00021.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00021.txt new file mode 100644 index 00000000000..43a58a4f750 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00021.txt @@ -0,0 +1,30 @@ +"Conventional childr","AAAAAAAAAHHAAAAA","2366","3097" +"Conventional childr","AAAAAAAAAJCAAAAA","2523","1697" +"Conventional childr","AAAAAAAABKFAAAAA","1798","2127" +"Conventional childr","AAAAAAAACAAAAAAA","1660","1593" +"Conventional childr","AAAAAAAACBFAAAAA","1794","2661" +"Conventional childr","AAAAAAAACEEAAAAA","2475","2229" +"Conventional childr","AAAAAAAADMBAAAAA","2927","3215" +"Conventional childr","AAAAAAAAEMEAAAAA","2333","2124" +"Conventional childr","AAAAAAAAENDAAAAA","1900","2706" +"Conventional childr","AAAAAAAAFCGAAAAA","2290","2540" +"Conventional childr","AAAAAAAAFKEAAAAA","1741","1556" +"Conventional childr","AAAAAAAAGKGAAAAA","1674","2475" +"Conventional childr","AAAAAAAAGNBAAAAA","1866","2733" +"Conventional childr","AAAAAAAAHDAAAAAA","2765","2370" +"Conventional childr","AAAAAAAAHLHAAAAA","2603","2621" +"Conventional childr","AAAAAAAAIHHAAAAA","2427","1908" +"Conventional childr","AAAAAAAAIKHAAAAA","2737","2819" +"Conventional childr","AAAAAAAAJAEAAAAA","2970","2053" +"Conventional childr","AAAAAAAAKJAAAAAA","2041","1743" +"Conventional childr","AAAAAAAAMAHAAAAA","2802","3033" +"Conventional childr","AAAAAAAAMBAAAAAA","1951","1611" +"Conventional childr","AAAAAAAANEFAAAAA","2110","1934" +"Conventional childr","AAAAAAAANFHAAAAA","1734","1396" +"Conventional childr","AAAAAAAANGDAAAAA","2960","2250" +"Conventional childr","AAAAAAAANJGAAAAA","2843","1944" +"Conventional childr","AAAAAAAAOFDAAAAA","2615","3189" +"Conventional childr","AAAAAAAAOOEAAAAA","1590","1846" +"Conventional childr","AAAAAAAAPAEAAAAA","2421","2298" +"Conventional childr","AAAAAAAAPAHAAAAA","2256","2545" +"Conventional childr","AAAAAAAAPKAAAAAA","2960","2851" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00022.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00022.sql new file mode 100644 index 00000000000..7f109e2b262 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00022.sql @@ -0,0 +1,17 @@ +SELECT + "i_product_name" +, "i_brand" +, "i_class" +, "i_category" +, "avg"("inv_quantity_on_hand") "qoh" +FROM + inventory +, date_dim +, item +WHERE ("inv_date_sk" = "d_date_sk") + AND ("inv_item_sk" = "i_item_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) +GROUP BY ROLLUP (i_product_name, i_brand, i_class, i_category) +ORDER BY "qoh" ASC, "i_product_name" ASC, "i_brand" ASC, "i_class" ASC, "i_category" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00022.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00022.txt new file mode 100644 index 00000000000..dd26ac33df8 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00022.txt @@ -0,0 +1,100 @@ +"n stcallyable ","exportiexporti #2 ","toddlers ","Children ","376.40816326530614" +"n stcallyable ","exportiexporti #2 ","toddlers ","","376.40816326530614" +"n stcallyable ","exportiexporti #2 ","","","376.40816326530614" +"n stcallyable ","","","","376.40816326530614" +"oughtcallycally ","edu packamalgamalg #16 ","automotive ","Electronics ","379.1276595744681" +"oughtcallycally ","edu packamalgamalg #16 ","automotive ","","379.1276595744681" +"oughtcallycally ","edu packamalgamalg #16 ","","","379.1276595744681" +"oughtcallycally ","","","","379.1276595744681" +"ableoughteseought ","exportimaxi #3 ","sailing ","Sports ","380.9782608695652" +"ableoughteseought ","exportimaxi #3 ","sailing ","","380.9782608695652" +"ableoughteseought ","exportimaxi #3 ","","","380.9782608695652" +"ableoughteseought ","","","","380.9782608695652" +"n stn stbarought ","brandnameless #10 ","hockey ","Sports ","386.8541666666667" +"n stn stbarought ","brandnameless #10 ","hockey ","","386.8541666666667" +"n stn stbarought ","brandnameless #10 ","","","386.8541666666667" +"n stn stbarought ","","","","386.8541666666667" +"antiationation ","amalgamalg #2 ","dresses ","Women ","392.34" +"antiationation ","amalgamalg #2 ","dresses ","","392.34" +"antiationation ","amalgamalg #2 ","","","392.34" +"antiationation ","","","","392.34" +"ationbaration ","edu packexporti #2 ","school-uniforms ","Children ","393.0408163265306" +"ationbaration ","edu packexporti #2 ","school-uniforms ","","393.0408163265306" +"ationbaration ","edu packexporti #2 ","","","393.0408163265306" +"ationbaration ","","","","393.0408163265306" +"ationpri ","amalgimporto #2 ","accessories ","Men ","394.265306122449" +"ationpri ","amalgimporto #2 ","accessories ","","394.265306122449" +"ationpri ","amalgimporto #2 ","","","394.265306122449" +"ationpri ","","","","394.265306122449" +"eingablen stought ","scholarmaxi #9 ","history ","Books ","394.5833333333333" +"eingablen stought ","scholarmaxi #9 ","history ","","394.5833333333333" +"eingablen stought ","scholarmaxi #9 ","","","394.5833333333333" +"eingablen stought ","","","","394.5833333333333" +"able ","amalgamalg #1 ","dresses ","Women ","395.12" +"able ","amalgamalg #1 ","dresses ","","395.12" +"able ","amalgamalg #1 ","","","395.12" +"able ","","","","395.12" +"eseeseableought ","amalgexporti #1 ","newborn ","Children ","395.70212765957444" +"eseeseableought ","amalgexporti #1 ","newborn ","","395.70212765957444" +"eseeseableought ","amalgexporti #1 ","","","395.70212765957444" +"eseeseableought ","","","","395.70212765957444" +"pripripriought ","importounivamalg #2 ","home repair ","Books ","396.6470588235294" +"pripripriought ","importounivamalg #2 ","home repair ","","396.6470588235294" +"pripripriought ","importounivamalg #2 ","","","396.6470588235294" +"pripripriought ","","","","396.6470588235294" +"oughtbarcallyought ","importonameless #2 ","paint ","Home ","396.9795918367347" +"oughtbarcallyought ","importonameless #2 ","paint ","","396.9795918367347" +"oughtbarcallyought ","importonameless #2 ","","","396.9795918367347" +"oughtbarcallyought ","","","","396.9795918367347" +"ablen stableought ","scholarmaxi #3 ","fishing ","Sports ","397.0576923076923" +"ablen stableought ","scholarmaxi #3 ","fishing ","","397.0576923076923" +"ablen stableought ","scholarmaxi #3 ","","","397.0576923076923" +"ablen stableought ","","","","397.0576923076923" +"eseoughtantiought ","importoamalg #1 ","fragrances ","Women ","397.83673469387753" +"eseoughtantiought ","importoamalg #1 ","fragrances ","","397.83673469387753" +"eseoughtantiought ","importoamalg #1 ","","","397.83673469387753" +"eseoughtantiought ","","","","397.83673469387753" +"ationn stese ","univamalgamalg #5 ","memory ","Electronics ","398.9583333333333" +"ationn stese ","univamalgamalg #5 ","memory ","","398.9583333333333" +"ationn stese ","univamalgamalg #5 ","","","398.9583333333333" +"ationn stese ","","","","398.9583333333333" +"priationn st ","univnameless #4 ","flatware ","Home ","401.8775510204082" +"priationn st ","univnameless #4 ","flatware ","","401.8775510204082" +"priationn st ","univnameless #4 ","","","401.8775510204082" +"priationn st ","","","","401.8775510204082" +"antiprieingought ","brandbrand #6 ","decor ","Home ","407.44897959183675" +"antiprieingought ","brandbrand #6 ","decor ","","407.44897959183675" +"antiprieingought ","brandbrand #6 ","","","407.44897959183675" +"antiprieingought ","","","","407.44897959183675" +"ationoughteingought ","amalgimporto #2 ","accessories ","Men ","407.53846153846155" +"ationoughteingought ","amalgimporto #2 ","accessories ","","407.53846153846155" +"ationoughteingought ","amalgimporto #2 ","","","407.53846153846155" +"ationoughteingought ","","","","407.53846153846155" +"oughtpri ","scholarmaxi #2 ","fishing ","Sports ","408.15686274509807" +"oughtpri ","scholarmaxi #2 ","fishing ","","408.15686274509807" +"oughtpri ","scholarmaxi #2 ","","","408.15686274509807" +"oughtpri ","","","","408.15686274509807" +"oughtn stableought ","scholarmaxi #8 ","history ","Books ","408.76" +"oughtn stableought ","scholarmaxi #8 ","history ","","408.76" +"oughtn stableought ","scholarmaxi #8 ","","","408.76" +"oughtn stableought ","","","","408.76" +"callyationcallyought ","amalgimporto #1 ","accessories ","Men ","408.9795918367347" +"callyationcallyought ","amalgimporto #1 ","accessories ","","408.9795918367347" +"callyationcallyought ","amalgimporto #1 ","","","408.9795918367347" +"callyationcallyought ","","","","408.9795918367347" +"oughtcallyeingought ","amalgedu pack #2 ","womens ","Shoes ","410.51020408163265" +"oughtcallyeingought ","amalgedu pack #2 ","womens ","","410.51020408163265" +"oughtcallyeingought ","amalgedu pack #2 ","","","410.51020408163265" +"oughtcallyeingought ","","","","410.51020408163265" +"ationeseableought ","amalgscholar #2 ","rock ","Music ","410.921568627451" +"ationeseableought ","amalgscholar #2 ","rock ","","410.921568627451" +"ationeseableought ","amalgscholar #2 ","","","410.921568627451" +"ationeseableought ","","","","410.921568627451" +"eingeingought ","scholarunivamalg #9 ","fiction ","Books ","414.0" +"eingeingought ","scholarunivamalg #9 ","fiction ","","414.0" +"eingeingought ","scholarunivamalg #9 ","","","414.0" +"eingeingought ","","","","414.0" +"oughtanticallyought ","importoamalg #2 ","fragrances ","Women ","414.19607843137254" +"oughtanticallyought ","importoamalg #2 ","fragrances ","","414.19607843137254" +"oughtanticallyought ","importoamalg #2 ","","","414.19607843137254" +"oughtanticallyought ","","","","414.19607843137254" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00023.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00023.sql new file mode 100644 index 00000000000..a4b914950dc --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00023.sql @@ -0,0 +1,89 @@ +WITH + frequent_ss_items AS ( + SELECT + "substr"("i_item_desc", 1, 30) "itemdesc" + , "i_item_sk" "item_sk" + , "d_date" "solddate" + , "count"(*) "cnt" + FROM + store_sales + , date_dim + , item + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("d_year" IN (2000 , (2000 + 1) , (2000 + 2) , (2000 + 3))) + GROUP BY "substr"("i_item_desc", 1, 30), "i_item_sk", "d_date" + HAVING ("count"(*) > 4) +) +, max_store_sales AS ( + SELECT "max"("csales") "tpcds_cmax" + FROM + ( + SELECT + "c_customer_sk" + , "sum"(("ss_quantity" * "ss_sales_price")) "csales" + FROM + store_sales + , customer + , date_dim + WHERE ("ss_customer_sk" = "c_customer_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" IN (2000 , (2000 + 1) , (2000 + 2) , (2000 + 3))) + GROUP BY "c_customer_sk" + ) +) +, best_ss_customer AS ( + SELECT + "c_customer_sk" + , "sum"(("ss_quantity" * "ss_sales_price")) "ssales" + FROM + store_sales + , customer + WHERE ("ss_customer_sk" = "c_customer_sk") + GROUP BY "c_customer_sk" + HAVING ("sum"(("ss_quantity" * "ss_sales_price")) > ((50 / DECIMAL '100.0') * ( + SELECT * + FROM + max_store_sales + ))) +) +SELECT "sum"("sales") +FROM + ( + SELECT ("cs_quantity" * "cs_list_price") "sales" + FROM + catalog_sales + , date_dim + WHERE ("d_year" = 2000) + AND ("d_moy" = 2) + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("cs_item_sk" IN ( + SELECT "item_sk" + FROM + frequent_ss_items + )) + AND ("cs_bill_customer_sk" IN ( + SELECT "c_customer_sk" + FROM + best_ss_customer + )) +UNION ALL SELECT ("ws_quantity" * "ws_list_price") "sales" + FROM + web_sales + , date_dim + WHERE ("d_year" = 2000) + AND ("d_moy" = 2) + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("ws_item_sk" IN ( + SELECT "item_sk" + FROM + frequent_ss_items + )) + AND ("ws_bill_customer_sk" IN ( + SELECT "c_customer_sk" + FROM + best_ss_customer + )) +) +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00023.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00023.txt new file mode 100644 index 00000000000..3cc762b5501 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00023.txt @@ -0,0 +1 @@ +"" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00025.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00025.sql new file mode 100644 index 00000000000..dde90b29565 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00025.sql @@ -0,0 +1,37 @@ +SELECT + "i_item_id" +, "i_item_desc" +, "s_store_id" +, "s_store_name" +, "sum"("ss_net_profit") "store_sales_profit" +, "sum"("sr_net_loss") "store_returns_loss" +, "sum"("cs_net_profit") "catalog_sales_profit" +FROM + store_sales +, store_returns +, catalog_sales +, date_dim d1 +, date_dim d2 +, date_dim d3 +, store +, item +WHERE ("d1"."d_moy" = 4) + AND ("d1"."d_year" = 2001) + AND ("d1"."d_date_sk" = "ss_sold_date_sk") + AND ("i_item_sk" = "ss_item_sk") + AND ("s_store_sk" = "ss_store_sk") + AND ("ss_customer_sk" = "sr_customer_sk") + AND ("ss_item_sk" = "sr_item_sk") + AND ("ss_ticket_number" = "sr_ticket_number") + AND ("sr_returned_date_sk" = "d2"."d_date_sk") + AND ("d2"."d_moy" BETWEEN 4 AND 10) + AND ("d2"."d_year" = 2001) + AND ("sr_customer_sk" = "cs_bill_customer_sk") + AND ("sr_item_sk" = "cs_item_sk") + AND ("cs_sold_date_sk" = "d3"."d_date_sk") + AND ("d3"."d_moy" BETWEEN 4 AND 10) + AND ("d3"."d_year" = 2001) +GROUP BY "i_item_id", "i_item_desc", "s_store_id", "s_store_name" +ORDER BY "i_item_id" ASC, "i_item_desc" ASC, "s_store_id" ASC, "s_store_name" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00025.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00025.txt new file mode 100644 index 00000000000..0daf1223a2b --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00025.txt @@ -0,0 +1 @@ +"AAAAAAAAFMFAAAAA","Normal investments would reduce indeed. Informal, apparent women cannot ensure now seriously structural fears. Previ","AAAAAAAACAAAAAAA","able","73.48","46.86","17.14" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00026.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00026.sql new file mode 100644 index 00000000000..255d1d40f06 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00026.sql @@ -0,0 +1,26 @@ +SELECT + "i_item_id" +, "avg"("cs_quantity") "agg1" +, "avg"("cs_list_price") "agg2" +, "avg"("cs_coupon_amt") "agg3" +, "avg"("cs_sales_price") "agg4" +FROM + catalog_sales +, customer_demographics +, date_dim +, item +, promotion +WHERE ("cs_sold_date_sk" = "d_date_sk") + AND ("cs_item_sk" = "i_item_sk") + AND ("cs_bill_cdemo_sk" = "cd_demo_sk") + AND ("cs_promo_sk" = "p_promo_sk") + AND ("cd_gender" = 'M') + AND ("cd_marital_status" = 'S') + AND ("cd_education_status" = 'College') + AND (("p_channel_email" = 'N') + OR ("p_channel_event" = 'N')) + AND ("d_year" = 2000) +GROUP BY "i_item_id" +ORDER BY "i_item_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00026.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00026.txt new file mode 100644 index 00000000000..b4951e2cc35 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00026.txt @@ -0,0 +1,100 @@ +"AAAAAAAAAAEAAAAA","92.0","94.93","1086.58","92.73" +"AAAAAAAAABDAAAAA","80.0","155.90","0.00","143.42" +"AAAAAAAAABEAAAAA","69.0","32.57","0.00","10.74" +"AAAAAAAAABGAAAAA","43.0","35.23","0.00","7.39" +"AAAAAAAAACAAAAAA","1.0","126.38","0.00","60.66" +"AAAAAAAAADFAAAAA","41.5","147.07","0.00","55.91" +"AAAAAAAAAEHAAAAA","84.0","95.88","0.00","43.14" +"AAAAAAAAAFAAAAAA","26.0","189.89","1193.78","117.73" +"AAAAAAAAAGCAAAAA","45.0","98.79","386.31","86.65" +"AAAAAAAAAGEAAAAA","47.0","125.38","0.00","0.00" +"AAAAAAAAAHDAAAAA","10.0","178.89","0.00","33.98" +"AAAAAAAAAIDAAAAA","17.0","138.34","0.00","26.28" +"AAAAAAAAAJBAAAAA","12.0","27.81","0.00","10.56" +"AAAAAAAAAKGAAAAA","74.0","74.92","0.00","61.43" +"AAAAAAAAAKHAAAAA","11.0","51.33","0.00","39.52" +"AAAAAAAAANBAAAAA","76.0","203.47","0.00","40.69" +"AAAAAAAAAOFAAAAA","22.0","39.74","0.00","10.72" +"AAAAAAAABAGAAAAA","54.0","158.64","814.52","64.50" +"AAAAAAAABCEAAAAA","33.0","52.62","146.71","6.84" +"AAAAAAAABCHAAAAA","81.0","57.96","0.00","18.54" +"AAAAAAAABFEAAAAA","18.0","139.18","0.00","65.41" +"AAAAAAAABHCAAAAA","22.0","79.00","0.00","26.07" +"AAAAAAAABHFAAAAA","45.0","128.27","0.00","59.39" +"AAAAAAAABKCAAAAA","30.0","5.02","0.00","3.56" +"AAAAAAAABLBAAAAA","68.0","98.47","0.00","64.00" +"AAAAAAAABNCAAAAA","1.0","141.23","49.56","91.79" +"AAAAAAAACCBAAAAA","28.0","150.13","0.00","42.03" +"AAAAAAAACCGAAAAA","46.0","161.29","0.00","54.83" +"AAAAAAAACCHAAAAA","34.5","152.09","0.00","76.30" +"AAAAAAAACEEAAAAA","65.0","151.53","0.00","148.49" +"AAAAAAAACFEAAAAA","99.0","10.32","0.00","8.66" +"AAAAAAAACHFAAAAA","21.0","247.01","0.00","167.96" +"AAAAAAAACKBAAAAA","78.0","64.33","1760.61","25.08" +"AAAAAAAACLGAAAAA","31.0","23.72","0.00","16.60" +"AAAAAAAACMCAAAAA","5.0","95.41","9.53","7.63" +"AAAAAAAACMFAAAAA","86.0","136.96","0.00","112.30" +"AAAAAAAACNCAAAAA","44.0","100.65","0.00","63.40" +"AAAAAAAADAEAAAAA","72.0","74.27","0.00","43.81" +"AAAAAAAADDEAAAAA","55.0","100.84","66.55","60.50" +"AAAAAAAADGBAAAAA","24.0","106.51","0.00","100.11" +"AAAAAAAADHDAAAAA","23.0","51.86","0.00","20.22" +"AAAAAAAADJEAAAAA","59.0","42.33","0.00","32.17" +"AAAAAAAADJHAAAAA","88.0","32.84","0.00","16.42" +"AAAAAAAAEAGAAAAA","60.5","71.62","780.85","61.33" +"AAAAAAAAECBAAAAA","76.0","123.41","3364.90","96.25" +"AAAAAAAAECFAAAAA","70.0","161.87","0.00","108.45" +"AAAAAAAAEDBAAAAA","64.0","178.23","0.00","23.16" +"AAAAAAAAEDEAAAAA","70.0","49.07","1012.57","21.59" +"AAAAAAAAEDGAAAAA","78.0","69.35","0.00","21.49" +"AAAAAAAAEEDAAAAA","78.0","57.45","0.00","48.25" +"AAAAAAAAEEFAAAAA","84.0","78.66","0.00","21.23" +"AAAAAAAAEFBAAAAA","44.0","169.31","715.25","86.11" +"AAAAAAAAEFCAAAAA","85.0","90.13","0.00","78.99" +"AAAAAAAAEJBAAAAA","29.0","59.06","0.00","47.83" +"AAAAAAAAEKCAAAAA","31.0","218.88","40.70","26.26" +"AAAAAAAAELCAAAAA","91.0","163.88","668.01","22.94" +"AAAAAAAAENAAAAAA","18.5","94.57","21.81","10.06" +"AAAAAAAAENDAAAAA","96.0","170.77","0.00","29.03" +"AAAAAAAAEOCAAAAA","98.0","16.96","0.00","6.95" +"AAAAAAAAEOFAAAAA","50.0","50.43","0.00","11.09" +"AAAAAAAAEPGAAAAA","23.0","227.42","0.00","120.53" +"AAAAAAAAFACAAAAA","60.0","201.28","0.00","58.37" +"AAAAAAAAFEEAAAAA","100.0","128.78","0.00","5.15" +"AAAAAAAAFGCAAAAA","71.5","65.42","208.18","39.03" +"AAAAAAAAFHHAAAAA","82.0","110.55","0.00","61.90" +"AAAAAAAAFIAAAAAA","37.0","112.88","0.00","28.22" +"AAAAAAAAGBEAAAAA","79.0","21.43","0.00","18.00" +"AAAAAAAAGBHAAAAA","28.0","7.32","0.00","2.85" +"AAAAAAAAGCDAAAAA","76.0","74.32","0.00","20.80" +"AAAAAAAAGCGAAAAA","89.0","41.07","0.00","28.33" +"AAAAAAAAGDHAAAAA","78.5","69.49","0.00","14.23" +"AAAAAAAAGFAAAAAA","24.0","101.59","0.00","92.44" +"AAAAAAAAGGCAAAAA","35.0","285.52","0.00","99.93" +"AAAAAAAAGGEAAAAA","46.5","179.12","912.28","84.43" +"AAAAAAAAGJEAAAAA","37.0","32.31","0.00","11.30" +"AAAAAAAAGLAAAAAA","53.0","37.63","0.00","0.00" +"AAAAAAAAGMEAAAAA","56.0","66.02","0.00","19.14" +"AAAAAAAAGNEAAAAA","56.0","139.23","0.00","38.58" +"AAAAAAAAGOAAAAAA","44.0","164.52","0.00","141.48" +"AAAAAAAAGOGAAAAA","75.0","30.49","0.00","8.23" +"AAAAAAAAHBCAAAAA","50.0","168.32","0.00","143.07" +"AAAAAAAAHCBAAAAA","41.0","61.43","0.00","16.58" +"AAAAAAAAHCHAAAAA","67.0","122.97","0.00","45.49" +"AAAAAAAAHDAAAAAA","75.0","156.91","0.00","109.83" +"AAAAAAAAHFBAAAAA","19.0","117.70","0.00","29.42" +"AAAAAAAAHLBAAAAA","57.0","64.15","0.00","31.43" +"AAAAAAAAHLEAAAAA","72.5","80.22","1996.90","63.12" +"AAAAAAAAHMAAAAAA","53.0","56.43","0.00","41.75" +"AAAAAAAAHMGAAAAA","65.0","68.05","0.00","23.13" +"AAAAAAAAHNCAAAAA","33.5","92.38","343.77","55.59" +"AAAAAAAAHNFAAAAA","33.0","119.97","0.00","88.77" +"AAAAAAAAHPAAAAAA","79.5","64.83","0.00","37.99" +"AAAAAAAAIAGAAAAA","100.0","45.69","2951.20","34.72" +"AAAAAAAAIDCAAAAA","100.0","56.26","2075.85","46.13" +"AAAAAAAAIEBAAAAA","38.0","107.33","0.00","61.17" +"AAAAAAAAIEHAAAAA","57.0","116.90","0.00","9.64" +"AAAAAAAAIFEAAAAA","13.0","173.04","0.00","131.51" +"AAAAAAAAIHBAAAAA","32.0","118.75","3501.47","115.18" +"AAAAAAAAIIBAAAAA","57.0","72.11","0.00","0.00" +"AAAAAAAAIIHAAAAA","88.0","104.86","0.00","52.43" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00027.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00027.sql new file mode 100644 index 00000000000..2486110b0ee --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00027.sql @@ -0,0 +1,33 @@ +SELECT + "i_item_id" +, "s_state" +, GROUPING ("s_state") "g_state" +, "avg"("ss_quantity") "agg1" +, "avg"("ss_list_price") "agg2" +, "avg"("ss_coupon_amt") "agg3" +, "avg"("ss_sales_price") "agg4" +FROM + store_sales +, customer_demographics +, date_dim +, store +, item +WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("ss_cdemo_sk" = "cd_demo_sk") + AND ("cd_gender" = 'M') + AND ("cd_marital_status" = 'S') + AND ("cd_education_status" = 'College') + AND ("d_year" = 2002) + AND ("s_state" IN ( + 'TN' + , 'TN' + , 'TN' + , 'TN' + , 'TN' + , 'TN')) +GROUP BY ROLLUP (i_item_id, s_state) +ORDER BY "i_item_id" ASC, "s_state" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00027.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00027.txt new file mode 100644 index 00000000000..cda3ef49153 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00027.txt @@ -0,0 +1,100 @@ +"AAAAAAAAAAEAAAAA","TN","0","","107.31","","64.38" +"AAAAAAAAAAEAAAAA","","1","","107.31","","64.38" +"AAAAAAAAABBAAAAA","TN","0","78.0","86.99","1098.98","31.31" +"AAAAAAAAABBAAAAA","","1","78.0","86.99","1098.98","31.31" +"AAAAAAAAABHAAAAA","TN","0","77.0","89.23","0.00","53.53" +"AAAAAAAAABHAAAAA","","1","77.0","89.23","0.00","53.53" +"AAAAAAAAACCAAAAA","TN","0","41.5","111.36","0.00","67.13" +"AAAAAAAAACCAAAAA","","1","41.5","111.36","0.00","67.13" +"AAAAAAAAACFAAAAA","TN","0","57.0","49.78","0.00","45.29" +"AAAAAAAAACFAAAAA","","1","57.0","49.78","0.00","45.29" +"AAAAAAAAADBAAAAA","TN","0","58.0","98.23","0.00","46.23" +"AAAAAAAAADBAAAAA","","1","58.0","98.23","0.00","46.23" +"AAAAAAAAAEBAAAAA","TN","0","51.0","4.03","0.00","2.05" +"AAAAAAAAAEBAAAAA","","1","51.0","4.03","0.00","2.05" +"AAAAAAAAAEEAAAAA","TN","0","55.5","50.20","0.00","1.38" +"AAAAAAAAAEEAAAAA","","1","55.5","50.20","0.00","1.38" +"AAAAAAAAAFAAAAAA","TN","0","25.0","149.67","0.00","125.72" +"AAAAAAAAAFAAAAAA","","1","25.0","149.67","0.00","125.72" +"AAAAAAAAAGEAAAAA","TN","0","72.0","95.13","0.00","25.85" +"AAAAAAAAAGEAAAAA","","1","72.0","95.13","0.00","25.85" +"AAAAAAAAAGHAAAAA","TN","0","32.0","149.02","0.00","7.45" +"AAAAAAAAAGHAAAAA","","1","32.0","149.02","0.00","7.45" +"AAAAAAAAAHDAAAAA","TN","0","38.0","14.00","120.39","10.22" +"AAAAAAAAAHDAAAAA","","1","38.0","14.00","120.39","10.22" +"AAAAAAAAAHHAAAAA","TN","0","73.0","112.70","0.00","73.25" +"AAAAAAAAAHHAAAAA","","1","73.0","112.70","0.00","73.25" +"AAAAAAAAALAAAAAA","TN","0","40.0","86.10","0.00","40.46" +"AAAAAAAAALAAAAAA","","1","40.0","86.10","0.00","40.46" +"AAAAAAAAALFAAAAA","TN","0","78.0","100.19","431.27","6.01" +"AAAAAAAAALFAAAAA","","1","78.0","100.19","431.27","6.01" +"AAAAAAAAAMBAAAAA","TN","0","25.0","85.00","0.00","62.90" +"AAAAAAAAAMBAAAAA","","1","25.0","85.00","0.00","62.90" +"AAAAAAAAANBAAAAA","TN","0","20.0","6.70","0.00","4.82" +"AAAAAAAAANBAAAAA","","1","20.0","6.70","0.00","4.82" +"AAAAAAAAANDAAAAA","TN","0","74.0","135.75","0.00","70.59" +"AAAAAAAAANDAAAAA","","1","74.0","135.75","0.00","70.59" +"AAAAAAAAAOCAAAAA","TN","0","84.0","12.12","0.00","11.02" +"AAAAAAAAAOCAAAAA","","1","84.0","12.12","0.00","11.02" +"AAAAAAAAAODAAAAA","TN","0","82.0","61.93","0.00","20.43" +"AAAAAAAAAODAAAAA","","1","82.0","61.93","0.00","20.43" +"AAAAAAAAAOFAAAAA","TN","0","8.0","44.57","0.00","41.00" +"AAAAAAAAAOFAAAAA","","1","8.0","44.57","0.00","41.00" +"AAAAAAAAAOGAAAAA","TN","0","59.0","75.63","0.00","65.04" +"AAAAAAAAAOGAAAAA","","1","59.0","75.63","0.00","65.04" +"AAAAAAAAAPFAAAAA","TN","0","65.0","136.24","717.26","122.61" +"AAAAAAAAAPFAAAAA","","1","65.0","136.24","717.26","122.61" +"AAAAAAAABECAAAAA","TN","0","85.0","100.92","801.97","11.10" +"AAAAAAAABECAAAAA","","1","85.0","100.92","801.97","11.10" +"AAAAAAAABFHAAAAA","TN","0","93.0","47.26","0.00","39.22" +"AAAAAAAABFHAAAAA","","1","93.0","47.26","0.00","39.22" +"AAAAAAAABGGAAAAA","TN","0","62.0","79.76","0.00","15.15" +"AAAAAAAABGGAAAAA","","1","62.0","79.76","0.00","15.15" +"AAAAAAAABHFAAAAA","TN","0","52.0","109.29","4134.06","81.96" +"AAAAAAAABHFAAAAA","","1","52.0","109.29","4134.06","81.96" +"AAAAAAAABIBAAAAA","TN","0","76.5","82.63","535.32","50.80" +"AAAAAAAABIBAAAAA","","1","76.5","82.63","535.32","50.80" +"AAAAAAAABIHAAAAA","TN","0","44.0","158.92","0.00","84.22" +"AAAAAAAABIHAAAAA","","1","44.0","158.92","0.00","84.22" +"AAAAAAAABLBAAAAA","TN","0","61.0","69.02","0.00","35.89" +"AAAAAAAABLBAAAAA","","1","61.0","69.02","0.00","35.89" +"AAAAAAAABMDAAAAA","TN","0","77.0","92.59","0.00","80.43" +"AAAAAAAABMDAAAAA","","1","77.0","92.59","0.00","80.43" +"AAAAAAAABNCAAAAA","TN","0","92.0","46.84","0.00","31.38" +"AAAAAAAABNCAAAAA","","1","92.0","46.84","0.00","31.38" +"AAAAAAAABOBAAAAA","TN","0","45.0","88.53","0.00","5.31" +"AAAAAAAABOBAAAAA","","1","45.0","88.53","0.00","5.31" +"AAAAAAAABPAAAAAA","TN","0","26.0","83.50","0.00","45.92" +"AAAAAAAABPAAAAAA","","1","26.0","83.50","0.00","45.92" +"AAAAAAAABPDAAAAA","TN","0","94.0","11.88","368.48","7.00" +"AAAAAAAABPDAAAAA","","1","94.0","11.88","368.48","7.00" +"AAAAAAAACADAAAAA","TN","0","42.0","69.51","0.00","60.47" +"AAAAAAAACADAAAAA","","1","42.0","69.51","0.00","60.47" +"AAAAAAAACAGAAAAA","TN","0","59.0","69.57","1641.16","29.91" +"AAAAAAAACAGAAAAA","","1","59.0","69.57","1641.16","29.91" +"AAAAAAAACBBAAAAA","TN","0","56.0","100.83","1277.95","46.44" +"AAAAAAAACBBAAAAA","","1","56.0","100.83","1277.95","46.44" +"AAAAAAAACBCAAAAA","TN","0","93.0","21.47","723.92","8.37" +"AAAAAAAACBCAAAAA","","1","93.0","21.47","723.92","8.37" +"AAAAAAAACBFAAAAA","TN","0","32.0","1.55","3.86","0.17" +"AAAAAAAACBFAAAAA","","1","32.0","1.55","3.86","0.17" +"AAAAAAAACCAAAAAA","TN","0","19.0","44.70","0.00","1.34" +"AAAAAAAACCAAAAAA","","1","19.0","44.70","0.00","1.34" +"AAAAAAAACDFAAAAA","TN","0","73.0","2.76","0.00","1.07" +"AAAAAAAACDFAAAAA","","1","73.0","2.76","0.00","1.07" +"AAAAAAAACECAAAAA","TN","0","68.0","110.03","0.00","83.62" +"AAAAAAAACECAAAAA","","1","68.0","110.03","0.00","83.62" +"AAAAAAAACEEAAAAA","TN","0","23.0","65.92","28.75","3.29" +"AAAAAAAACEEAAAAA","","1","23.0","65.92","28.75","3.29" +"AAAAAAAACFBAAAAA","TN","0","36.0","121.77","1178.26","51.14" +"AAAAAAAACFBAAAAA","","1","36.0","121.77","1178.26","51.14" +"AAAAAAAACFDAAAAA","TN","0","31.0","19.83","0.00","18.24" +"AAAAAAAACFDAAAAA","","1","31.0","19.83","0.00","18.24" +"AAAAAAAACFHAAAAA","TN","0","28.0","51.62","0.00","28.90" +"AAAAAAAACFHAAAAA","","1","28.0","51.62","0.00","28.90" +"AAAAAAAACHBAAAAA","TN","0","3.0","75.07","0.00","24.77" +"AAAAAAAACHBAAAAA","","1","3.0","75.07","0.00","24.77" +"AAAAAAAACHEAAAAA","TN","0","82.0","145.02","1859.59","33.35" +"AAAAAAAACHEAAAAA","","1","82.0","145.02","1859.59","33.35" +"AAAAAAAACHFAAAAA","TN","0","99.0","103.86","0.00","47.77" +"AAAAAAAACHFAAAAA","","1","99.0","103.86","0.00","47.77" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00028.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00028.sql new file mode 100644 index 00000000000..b25a875bc4e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00028.sql @@ -0,0 +1,76 @@ +SELECT * +FROM + ( + SELECT + "avg"("ss_list_price") "b1_lp" + , "count"("ss_list_price") "b1_cnt" + , "count"(DISTINCT "ss_list_price") "b1_cntd" + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 0 AND 5) + AND (("ss_list_price" BETWEEN 8 AND (8 + 10)) + OR ("ss_coupon_amt" BETWEEN 459 AND (459 + 1000)) + OR ("ss_wholesale_cost" BETWEEN 57 AND (57 + 20))) +) b1 +, ( + SELECT + "avg"("ss_list_price") "b2_lp" + , "count"("ss_list_price") "b2_cnt" + , "count"(DISTINCT "ss_list_price") "b2_cntd" + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 6 AND 10) + AND (("ss_list_price" BETWEEN 90 AND (90 + 10)) + OR ("ss_coupon_amt" BETWEEN 2323 AND (2323 + 1000)) + OR ("ss_wholesale_cost" BETWEEN 31 AND (31 + 20))) +) b2 +, ( + SELECT + "avg"("ss_list_price") "b3_lp" + , "count"("ss_list_price") "b3_cnt" + , "count"(DISTINCT "ss_list_price") "b3_cntd" + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 11 AND 15) + AND (("ss_list_price" BETWEEN 142 AND (142 + 10)) + OR ("ss_coupon_amt" BETWEEN 12214 AND (12214 + 1000)) + OR ("ss_wholesale_cost" BETWEEN 79 AND (79 + 20))) +) b3 +, ( + SELECT + "avg"("ss_list_price") "b4_lp" + , "count"("ss_list_price") "b4_cnt" + , "count"(DISTINCT "ss_list_price") "b4_cntd" + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 16 AND 20) + AND (("ss_list_price" BETWEEN 135 AND (135 + 10)) + OR ("ss_coupon_amt" BETWEEN 6071 AND (6071 + 1000)) + OR ("ss_wholesale_cost" BETWEEN 38 AND (38 + 20))) +) b4 +, ( + SELECT + "avg"("ss_list_price") "b5_lp" + , "count"("ss_list_price") "b5_cnt" + , "count"(DISTINCT "ss_list_price") "b5_cntd" + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 21 AND 25) + AND (("ss_list_price" BETWEEN 122 AND (122 + 10)) + OR ("ss_coupon_amt" BETWEEN 836 AND (836 + 1000)) + OR ("ss_wholesale_cost" BETWEEN 17 AND (17 + 20))) +) b5 +, ( + SELECT + "avg"("ss_list_price") "b6_lp" + , "count"("ss_list_price") "b6_cnt" + , "count"(DISTINCT "ss_list_price") "b6_cntd" + FROM + store_sales + WHERE ("ss_quantity" BETWEEN 26 AND 30) + AND (("ss_list_price" BETWEEN 154 AND (154 + 10)) + OR ("ss_coupon_amt" BETWEEN 7326 AND (7326 + 1000)) + OR ("ss_wholesale_cost" BETWEEN 7 AND (7 + 20))) +) b6 +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00028.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00028.txt new file mode 100644 index 00000000000..e9cecd01777 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00028.txt @@ -0,0 +1 @@ +"77.93","1468","1345","69.55","1518","1331","134.06","1167","1107","81.56","1258","1158","60.27","1523","1342","38.99","1322","1152" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00029.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00029.sql new file mode 100644 index 00000000000..57bbb2bedf5 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00029.sql @@ -0,0 +1,36 @@ +SELECT + "i_item_id" +, "i_item_desc" +, "s_store_id" +, "s_store_name" +, "sum"("ss_quantity") "store_sales_quantity" +, "sum"("sr_return_quantity") "store_returns_quantity" +, "sum"("cs_quantity") "catalog_sales_quantity" +FROM + store_sales +, store_returns +, catalog_sales +, date_dim d1 +, date_dim d2 +, date_dim d3 +, store +, item +WHERE ("d1"."d_moy" = 9) + AND ("d1"."d_year" = 1999) + AND ("d1"."d_date_sk" = "ss_sold_date_sk") + AND ("i_item_sk" = "ss_item_sk") + AND ("s_store_sk" = "ss_store_sk") + AND ("ss_customer_sk" = "sr_customer_sk") + AND ("ss_item_sk" = "sr_item_sk") + AND ("ss_ticket_number" = "sr_ticket_number") + AND ("sr_returned_date_sk" = "d2"."d_date_sk") + AND ("d2"."d_moy" BETWEEN 9 AND (9 + 3)) + AND ("d2"."d_year" = 1999) + AND ("sr_customer_sk" = "cs_bill_customer_sk") + AND ("sr_item_sk" = "cs_item_sk") + AND ("cs_sold_date_sk" = "d3"."d_date_sk") + AND ("d3"."d_year" IN (1999, (1999 + 1), (1999 + 2))) +GROUP BY "i_item_id", "i_item_desc", "s_store_id", "s_store_name" +ORDER BY "i_item_id" ASC, "i_item_desc" ASC, "s_store_id" ASC, "s_store_name" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00029.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00029.txt new file mode 100644 index 00000000000..f404bb8a424 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00029.txt @@ -0,0 +1,2 @@ +"AAAAAAAACGGAAAAA","New, thin workshops might enhance considerably pregnant doors. Therefore middle periods ought to make often bi","AAAAAAAACAAAAAAA","able","9","7","36" +"AAAAAAAAKAHAAAAA","Long, fine teachers should not occur. Particular, monetary children organise in situ on to a tests; details ma","AAAAAAAABAAAAAAA","ought","34","1","75" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00030.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00030.sql new file mode 100644 index 00000000000..fde54b12bff --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00030.sql @@ -0,0 +1,45 @@ +WITH + customer_total_return AS ( + SELECT + "wr_returning_customer_sk" "ctr_customer_sk" + , "ca_state" "ctr_state" + , "sum"("wr_return_amt") "ctr_total_return" + FROM + web_returns + , date_dim + , customer_address + WHERE ("wr_returned_date_sk" = "d_date_sk") + AND ("d_year" = 2002) + AND ("wr_returning_addr_sk" = "ca_address_sk") + GROUP BY "wr_returning_customer_sk", "ca_state" +) +SELECT + "c_customer_id" +, "c_salutation" +, "c_first_name" +, "c_last_name" +, "c_preferred_cust_flag" +, "c_birth_day" +, "c_birth_month" +, "c_birth_year" +, "c_birth_country" +, "c_login" +, "c_email_address" +, "c_last_review_date_sk" +, "ctr_total_return" +FROM + customer_total_return ctr1 +, customer_address +, customer +WHERE ("ctr1"."ctr_total_return" > ( + SELECT ("avg"("ctr_total_return") * DECIMAL '1.2') + FROM + customer_total_return ctr2 + WHERE ("ctr1"."ctr_state" = "ctr2"."ctr_state") + )) + AND ("ca_address_sk" = "c_current_addr_sk") + AND ("ca_state" = 'GA') + AND ("ctr1"."ctr_customer_sk" = "c_customer_sk") +ORDER BY "c_customer_id" ASC, "c_salutation" ASC, "c_first_name" ASC, "c_last_name" ASC, "c_preferred_cust_flag" ASC, "c_birth_day" ASC, "c_birth_month" ASC, "c_birth_year" ASC, "c_birth_country" ASC, "c_login" ASC, "c_email_address" ASC, "c_last_review_date_sk" ASC, "ctr_total_return" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00030.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00030.txt new file mode 100644 index 00000000000..f9bc2fb244d --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00030.txt @@ -0,0 +1,4 @@ +"AAAAAAAABBCAAAAA","Sir ","Michael ","Herring ","Y","20","9","1932","AMERICAN SAMOA","","Michael.Herring@jl5PTAS.com ","2452300","2306.71" +"AAAAAAAABFAAAAAA","Ms. ","Jessica ","Levesque ","Y","17","7","1940","ALBANIA","","Jessica.Levesque@06mGqI9mHG.org ","2452414","10628.66" +"AAAAAAAAIOCAAAAA","Dr. ","Julio ","Mcdaniel ","Y","18","4","1952","UNITED STATES","","Julio.Mcdaniel@2Hc.edu ","2452455","3140.58" +"AAAAAAAAKIBAAAAA","Ms. ","Brenda ","Miner ","N","8","5","1979","PARAGUAY","","Brenda.Miner@8L.edu ","2452440","834.48" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00032.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00032.sql new file mode 100644 index 00000000000..1ef355c42a9 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00032.sql @@ -0,0 +1,20 @@ +SELECT "sum"("cs_ext_discount_amt") "excess discount amount" +FROM + catalog_sales +, item +, date_dim +WHERE ("i_manufact_id" = 977) + AND ("i_item_sk" = "cs_item_sk") + AND ("d_date" BETWEEN CAST('2000-01-27' AS DATE) AND (CAST('2000-01-27' AS DATE) + INTERVAL '90' DAY)) + AND ("d_date_sk" = "cs_sold_date_sk") + AND ("cs_ext_discount_amt" > ( + SELECT (DECIMAL '1.3' * "avg"("cs_ext_discount_amt")) + FROM + catalog_sales + , date_dim + WHERE ("cs_item_sk" = "i_item_sk") + AND ("d_date" BETWEEN CAST('2000-01-27' AS DATE) AND (CAST('2000-01-27' AS DATE) + INTERVAL '90' DAY)) + AND ("d_date_sk" = "cs_sold_date_sk") + )) +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00032.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00032.txt new file mode 100644 index 00000000000..3cc762b5501 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00032.txt @@ -0,0 +1 @@ +"" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00033.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00033.sql new file mode 100644 index 00000000000..ffc925df8fd --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00033.sql @@ -0,0 +1,89 @@ +WITH + ss AS ( + SELECT + "i_manufact_id" + , "sum"("ss_ext_sales_price") "total_sales" + FROM + store_sales + , date_dim + , customer_address + , item + WHERE ("i_manufact_id" IN ( + SELECT "i_manufact_id" + FROM + item + WHERE ("i_category" IN ('Electronics')) + )) + AND ("ss_item_sk" = "i_item_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = 1998) + AND ("d_moy" = 5) + AND ("ss_addr_sk" = "ca_address_sk") + AND ("ca_gmt_offset" = -5) + GROUP BY "i_manufact_id" +) +, cs AS ( + SELECT + "i_manufact_id" + , "sum"("cs_ext_sales_price") "total_sales" + FROM + catalog_sales + , date_dim + , customer_address + , item + WHERE ("i_manufact_id" IN ( + SELECT "i_manufact_id" + FROM + item + WHERE ("i_category" IN ('Electronics')) + )) + AND ("cs_item_sk" = "i_item_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("d_year" = 1998) + AND ("d_moy" = 5) + AND ("cs_bill_addr_sk" = "ca_address_sk") + AND ("ca_gmt_offset" = -5) + GROUP BY "i_manufact_id" +) +, ws AS ( + SELECT + "i_manufact_id" + , "sum"("ws_ext_sales_price") "total_sales" + FROM + web_sales + , date_dim + , customer_address + , item + WHERE ("i_manufact_id" IN ( + SELECT "i_manufact_id" + FROM + item + WHERE ("i_category" IN ('Electronics')) + )) + AND ("ws_item_sk" = "i_item_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" = 1998) + AND ("d_moy" = 5) + AND ("ws_bill_addr_sk" = "ca_address_sk") + AND ("ca_gmt_offset" = -5) + GROUP BY "i_manufact_id" +) +SELECT + "i_manufact_id" +, "sum"("total_sales") "total_sales" +FROM + ( + SELECT * + FROM + ss +UNION ALL SELECT * + FROM + cs +UNION ALL SELECT * + FROM + ws +) tmp1 +GROUP BY "i_manufact_id" +ORDER BY "total_sales" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00033.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00033.txt new file mode 100644 index 00000000000..c20d19d619f --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00033.txt @@ -0,0 +1,100 @@ +"609","0.00" +"590","37.31" +"229","49.14" +"171","90.56" +"350","193.17" +"289","199.59" +"428","215.97" +"342","346.48" +"954","426.87" +"740","452.89" +"477","462.40" +"842","530.28" +"82","532.08" +"224","579.14" +"385","589.77" +"118","645.21" +"143","661.08" +"865","701.64" +"928","764.25" +"523","855.30" +"105","855.89" +"307","942.20" +"263","1018.82" +"182","1059.52" +"502","1085.26" +"412","1114.10" +"159","1120.50" +"169","1185.68" +"391","1589.90" +"576","1593.20" +"201","1632.79" +"470","1687.97" +"456","1740.88" +"702","1746.78" +"306","1802.40" +"147","1857.85" +"79","1861.62" +"207","1910.29" +"369","1914.14" +"133","1932.83" +"380","1935.01" +"140","1980.30" +"778","2126.38" +"60","2143.31" +"813","2280.60" +"218","2411.03" +"141","2525.34" +"480","2590.90" +"545","2659.05" +"89","2689.98" +"57","2770.18" +"872","2884.68" +"316","3074.43" +"594","3078.70" +"579","3106.78" +"568","3168.96" +"223","3233.58" +"198","3242.29" +"77","3245.10" +"149","3467.12" +"295","3683.20" +"251","3754.33" +"107","3782.62" +"185","4017.12" +"303","4065.96" +"9","4103.18" +"352","4243.56" +"240","4282.28" +"21","4343.59" +"28","4422.90" +"269","4463.70" +"318","4582.29" +"392","4688.40" +"499","4825.70" +"68","4872.96" +"255","4932.42" +"466","5076.37" +"191","5161.86" +"236","5393.22" +"69","5661.58" +"542","5877.20" +"26","6068.07" +"504","6128.07" +"638","6225.80" +"503","6251.63" +"227","7153.35" +"230","7351.84" +"288","7964.21" +"175","8126.42" +"74","8229.42" +"181","8455.90" +"267","8591.11" +"302","8764.56" +"55","8795.90" +"88","8970.21" +"334","9221.46" +"173","9347.89" +"110","9480.26" +"145","9582.67" +"41","9604.11" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00034.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00034.sql new file mode 100644 index 00000000000..7e9236b1138 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00034.sql @@ -0,0 +1,36 @@ +SELECT + "c_last_name" +, "c_first_name" +, "c_salutation" +, "c_preferred_cust_flag" +, "ss_ticket_number" +, "cnt" +FROM + ( + SELECT + "ss_ticket_number" + , "ss_customer_sk" + , "count"(*) "cnt" + 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 (("date_dim"."d_dom" BETWEEN 1 AND 3) + OR ("date_dim"."d_dom" BETWEEN 25 AND 28)) + AND (("household_demographics"."hd_buy_potential" = '>10000') + OR ("household_demographics"."hd_buy_potential" = 'Unknown')) + AND ("household_demographics"."hd_vehicle_count" > 0) + AND ((CASE WHEN ("household_demographics"."hd_vehicle_count" > 0) THEN (CAST("household_demographics"."hd_dep_count" AS DECIMAL(7,2)) / "household_demographics"."hd_vehicle_count") ELSE null END) > DECIMAL '1.2') + AND ("date_dim"."d_year" IN (1999 , (1999 + 1) , (1999 + 2))) + AND ("store"."s_county" IN ('Williamson County' , 'Williamson County' , 'Williamson County' , 'Williamson County' , 'Williamson County' , 'Williamson County' , 'Williamson County' , 'Williamson County')) + GROUP BY "ss_ticket_number", "ss_customer_sk" +) dn +, customer +WHERE ("ss_customer_sk" = "c_customer_sk") + AND ("cnt" BETWEEN 15 AND 20) +ORDER BY "c_last_name" ASC, "c_first_name" ASC, "c_salutation" ASC, "c_preferred_cust_flag" DESC, "ss_ticket_number" ASC +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00034.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00034.txt new file mode 100644 index 00000000000..49f7a4fc5f9 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00034.txt @@ -0,0 +1,19 @@ +"Brown ","Michael ","Sir ","N","7856","15" +"Brunson ","Albert ","Ms. ","N","3324","15" +"Gentry ","Russell ","Sir ","N","7184","15" +"Hart ","","","Y","4376","15" +"Holland ","Delia ","Miss ","N","6311","15" +"Hudson ","Malcolm ","Mr. ","Y","9979","15" +"Kilgore ","Stephanie ","Miss ","N","7269","16" +"Lacey ","Allen ","Miss ","Y","2490","15" +"Prather ","Shawn ","Dr. ","N","5723","15" +"Rivers ","Carlos ","Sir ","N","5587","15" +"Robbins ","Ruth ","Ms. ","N","60","15" +"Roberson ","Minnie ","Dr. ","Y","2730","15" +"Sanderson ","Sean ","Sir ","N","3754","15" +"Scroggins ","Floyd ","Sir ","Y","6580","15" +"Smith ","Darnell ","Mr. ","N","2698","15" +"Smith ","Peter ","Dr. ","Y","9370","15" +"Wall ","Lori ","Miss ","Y","7880","15" +"Wise ","Doris ","Ms. ","Y","5917","15" +"","Ernestina ","","","224","16" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00035.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00035.sql new file mode 100644 index 00000000000..fbc35e741f1 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00035.sql @@ -0,0 +1,59 @@ +SELECT + "ca_state" +, "cd_gender" +, "cd_marital_status" +, "cd_dep_count" +, "count"(*) "cnt1" +, "min"("cd_dep_count") +, "max"("cd_dep_count") +, "avg"("cd_dep_count") +, "cd_dep_employed_count" +, "count"(*) "cnt2" +, "min"("cd_dep_employed_count") +, "max"("cd_dep_employed_count") +, "avg"("cd_dep_employed_count") +, "cd_dep_college_count" +, "count"(*) "cnt3" +, "min"("cd_dep_college_count") +, "max"("cd_dep_college_count") +, "avg"("cd_dep_college_count") +FROM + customer c +, customer_address ca +, customer_demographics +WHERE ("c"."c_current_addr_sk" = "ca"."ca_address_sk") + AND ("cd_demo_sk" = "c"."c_current_cdemo_sk") + AND (EXISTS ( + SELECT * + FROM + store_sales + , date_dim + WHERE ("c"."c_customer_sk" = "ss_customer_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2002) + AND ("d_qoy" < 4) +)) + AND ((EXISTS ( + SELECT * + FROM + web_sales + , date_dim + WHERE ("c"."c_customer_sk" = "ws_bill_customer_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2002) + AND ("d_qoy" < 4) + )) + OR (EXISTS ( + SELECT * + FROM + catalog_sales + , date_dim + WHERE ("c"."c_customer_sk" = "cs_ship_customer_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2002) + AND ("d_qoy" < 4) + ))) +GROUP BY "ca_state", "cd_gender", "cd_marital_status", "cd_dep_count", "cd_dep_employed_count", "cd_dep_college_count" +ORDER BY "ca_state" ASC, "cd_gender" ASC, "cd_marital_status" ASC, "cd_dep_count" ASC, "cd_dep_employed_count" ASC, "cd_dep_college_count" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00035.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00035.txt new file mode 100644 index 00000000000..05f69e9d918 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00035.txt @@ -0,0 +1,100 @@ +"AK","M","D","5","1","5","5","5.0","2","1","2","2","2.0","1","1","1","1","1.0" +"AL","F","D","0","1","0","0","0.0","0","1","0","0","0.0","3","1","3","3","3.0" +"AL","F","U","0","1","0","0","0.0","4","1","4","4","4.0","3","1","3","3","3.0" +"AL","F","W","4","1","4","4","4.0","1","1","1","1","1.0","1","1","1","1","1.0" +"AL","M","D","0","1","0","0","0.0","0","1","0","0","0.0","5","1","5","5","5.0" +"AL","M","D","0","1","0","0","0.0","4","1","4","4","4.0","4","1","4","4","4.0" +"AL","M","D","5","1","5","5","5.0","3","1","3","3","3.0","3","1","3","3","3.0" +"AL","M","M","2","1","2","2","2.0","1","1","1","1","1.0","1","1","1","1","1.0" +"AL","M","M","3","1","3","3","3.0","5","1","5","5","5.0","6","1","6","6","6.0" +"AL","M","S","4","1","4","4","4.0","1","1","1","1","1.0","2","1","2","2","2.0" +"AL","M","U","0","1","0","0","0.0","3","1","3","3","3.0","3","1","3","3","3.0" +"AL","M","U","1","1","1","1","1.0","3","1","3","3","3.0","3","1","3","3","3.0" +"AR","F","M","5","1","5","5","5.0","1","1","1","1","1.0","3","1","3","3","3.0" +"AR","F","S","2","1","2","2","2.0","6","1","6","6","6.0","1","1","1","1","1.0" +"AR","F","S","4","1","4","4","4.0","2","1","2","2","2.0","2","1","2","2","2.0" +"AR","F","S","5","1","5","5","5.0","1","1","1","1","1.0","4","1","4","4","4.0" +"AR","F","S","5","1","5","5","5.0","2","1","2","2","2.0","2","1","2","2","2.0" +"AR","F","W","3","1","3","3","3.0","2","1","2","2","2.0","2","1","2","2","2.0" +"AR","M","D","4","1","4","4","4.0","0","1","0","0","0.0","5","1","5","5","5.0" +"AR","M","M","1","1","1","1","1.0","3","1","3","3","3.0","2","1","2","2","2.0" +"AR","M","U","3","1","3","3","3.0","0","1","0","0","0.0","2","1","2","2","2.0" +"AR","M","W","6","1","6","6","6.0","1","1","1","1","1.0","6","1","6","6","6.0" +"AZ","F","U","2","1","2","2","2.0","6","1","6","6","6.0","2","1","2","2","2.0" +"CA","F","D","1","1","1","1","1.0","2","1","2","2","2.0","1","1","1","1","1.0" +"CA","F","M","0","1","0","0","0.0","2","1","2","2","2.0","6","1","6","6","6.0" +"CA","F","S","3","1","3","3","3.0","0","1","0","0","0.0","6","1","6","6","6.0" +"CA","M","M","4","1","4","4","4.0","5","1","5","5","5.0","2","1","2","2","2.0" +"CA","M","M","6","1","6","6","6.0","4","1","4","4","4.0","3","1","3","3","3.0" +"CA","M","S","5","1","5","5","5.0","2","1","2","2","2.0","4","1","4","4","4.0" +"CO","F","M","1","1","1","1","1.0","3","1","3","3","3.0","6","1","6","6","6.0" +"CO","F","M","5","1","5","5","5.0","2","1","2","2","2.0","0","1","0","0","0.0" +"CO","F","S","2","1","2","2","2.0","0","1","0","0","0.0","6","1","6","6","6.0" +"CO","F","U","4","1","4","4","4.0","5","1","5","5","5.0","4","1","4","4","4.0" +"CO","F","W","1","1","1","1","1.0","6","1","6","6","6.0","4","1","4","4","4.0" +"CO","M","D","0","1","0","0","0.0","0","1","0","0","0.0","1","1","1","1","1.0" +"CO","M","S","4","1","4","4","4.0","5","1","5","5","5.0","4","1","4","4","4.0" +"CO","M","U","2","1","2","2","2.0","0","1","0","0","0.0","4","1","4","4","4.0" +"CO","M","U","3","1","3","3","3.0","5","1","5","5","5.0","0","1","0","0","0.0" +"CO","M","W","5","1","5","5","5.0","1","1","1","1","1.0","4","1","4","4","4.0" +"CT","F","D","1","1","1","1","1.0","0","1","0","0","0.0","2","1","2","2","2.0" +"CT","F","M","6","1","6","6","6.0","1","1","1","1","1.0","4","1","4","4","4.0" +"CT","M","W","2","1","2","2","2.0","0","1","0","0","0.0","1","1","1","1","1.0" +"FL","F","S","0","1","0","0","0.0","1","1","1","1","1.0","1","1","1","1","1.0" +"FL","F","S","2","1","2","2","2.0","5","1","5","5","5.0","3","1","3","3","3.0" +"FL","F","S","3","1","3","3","3.0","1","1","1","1","1.0","2","1","2","2","2.0" +"FL","F","U","2","1","2","2","2.0","4","1","4","4","4.0","3","1","3","3","3.0" +"FL","F","W","3","1","3","3","3.0","2","1","2","2","2.0","1","1","1","1","1.0" +"FL","F","W","6","1","6","6","6.0","5","1","5","5","5.0","1","1","1","1","1.0" +"FL","M","D","5","1","5","5","5.0","2","1","2","2","2.0","4","1","4","4","4.0" +"FL","M","M","1","1","1","1","1.0","1","1","1","1","1.0","1","1","1","1","1.0" +"FL","M","S","3","1","3","3","3.0","0","1","0","0","0.0","2","1","2","2","2.0" +"FL","M","U","2","1","2","2","2.0","0","1","0","0","0.0","5","1","5","5","5.0" +"GA","F","D","3","1","3","3","3.0","3","1","3","3","3.0","3","1","3","3","3.0" +"GA","F","D","3","1","3","3","3.0","5","1","5","5","5.0","3","1","3","3","3.0" +"GA","F","D","3","1","3","3","3.0","6","1","6","6","6.0","3","1","3","3","3.0" +"GA","F","D","6","1","6","6","6.0","0","1","0","0","0.0","5","1","5","5","5.0" +"GA","F","M","0","1","0","0","0.0","5","1","5","5","5.0","0","1","0","0","0.0" +"GA","F","M","1","1","1","1","1.0","4","1","4","4","4.0","0","1","0","0","0.0" +"GA","F","M","4","1","4","4","4.0","0","1","0","0","0.0","4","1","4","4","4.0" +"GA","F","M","5","1","5","5","5.0","0","1","0","0","0.0","1","1","1","1","1.0" +"GA","F","M","6","1","6","6","6.0","3","1","3","3","3.0","4","1","4","4","4.0" +"GA","F","M","6","1","6","6","6.0","5","1","5","5","5.0","6","1","6","6","6.0" +"GA","F","M","6","1","6","6","6.0","6","1","6","6","6.0","1","1","1","1","1.0" +"GA","F","S","5","1","5","5","5.0","1","1","1","1","1.0","3","1","3","3","3.0" +"GA","F","U","0","1","0","0","0.0","0","1","0","0","0.0","5","1","5","5","5.0" +"GA","F","U","1","1","1","1","1.0","6","1","6","6","6.0","0","1","0","0","0.0" +"GA","F","W","3","1","3","3","3.0","0","1","0","0","0.0","5","1","5","5","5.0" +"GA","F","W","3","1","3","3","3.0","2","1","2","2","2.0","3","1","3","3","3.0" +"GA","F","W","4","1","4","4","4.0","0","1","0","0","0.0","0","1","0","0","0.0" +"GA","M","D","1","1","1","1","1.0","5","1","5","5","5.0","3","1","3","3","3.0" +"GA","M","M","0","1","0","0","0.0","3","1","3","3","3.0","0","1","0","0","0.0" +"GA","M","M","2","1","2","2","2.0","0","1","0","0","0.0","0","1","0","0","0.0" +"GA","M","M","3","1","3","3","3.0","2","1","2","2","2.0","4","1","4","4","4.0" +"GA","M","U","1","1","1","1","1.0","2","1","2","2","2.0","6","1","6","6","6.0" +"GA","M","U","1","1","1","1","1.0","5","1","5","5","5.0","2","1","2","2","2.0" +"GA","M","W","2","1","2","2","2.0","1","1","1","1","1.0","5","1","5","5","5.0" +"GA","M","W","3","1","3","3","3.0","1","1","1","1","1.0","5","1","5","5","5.0" +"IA","F","D","0","1","0","0","0.0","0","1","0","0","0.0","1","1","1","1","1.0" +"IA","F","D","0","1","0","0","0.0","2","1","2","2","2.0","4","1","4","4","4.0" +"IA","F","M","3","1","3","3","3.0","4","1","4","4","4.0","3","1","3","3","3.0" +"IA","F","M","5","1","5","5","5.0","0","1","0","0","0.0","4","1","4","4","4.0" +"IA","F","M","6","1","6","6","6.0","3","1","3","3","3.0","1","1","1","1","1.0" +"IA","F","S","0","1","0","0","0.0","6","1","6","6","6.0","2","1","2","2","2.0" +"IA","F","W","2","1","2","2","2.0","3","1","3","3","3.0","5","1","5","5","5.0" +"IA","M","D","1","1","1","1","1.0","0","1","0","0","0.0","1","1","1","1","1.0" +"IA","M","D","2","1","2","2","2.0","4","1","4","4","4.0","5","1","5","5","5.0" +"IA","M","M","1","1","1","1","1.0","4","1","4","4","4.0","4","1","4","4","4.0" +"IA","M","M","4","1","4","4","4.0","5","1","5","5","5.0","5","1","5","5","5.0" +"IA","M","S","0","1","0","0","0.0","5","1","5","5","5.0","2","1","2","2","2.0" +"IA","M","S","3","1","3","3","3.0","4","1","4","4","4.0","1","1","1","1","1.0" +"IA","M","S","5","1","5","5","5.0","3","1","3","3","3.0","5","1","5","5","5.0" +"IA","M","U","4","1","4","4","4.0","3","1","3","3","3.0","1","1","1","1","1.0" +"IA","M","W","3","1","3","3","3.0","5","1","5","5","5.0","3","1","3","3","3.0" +"IA","M","W","3","1","3","3","3.0","6","1","6","6","6.0","4","1","4","4","4.0" +"IA","M","W","5","1","5","5","5.0","1","1","1","1","1.0","0","1","0","0","0.0" +"ID","F","D","2","1","2","2","2.0","3","1","3","3","3.0","4","1","4","4","4.0" +"ID","F","D","4","1","4","4","4.0","6","1","6","6","6.0","6","1","6","6","6.0" +"ID","F","S","4","1","4","4","4.0","1","1","1","1","1.0","6","1","6","6","6.0" +"ID","M","M","0","1","0","0","0.0","4","1","4","4","4.0","6","1","6","6","6.0" +"ID","M","M","4","1","4","4","4.0","1","1","1","1","1.0","3","1","3","3","3.0" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00036.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00036.sql new file mode 100644 index 00000000000..bb2b27e58c2 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00036.sql @@ -0,0 +1,28 @@ +SELECT + ("sum"("ss_net_profit") / "sum"("ss_ext_sales_price")) "gross_margin" +, "i_category" +, "i_class" +, (GROUPING ("i_category") + GROUPING ("i_class")) "lochierarchy" +, "rank"() OVER (PARTITION BY (GROUPING ("i_category") + GROUPING ("i_class")), (CASE WHEN (GROUPING ("i_class") = 0) THEN "i_category" END) ORDER BY ("sum"("ss_net_profit") / "sum"("ss_ext_sales_price")) ASC) "rank_within_parent" +FROM + store_sales +, date_dim d1 +, item +, store +WHERE ("d1"."d_year" = 2001) + AND ("d1"."d_date_sk" = "ss_sold_date_sk") + AND ("i_item_sk" = "ss_item_sk") + AND ("s_store_sk" = "ss_store_sk") + AND ("s_state" IN ( + 'TN' + , 'TN' + , 'TN' + , 'TN' + , 'TN' + , 'TN' + , 'TN' + , 'TN')) +GROUP BY ROLLUP (i_category, i_class) +ORDER BY "lochierarchy" DESC, (CASE WHEN ("lochierarchy" = 0) THEN "i_category" END) ASC, "rank_within_parent" ASC, "i_category", "i_class" +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00036.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00036.txt new file mode 100644 index 00000000000..fb9b28c0962 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00036.txt @@ -0,0 +1,100 @@ +"-0.43","","","2","1" +"-0.45","Books ","","1","1" +"-0.45","Men ","","1","1" +"-0.45","Music ","","1","1" +"-0.45","Shoes ","","1","1" +"-0.45","","","1","1" +"-0.44","Sports ","","1","6" +"-0.44","Women ","","1","6" +"-0.42","Children ","","1","8" +"-0.42","Home ","","1","8" +"-0.42","Jewelry ","","1","8" +"-0.41","Electronics ","","1","11" +"-0.66","Books ","self-help ","0","1" +"-0.55","Books ","reference ","0","2" +"-0.54","Books ","fiction ","0","3" +"-0.52","Books ","romance ","0","4" +"-0.52","Books ","sports ","0","4" +"-0.48","Books ","parenting ","0","6" +"-0.45","Books ","cooking ","0","7" +"-0.43","Books ","history ","0","8" +"-0.42","Books ","entertainments ","0","9" +"-0.41","Books ","home repair ","0","10" +"-0.40","Books ","travel ","0","11" +"-0.39","Books ","arts ","0","12" +"-0.38","Books ","science ","0","13" +"-0.36","Books ","computers ","0","14" +"-0.34","Books ","mystery ","0","15" +"-0.25","Books ","business ","0","16" +"-0.49","Children ","toddlers ","0","1" +"-0.44","Children ","newborn ","0","2" +"-0.40","Children ","school-uniforms ","0","3" +"-0.34","Children ","infants ","0","4" +"-0.74","Electronics ","scanners ","0","1" +"-0.61","Electronics ","portable ","0","2" +"-0.49","Electronics ","disk drives ","0","3" +"-0.49","Electronics ","karoke ","0","3" +"-0.48","Electronics ","cameras ","0","5" +"-0.45","Electronics ","televisions ","0","6" +"-0.41","Electronics ","monitors ","0","7" +"-0.41","Electronics ","musical ","0","7" +"-0.41","Electronics ","stereo ","0","7" +"-0.41","Electronics ","wireless ","0","7" +"-0.39","Electronics ","memory ","0","11" +"-0.38","Electronics ","camcorders ","0","12" +"-0.34","Electronics ","personal ","0","13" +"-0.33","Electronics ","audio ","0","14" +"-0.29","Electronics ","automotive ","0","15" +"-0.29","Electronics ","dvd/vcr players ","0","15" +"-0.68","Home ","glassware ","0","1" +"-0.56","Home ","accent ","0","2" +"-0.54","Home ","lighting ","0","3" +"-0.50","Home ","furniture ","0","4" +"-0.50","Home ","mattresses ","0","4" +"-0.48","Home ","kids ","0","6" +"-0.43","Home ","decor ","0","7" +"-0.41","Home ","flatware ","0","8" +"-0.41","Home ","paint ","0","8" +"-0.41","Home ","wallpaper ","0","8" +"-0.34","Home ","blinds/shades ","0","11" +"-0.34","Home ","curtains/drapes ","0","11" +"-0.33","Home ","bathroom ","0","13" +"-0.33","Home ","rugs ","0","13" +"-0.33","Home ","tables ","0","13" +"-0.32","Home ","bedding ","0","16" +"-0.78","Jewelry ","mens watch ","0","1" +"-0.57","Jewelry ","diamonds ","0","2" +"-0.52","Jewelry ","loose stones ","0","3" +"-0.50","Jewelry ","semi-precious ","0","4" +"-0.48","Jewelry ","womens watch ","0","5" +"-0.47","Jewelry ","custom ","0","6" +"-0.46","Jewelry ","costume ","0","7" +"-0.44","Jewelry ","earings ","0","8" +"-0.44","Jewelry ","gold ","0","8" +"-0.42","Jewelry ","estate ","0","10" +"-0.32","Jewelry ","bracelets ","0","11" +"-0.32","Jewelry ","consignment ","0","11" +"-0.32","Jewelry ","jewelry boxes ","0","11" +"-0.31","Jewelry ","pendants ","0","14" +"-0.29","Jewelry ","birdal ","0","15" +"-0.20","Jewelry ","rings ","0","16" +"-0.54","Men ","accessories ","0","1" +"-0.44","Men ","sports-apparel ","0","2" +"-0.42","Men ","shirts ","0","3" +"-0.40","Men ","pants ","0","4" +"-0.50","Music ","rock ","0","1" +"-0.45","Music ","country ","0","2" +"-0.44","Music ","classical ","0","3" +"-0.42","Music ","pop ","0","4" +"-0.52","Shoes ","kids ","0","1" +"-0.46","Shoes ","athletic ","0","2" +"-0.43","Shoes ","mens ","0","3" +"-0.41","Shoes ","womens ","0","4" +"-0.77","Sports ","tennis ","0","1" +"-0.59","Sports ","sailing ","0","2" +"-0.55","Sports ","basketball ","0","3" +"-0.49","Sports ","camping ","0","4" +"-0.48","Sports ","baseball ","0","5" +"-0.47","Sports ","fitness ","0","6" +"-0.47","Sports ","golf ","0","6" +"-0.45","Sports ","guns ","0","8" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00038.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00038.sql new file mode 100644 index 00000000000..6854a01b413 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00038.sql @@ -0,0 +1,39 @@ +SELECT "count"(*) +FROM + ( + SELECT DISTINCT + "c_last_name" + , "c_first_name" + , "d_date" + FROM + store_sales + , date_dim + , customer + WHERE ("store_sales"."ss_sold_date_sk" = "date_dim"."d_date_sk") + AND ("store_sales"."ss_customer_sk" = "customer"."c_customer_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) +INTERSECT SELECT DISTINCT + "c_last_name" + , "c_first_name" + , "d_date" + FROM + catalog_sales + , date_dim + , customer + WHERE ("catalog_sales"."cs_sold_date_sk" = "date_dim"."d_date_sk") + AND ("catalog_sales"."cs_bill_customer_sk" = "customer"."c_customer_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) +INTERSECT SELECT DISTINCT + "c_last_name" + , "c_first_name" + , "d_date" + FROM + web_sales + , date_dim + , customer + WHERE ("web_sales"."ws_sold_date_sk" = "date_dim"."d_date_sk") + AND ("web_sales"."ws_bill_customer_sk" = "customer"."c_customer_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) +) hot_cust +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00038.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00038.txt new file mode 100644 index 00000000000..1e4a3a34155 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00038.txt @@ -0,0 +1 @@ +"0" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00040.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00040.sql new file mode 100644 index 00000000000..77485ed3365 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00040.sql @@ -0,0 +1,21 @@ +SELECT + "w_state" +, "i_item_id" +, "sum"((CASE WHEN (CAST("d_date" AS DATE) < CAST('2000-03-11' AS DATE)) THEN ("cs_sales_price" - COALESCE("cr_refunded_cash", 0)) ELSE 0 END)) "sales_before" +, "sum"((CASE WHEN (CAST("d_date" AS DATE) >= CAST('2000-03-11' AS DATE)) THEN ("cs_sales_price" - COALESCE("cr_refunded_cash", 0)) ELSE 0 END)) "sales_after" +FROM + (catalog_sales +LEFT JOIN catalog_returns ON ("cs_order_number" = "cr_order_number") + AND ("cs_item_sk" = "cr_item_sk")) +, warehouse +, item +, date_dim +WHERE ("i_current_price" BETWEEN DECIMAL '0.99' AND DECIMAL '1.49') + AND ("i_item_sk" = "cs_item_sk") + AND ("cs_warehouse_sk" = "w_warehouse_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND (CAST("d_date" AS DATE) BETWEEN (CAST('2000-03-11' AS DATE) - INTERVAL '30' DAY) AND (CAST('2000-03-11' AS DATE) + INTERVAL '30' DAY)) +GROUP BY "w_state", "i_item_id" +ORDER BY "w_state" ASC, "i_item_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00040.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00040.txt new file mode 100644 index 00000000000..a210ad2c0a0 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00040.txt @@ -0,0 +1,49 @@ +"TN","AAAAAAAAABDAAAAA","124.37","143.42" +"TN","AAAAAAAAAHHAAAAA","0.00","-408.96" +"TN","AAAAAAAAAJCAAAAA","18.77","28.49" +"TN","AAAAAAAAAPBAAAAA","0.00","156.54" +"TN","AAAAAAAABKFAAAAA","39.96","0.00" +"TN","AAAAAAAACBFAAAAA","69.40","0.00" +"TN","AAAAAAAACEEAAAAA","0.00","3.22" +"TN","AAAAAAAACFEAAAAA","177.89","0.00" +"TN","AAAAAAAACKHAAAAA","0.00","79.27" +"TN","AAAAAAAACLGAAAAA","5.75","51.58" +"TN","AAAAAAAADEAAAAAA","78.54","166.96" +"TN","AAAAAAAADGHAAAAA","120.91","6.53" +"TN","AAAAAAAADMBAAAAA","18.86","0.00" +"TN","AAAAAAAAEFFAAAAA","94.83","0.00" +"TN","AAAAAAAAEKCAAAAA","3.34","0.00" +"TN","AAAAAAAAEMEAAAAA","65.20","35.52" +"TN","AAAAAAAAENDAAAAA","136.91","194.38" +"TN","AAAAAAAAEPDAAAAA","0.00","84.59" +"TN","AAAAAAAAFJFAAAAA","76.36","0.00" +"TN","AAAAAAAAFKEAAAAA","0.00","290.87" +"TN","AAAAAAAAGIGAAAAA","0.00","53.78" +"TN","AAAAAAAAGJFAAAAA","0.00","34.87" +"TN","AAAAAAAAGMBAAAAA","0.00","18.69" +"TN","AAAAAAAAGNBAAAAA","0.00","137.66" +"TN","AAAAAAAAHDAAAAAA","0.00","212.20" +"TN","AAAAAAAAHGDAAAAA","161.32","8.97" +"TN","AAAAAAAAHLHAAAAA","0.00","115.50" +"TN","AAAAAAAAHOEAAAAA","22.16","19.88" +"TN","AAAAAAAAIHHAAAAA","0.00","20.73" +"TN","AAAAAAAAJAEAAAAA","14.25","0.00" +"TN","AAAAAAAAKJAAAAAA","70.55","0.00" +"TN","AAAAAAAALBHAAAAA","0.00","98.87" +"TN","AAAAAAAAMAHAAAAA","-12.01","118.36" +"TN","AAAAAAAAMBAAAAAA","0.00","89.32" +"TN","AAAAAAAAMJCAAAAA","72.40","0.00" +"TN","AAAAAAAAMJEAAAAA","0.00","14.14" +"TN","AAAAAAAANCHAAAAA","38.76","0.00" +"TN","AAAAAAAANEFAAAAA","0.00","27.10" +"TN","AAAAAAAANFHAAAAA","34.43","2.46" +"TN","AAAAAAAANGDAAAAA","19.11","0.00" +"TN","AAAAAAAANJGAAAAA","0.00","190.82" +"TN","AAAAAAAANNCAAAAA","18.52","16.29" +"TN","AAAAAAAAOEBAAAAA","0.00","44.46" +"TN","AAAAAAAAOFDAAAAA","3.42","22.43" +"TN","AAAAAAAAOHEAAAAA","59.60","0.00" +"TN","AAAAAAAAOOEAAAAA","27.02","0.00" +"TN","AAAAAAAAPAHAAAAA","69.13","0.00" +"TN","AAAAAAAAPHDAAAAA","42.38","0.00" +"TN","AAAAAAAAPKAAAAAA","62.16","31.47" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00042.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00042.sql new file mode 100644 index 00000000000..ddde19b649d --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00042.sql @@ -0,0 +1,18 @@ +SELECT + "dt"."d_year" +, "item"."i_category_id" +, "item"."i_category" +, "sum"("ss_ext_sales_price") +FROM + date_dim dt +, store_sales +, item +WHERE ("dt"."d_date_sk" = "store_sales"."ss_sold_date_sk") + AND ("store_sales"."ss_item_sk" = "item"."i_item_sk") + AND ("item"."i_manager_id" = 1) + AND ("dt"."d_moy" = 11) + AND ("dt"."d_year" = 2000) +GROUP BY "dt"."d_year", "item"."i_category_id", "item"."i_category" +ORDER BY "sum"("ss_ext_sales_price") DESC, "dt"."d_year" ASC, "item"."i_category_id" ASC, "item"."i_category" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00042.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00042.txt new file mode 100644 index 00000000000..390e128cb17 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00042.txt @@ -0,0 +1,4 @@ +"2000","1","Women ","50707.28" +"2000","7","Home ","44360.34" +"2000","10","Electronics ","28624.33" +"2000","4","Shoes ","2872.17" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00043.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00043.sql new file mode 100644 index 00000000000..6ecac4cbb83 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00043.sql @@ -0,0 +1,22 @@ +SELECT + "s_store_name" +, "s_store_id" +, "sum"((CASE WHEN ("d_day_name" = 'Sunday') THEN "ss_sales_price" ELSE null END)) "sun_sales" +, "sum"((CASE WHEN ("d_day_name" = 'Monday') THEN "ss_sales_price" ELSE null END)) "mon_sales" +, "sum"((CASE WHEN ("d_day_name" = 'Tuesday') THEN "ss_sales_price" ELSE null END)) "tue_sales" +, "sum"((CASE WHEN ("d_day_name" = 'Wednesday') THEN "ss_sales_price" ELSE null END)) "wed_sales" +, "sum"((CASE WHEN ("d_day_name" = 'Thursday') THEN "ss_sales_price" ELSE null END)) "thu_sales" +, "sum"((CASE WHEN ("d_day_name" = 'Friday') THEN "ss_sales_price" ELSE null END)) "fri_sales" +, "sum"((CASE WHEN ("d_day_name" = 'Saturday') THEN "ss_sales_price" ELSE null END)) "sat_sales" +FROM + date_dim +, store_sales +, store +WHERE ("d_date_sk" = "ss_sold_date_sk") + AND ("s_store_sk" = "ss_store_sk") + AND ("s_gmt_offset" = -5) + AND ("d_year" = 2000) +GROUP BY "s_store_name", "s_store_id" +ORDER BY "s_store_name" ASC, "s_store_id" ASC, "sun_sales" ASC, "mon_sales" ASC, "tue_sales" ASC, "wed_sales" ASC, "thu_sales" ASC, "fri_sales" ASC, "sat_sales" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00043.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00043.txt new file mode 100644 index 00000000000..cc9224957ce --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00043.txt @@ -0,0 +1,2 @@ +"able","AAAAAAAACAAAAAAA","69625.04","49173.57","51831.91","57612.82","58895.09","68174.93","63674.96" +"ought","AAAAAAAABAAAAAAA","67834.24","71407.56","53404.80","60268.27","62419.41","64721.89","58482.27" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00045.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00045.sql new file mode 100644 index 00000000000..41bbcae3435 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00045.sql @@ -0,0 +1,27 @@ +SELECT + "ca_zip" +, "ca_city" +, "sum"("ws_sales_price") +FROM + web_sales +, customer +, customer_address +, date_dim +, item +WHERE ("ws_bill_customer_sk" = "c_customer_sk") + AND ("c_current_addr_sk" = "ca_address_sk") + AND ("ws_item_sk" = "i_item_sk") + AND (("substr"("ca_zip", 1, 5) IN ('85669' , '86197' , '88274' , '83405' , '86475' , '85392' , '85460' , '80348' , '81792')) + OR ("i_item_id" IN ( + SELECT "i_item_id" + FROM + item + WHERE ("i_item_sk" IN (2 , 3 , 5 , 7 , 11 , 13 , 17 , 19 , 23 , 29)) + ))) + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_qoy" = 2) + AND ("d_year" = 2001) +GROUP BY "ca_zip", "ca_city" +ORDER BY "ca_zip" ASC, "ca_city" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00045.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00045.txt new file mode 100644 index 00000000000..4f61756c57e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00045.txt @@ -0,0 +1,5 @@ +"68339 ","Whitney","43.34" +"70534 ","Crossroads","9.18" +"71952 ","Sunnyside","32.84" +"80059 ","Centerville","7.06" +"83003 ","Hillcrest","79.87" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00046.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00046.sql new file mode 100644 index 00000000000..b9e961c4d72 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00046.sql @@ -0,0 +1,41 @@ +SELECT + "c_last_name" +, "c_first_name" +, "ca_city" +, "bought_city" +, "ss_ticket_number" +, "amt" +, "profit" +FROM + ( + SELECT + "ss_ticket_number" + , "ss_customer_sk" + , "ca_city" "bought_city" + , "sum"("ss_coupon_amt") "amt" + , "sum"("ss_net_profit") "profit" + FROM + store_sales + , date_dim + , store + , household_demographics + , customer_address + 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 ("store_sales"."ss_addr_sk" = "customer_address"."ca_address_sk") + AND (("household_demographics"."hd_dep_count" = 4) + OR ("household_demographics"."hd_vehicle_count" = 3)) + AND ("date_dim"."d_dow" IN (6 , 0)) + AND ("date_dim"."d_year" IN (1999 , (1999 + 1) , (1999 + 2))) + AND ("store"."s_city" IN ('Fairview' , 'Midway' , 'Fairview' , 'Fairview' , 'Fairview')) + GROUP BY "ss_ticket_number", "ss_customer_sk", "ss_addr_sk", "ca_city" +) dn +, customer +, customer_address current_addr +WHERE ("ss_customer_sk" = "c_customer_sk") + AND ("customer"."c_current_addr_sk" = "current_addr"."ca_address_sk") + AND ("current_addr"."ca_city" <> "bought_city") +ORDER BY "c_last_name" ASC, "c_first_name" ASC, "ca_city" ASC, "bought_city" ASC, "ss_ticket_number" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00046.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00046.txt new file mode 100644 index 00000000000..826309590b2 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00046.txt @@ -0,0 +1,100 @@ +"Adams ","Catherine ","Riverdale","Summit","2987","1600.79","-15133.13" +"Adams ","Chris ","Spring Hill","Fairfield","3922","0.00","-12338.60" +"Adams ","Chris ","Spring Hill","Lakeview","114","286.99","-12862.22" +"Albert ","John ","Wildwood","Mount Zion","7114","2368.73","-13170.27" +"Aldridge ","Eugene ","Bethel","Tanglewood","8212","3006.79","-10788.48" +"Allen ","Richard ","Oak Ridge","Greenwood","259","144.86","-6686.56" +"Andrews ","Catherine ","Lincoln","Mount Pleasant","1846","196.05","-12250.41" +"Archie ","Geneva ","Enterprise","Lakeview","89","2620.27","-19554.84" +"Bailey ","Margie ","Oakwood","Five Points","8684","375.94","-19943.05" +"Bailey ","Mark ","Enterprise","Plainview","6815","1643.32","-15523.19" +"Baker ","Monique ","Waterloo","Harmony","2429","10572.56","-8309.10" +"Bartley ","Mark ","Oak Ridge","Forest Hills","4556","1693.29","-12111.81" +"Bell ","David ","Antioch","Riverview","7909","294.67","-6547.65" +"Benjamin ","Jesse ","Riverdale","Riverside","4116","3026.83","-8970.08" +"Bennett ","Myrtle ","Brownsville","Highland Park","8745","231.80","-7746.77" +"Berry ","Nancy ","Woodruff","Oak Ridge","2352","932.46","-4679.93" +"Betz ","Bruce ","Jackson","Crossroads","8410","4851.71","-5137.38" +"Billings ","Dorothy ","Brownsville","Green Acres","6074","3339.78","-10685.06" +"Billings ","Dorothy ","Brownsville","La Grange","9167","6938.10","-15732.81" +"Black ","Margaret ","Royal","Shady Grove","2717","5133.88","-17266.96" +"Blair ","John ","Spring Valley","Valley View","654","5466.98","-10040.21" +"Blount ","Diane ","Spring Hill","Lakeside","4208","103.96","-8765.24" +"Boles ","Eduardo ","Ludlow","Unionville","5129","3757.41","-19078.19" +"Bond ","Larry ","Cedar Grove","Mount Olive","6527","0.00","-1347.28" +"Bond ","Larry ","Cedar Grove","Newtown","324","1502.67","-4705.91" +"Boston ","Janet ","Valley View","Lakeside","3561","3771.62","-15891.04" +"Bowles ","Sherry ","Forest Hills","Five Points","8250","6076.06","-11983.57" +"Bray ","Guy ","Clinton","Marion","4562","2088.69","-2841.34" +"Britt ","Inez ","Sunnyside","Green Acres","9595","6575.91","-16438.08" +"Britt ","Inez ","Sunnyside","Plainview","61","24.99","-8704.00" +"Brooks ","Melissa ","Providence","Fowler","8466","4095.74","-10387.59" +"Brown ","Heather ","Riverdale","Aberdeen","2393","9493.94","-10618.67" +"Brown ","Marie ","Lincoln","Deerfield","4072","2.41","-5139.29" +"Brown ","Michael ","Webb","Bloomingdale","9277","6429.26","-12723.49" +"Brown ","Michael ","Webb","Oak Grove","7856","323.80","-9731.79" +"Brown ","Sandra ","Walnut Grove","Union Hill","2866","356.75","-2946.28" +"Brown ","Theresa ","New Hope","Brownsville","6825","165.07","-5015.12" +"Brown ","Theresa ","New Hope","Woodland","9407","1402.79","-9068.50" +"Browning ","Margie ","Shiloh","Oak Ridge","2740","3817.40","-21209.48" +"Brunson ","Albert ","Whitesville","Salem","7076","783.32","1468.92" +"Buchanan ","Alvin ","Walnut Grove","Green Acres","3100","4401.31","-15707.98" +"Buchanan ","Alvin ","Walnut Grove","Marion","537","3844.58","-9759.31" +"Buchanan ","Theresa ","Brownsville","Valley View","7406","395.25","478.51" +"Burch ","James ","Concord","Plainview","9253","0.00","-2516.68" +"Burns ","Kevin ","Woodland","Collinsville","1585","843.57","-4030.62" +"Burns ","Kevin ","Woodland","New Hope","1069","2318.68","-10807.43" +"Burt ","Evelyn ","Oak Ridge","Saratoga","8555","6706.77","-8744.54" +"Butler ","Claudia ","Five Points","Forest Hills","205","941.70","-23002.50" +"Butler ","Gregory ","Blair","Brownsville","6986","603.17","-13404.34" +"Butler ","Gregory ","Blair","Lakeview","3024","1296.59","-10047.65" +"Butler ","Rebecca ","Union","Harmony","2035","5292.73","-9678.61" +"Byrd ","James ","Calhoun","Tipton","4918","61.11","-2720.01" +"Caldwell ","Joseph ","Forest Hills","Clearview","2069","889.20","-13359.04" +"Callahan ","Ambrose ","Superior","Glendale","5496","653.67","-4222.16" +"Campbell ","Sheila ","Springfield","Friendship","1589","673.44","-16348.22" +"Campbell ","Sheila ","Springfield","Lakewood","7325","190.41","-3632.10" +"Carl ","Natasha ","Crossroads","Midway","302","446.88","993.11" +"Carlton ","Gloria ","Midway","Bloomingdale","2939","1716.38","-9942.34" +"Carroll ","Bryan ","Glenwood","Jamestown","1346","873.39","-12524.84" +"Chambers ","Adam ","Stringtown","Ashland","5867","2951.03","-4220.68" +"Chambers ","Adam ","Stringtown","Red Hill","2","4891.64","-25970.86" +"Chan ","Howard ","Bridgeport","Woodland","7628","815.66","-24226.87" +"Chapa ","Marilyn ","Woodlawn","Hamilton","3066","115.52","-10350.26" +"Chappell ","Victor ","Sulphur Springs","Oak Ridge","8577","4259.90","-25517.17" +"Chester ","Julie ","Pinecrest","Fowler","4532","11151.60","-16167.69" +"Child ","Hellen ","Providence","Deerfield","4794","520.42","-1565.94" +"Child ","Hellen ","Providence","Riverside","7950","4223.51","-16342.19" +"Chu ","William ","Fairview","Valley View","6485","905.42","-5942.73" +"Clark ","Marie ","Highland Park","Hillcrest","6609","3307.62","-5528.52" +"Clark ","Sammie ","Macedonia","Oak Hill","8312","1277.21","-5254.21" +"Clark ","Sammie ","Macedonia","Parkwood","8226","2753.69","-5827.13" +"Clarke ","Walter ","Mount Zion","Spring Hill","3317","2412.97","-21646.44" +"Clawson ","Robert ","Pleasant Grove","Arlington","2657","812.08","-16198.07" +"Clawson ","Robert ","Pleasant Grove","Bethel","8606","567.15","-9196.08" +"Cole ","Ruby ","Edgewood","Arlington","7637","544.11","-9282.16" +"Collins ","Margaret ","Pine Grove","Riverside","6023","39.85","-14086.76" +"Combs ","Betty ","Friendship","Oak Ridge","8691","1634.65","-10338.68" +"Conyers ","Joseph ","Oakwood","Oak Grove","3195","3219.24","-14746.79" +"Cook ","Ingrid ","Colfax","Shiloh","4039","4630.14","-8766.50" +"Cowan ","Shawn ","Bethel","Woodville","1780","4266.76","-5263.53" +"Cox ","Amanda ","Clifton","Kingston","4148","4511.00","-8771.06" +"Cox ","Amanda ","Clifton","Lebanon","7121","5275.31","-15290.79" +"Craig ","William ","Sutton","Clinton","8303","1800.72","-1884.72" +"Cyr ","Pauline ","Parkwood","Belmont","3825","4214.63","-8859.76" +"Daniels ","Brandi ","Peoria","Highland","1242","2501.48","-8775.32" +"Davidson ","Darrell ","Shiloh","Mountain View","4114","771.74","-8117.24" +"Davis ","Colleen ","Ashland","Marion","5405","315.14","-1398.93" +"Davis ","Colleen ","Ashland","Waterloo","4322","802.22","-14639.12" +"Davis ","Rita ","Clinton","Antioch","7900","1095.64","-3405.06" +"Davis ","Rita ","Clinton","Bridgeport","4680","779.33","-11417.03" +"Dawkins ","Steven ","Oak Ridge","Marion","2054","992.57","-11116.84" +"Dawkins ","Steven ","Oak Ridge","Valley View","1081","170.54","-3082.05" +"Delarosa ","Jerald ","Woodville","Crossroads","3359","2269.82","-6197.87" +"Dewey ","Lucas ","Friendship","Lakeside","8447","9443.65","-31140.94" +"Dewey ","Lucas ","Friendship","Oakwood","2685","0.00","-3277.97" +"Dickey ","Timothy ","Unionville","Hamilton","9750","850.89","6370.06" +"Doolittle ","Brigida ","Oak Hill","Antioch","4502","114.54","-6332.42" +"Duarte ","Ruth ","Fairview","Lebanon","8414","13.15","-4969.85" +"Dudley ","Tonia ","Union Hill","Green Acres","6887","1720.50","-12001.32" +"Dudley ","Tonia ","Union Hill","Newport","142","3551.31","-15564.69" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00047.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00047.sql new file mode 100644 index 00000000000..97e5818ebfc --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00047.sql @@ -0,0 +1,63 @@ +WITH + v1 AS ( + SELECT + "i_category" + , "i_brand" + , "s_store_name" + , "s_company_name" + , "d_year" + , "d_moy" + , "sum"("ss_sales_price") "sum_sales" + , "avg"("sum"("ss_sales_price")) OVER (PARTITION BY "i_category", "i_brand", "s_store_name", "s_company_name", "d_year") "avg_monthly_sales" + , "rank"() OVER (PARTITION BY "i_category", "i_brand", "s_store_name", "s_company_name" ORDER BY "d_year" ASC, "d_moy" ASC) "rn" + FROM + item + , store_sales + , date_dim + , store + WHERE ("ss_item_sk" = "i_item_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_store_sk" = "s_store_sk") + AND (("d_year" = 1999) + OR (("d_year" = (1999 - 1)) + AND ("d_moy" = 12)) + OR (("d_year" = (1999 + 1)) + AND ("d_moy" = 1))) + GROUP BY "i_category", "i_brand", "s_store_name", "s_company_name", "d_year", "d_moy" +) +, v2 AS ( + SELECT + "v1"."i_category" + , "v1"."i_brand" + , "v1"."s_store_name" + , "v1"."s_company_name" + , "v1"."d_year" + , "v1"."d_moy" + , "v1"."avg_monthly_sales" + , "v1"."sum_sales" + , "v1_lag"."sum_sales" "psum" + , "v1_lead"."sum_sales" "nsum" + FROM + v1 + , v1 v1_lag + , v1 v1_lead + WHERE ("v1"."i_category" = "v1_lag"."i_category") + AND ("v1"."i_category" = "v1_lead"."i_category") + AND ("v1"."i_brand" = "v1_lag"."i_brand") + AND ("v1"."i_brand" = "v1_lead"."i_brand") + AND ("v1"."s_store_name" = "v1_lag"."s_store_name") + AND ("v1"."s_store_name" = "v1_lead"."s_store_name") + AND ("v1"."s_company_name" = "v1_lag"."s_company_name") + AND ("v1"."s_company_name" = "v1_lead"."s_company_name") + AND ("v1"."rn" = ("v1_lag"."rn" + 1)) + AND ("v1"."rn" = ("v1_lead"."rn" - 1)) +) +SELECT * +FROM + v2 +WHERE ("d_year" = 1999) + AND ("avg_monthly_sales" > 0) + AND ((CASE WHEN ("avg_monthly_sales" > 0) THEN ("abs"(("sum_sales" - "avg_monthly_sales")) / "avg_monthly_sales") ELSE null END) > DECIMAL '0.1') +ORDER BY ("sum_sales" - "avg_monthly_sales") ASC, 3 ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00047.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00047.txt new file mode 100644 index 00000000000..67bd6f78a69 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00047.txt @@ -0,0 +1,100 @@ +"Shoes ","edu packedu pack #1 ","able","Unknown","1999","6","829.93","165.07","354.24","253.10" +"Shoes ","exportiedu pack #1 ","able","Unknown","1999","7","722.39","113.01","284.76","335.67" +"Shoes ","edu packedu pack #1 ","ought","Unknown","1999","2","867.68","278.18","697.15","337.06" +"Shoes ","edu packedu pack #1 ","able","Unknown","1999","7","829.93","253.10","165.07","1819.85" +"Children ","exportiexporti #1 ","ought","Unknown","1999","5","583.45","21.45","600.74","336.73" +"Shoes ","edu packedu pack #1 ","ought","Unknown","1999","6","867.68","332.06","425.25","732.70" +"Shoes ","edu packedu pack #1 ","able","Unknown","1999","3","829.93","296.00","365.13","774.32" +"Shoes ","edu packedu pack #1 ","ought","Unknown","1999","3","867.68","337.06","278.18","962.42" +"Children ","importoexporti #1 ","able","Unknown","1999","6","525.01","4.68","308.29","183.19" +"Women ","amalgamalg #1 ","ought","Unknown","1999","3","609.84","95.65","298.74","488.70" +"Music ","importoscholar #1 ","ought","Unknown","1999","5","556.19","47.78","516.34","290.31" +"Women ","amalgamalg #1 ","able","Unknown","1999","7","603.49","99.64","102.02","873.41" +"Women ","amalgamalg #1 ","able","Unknown","1999","6","603.49","102.02","461.94","99.64" +"Shoes ","exportiedu pack #1 ","able","Unknown","1999","5","722.39","229.73","746.32","284.76" +"Shoes ","edu packedu pack #1 ","able","Unknown","1999","5","829.93","354.24","774.32","165.07" +"Music ","exportischolar #2 ","able","Unknown","1999","2","523.02","48.73","706.07","170.59" +"Women ","exportiamalg #1 ","able","Unknown","1999","5","564.58","95.06","958.72","185.09" +"Women ","edu packamalg #1 ","able","Unknown","1999","7","683.46","214.05","367.06","937.24" +"Men ","importoimporto #1 ","able","Unknown","1999","3","695.05","228.92","356.06","329.45" +"Shoes ","edu packedu pack #1 ","able","Unknown","1999","2","829.93","365.13","919.45","296.00" +"Shoes ","exportiedu pack #1 ","ought","Unknown","1999","3","686.33","222.74","239.02","474.95" +"Children ","amalgexporti #2 ","able","Unknown","1999","6","491.76","35.06","116.20","348.36" +"Shoes ","amalgedu pack #1 ","able","Unknown","1999","7","599.91","148.61","199.10","718.69" +"Shoes ","exportiedu pack #1 ","ought","Unknown","1999","2","686.33","239.02","482.65","222.74" +"Women ","exportiamalg #1 ","able","Unknown","1999","2","564.58","119.46","284.78","504.93" +"Shoes ","importoedu pack #1 ","ought","Unknown","1999","2","511.13","68.49","424.66","534.76" +"Shoes ","edu packedu pack #1 ","ought","Unknown","1999","5","867.68","425.25","962.42","332.06" +"Shoes ","exportiedu pack #1 ","able","Unknown","1999","6","722.39","284.76","229.73","113.01" +"Music ","amalgscholar #1 ","able","Unknown","1999","2","534.87","97.50","234.14","244.78" +"Music ","exportischolar #2 ","able","Unknown","1999","6","523.02","86.67","374.94","340.85" +"Shoes ","exportiedu pack #1 ","able","Unknown","1999","3","722.39","286.05","400.55","746.32" +"Music ","importoscholar #1 ","able","Unknown","1999","6","623.30","189.36","664.42","269.84" +"Music ","importoscholar #1 ","able","Unknown","1999","2","623.30","189.90","632.80","376.25" +"Women ","importoamalg #1 ","able","Unknown","1999","7","524.76","93.31","265.26","840.62" +"Men ","exportiimporto #1 ","able","Unknown","1999","6","533.13","102.16","214.56","223.47" +"Music ","exportischolar #1 ","able","Unknown","1999","6","471.61","42.15","125.89","246.59" +"Men ","exportiimporto #1 ","ought","Unknown","1999","1","613.41","184.27","1346.58","420.93" +"Music ","amalgscholar #1 ","ought","Unknown","1999","3","574.43","146.73","339.62","542.18" +"Men ","importoimporto #1 ","able","Unknown","1999","6","695.05","267.60","422.13","495.95" +"Shoes ","amalgedu pack #1 ","able","Unknown","1999","2","599.91","176.22","262.39","344.66" +"Children ","exportiexporti #1 ","ought","Unknown","1999","2","583.45","161.60","515.09","208.93" +"Shoes ","importoedu pack #1 ","ought","Unknown","1999","5","511.13","96.68","438.03","389.56" +"Men ","edu packimporto #1 ","able","Unknown","1999","6","581.73","171.64","427.82","430.12" +"Men ","edu packimporto #1 ","ought","Unknown","1999","1","602.95","192.89","1575.04","489.96" +"Shoes ","amalgedu pack #1 ","ought","Unknown","1999","2","504.33","94.33","172.08","547.73" +"Children ","edu packexporti #1 ","ought","Unknown","1999","5","591.69","183.79","283.51","222.40" +"Men ","exportiimporto #1 ","able","Unknown","1999","2","533.13","126.56","623.01","325.52" +"Music ","amalgscholar #1 ","able","Unknown","1999","4","534.87","128.59","244.78","227.22" +"Music ","amalgscholar #1 ","able","Unknown","1999","7","534.87","129.28","381.00","393.63" +"Women ","importoamalg #2 ","ought","Unknown","1999","6","482.35","77.88","294.69","464.73" +"Women ","edu packamalg #1 ","ought","Unknown","1999","4","715.94","314.15","357.24","362.51" +"Shoes ","amalgedu pack #1 ","able","Unknown","1999","6","599.91","199.10","330.23","148.61" +"Children ","importoexporti #1 ","ought","Unknown","1999","2","500.60","102.30","511.54","292.93" +"Shoes ","importoedu pack #1 ","able","Unknown","1999","6","459.79","62.62","317.10","174.78" +"Shoes ","exportiedu pack #1 ","ought","Unknown","1999","5","686.33","290.86","474.95","408.18" +"Men ","edu packimporto #1 ","able","Unknown","1999","9","581.73","187.11","730.37","770.69" +"Women ","importoamalg #1 ","able","Unknown","1999","3","524.76","130.27","327.67","640.79" +"Shoes ","exportiedu pack #1 ","ought","Unknown","1999","7","686.33","295.30","408.18","1324.96" +"Men ","importoimporto #1 ","ought","Unknown","1999","5","507.84","118.51","181.44","119.36" +"Men ","importoimporto #1 ","ought","Unknown","1999","6","507.84","119.36","118.51","427.57" +"Children ","edu packexporti #1 ","able","Unknown","1999","3","547.93","160.97","318.45","217.77" +"Women ","importoamalg #2 ","ought","Unknown","1999","4","482.35","95.43","319.92","294.69" +"Shoes ","exportiedu pack #1 ","able","Unknown","1999","8","722.39","335.67","113.01","1229.87" +"Music ","exportischolar #2 ","ought","Unknown","1999","5","493.12","108.56","430.12","167.54" +"Music ","exportischolar #1 ","able","Unknown","1999","2","471.61","89.32","341.95","150.55" +"Music ","exportischolar #1 ","ought","Unknown","1999","5","470.92","89.72","434.63","235.02" +"Men ","edu packimporto #1 ","able","Unknown","1999","4","581.73","200.56","769.75","427.82" +"Children ","exportiexporti #1 ","able","Unknown","1999","6","581.30","200.69","440.20","359.89" +"Women ","exportiamalg #1 ","able","Unknown","1999","6","564.58","185.09","95.06","546.77" +"Shoes ","amalgedu pack #1 ","able","Unknown","1999","4","599.91","220.79","344.66","330.23" +"Children ","amalgexporti #2 ","able","Unknown","1999","5","491.76","116.20","388.27","35.06" +"Women ","edu packamalg #1 ","ought","Unknown","1999","6","715.94","340.45","362.51","536.68" +"Women ","edu packamalg #1 ","able","Unknown","1999","2","683.46","308.00","727.47","377.56" +"Children ","exportiexporti #1 ","ought","Unknown","1999","3","583.45","208.93","161.60","600.74" +"Women ","exportiamalg #1 ","ought","Unknown","1999","2","521.02","146.69","463.83","306.07" +"Children ","edu packexporti #1 ","ought","Unknown","1999","6","591.69","222.40","183.79","591.24" +"Women ","amalgamalg #1 ","able","Unknown","1999","2","603.49","234.31","604.17","358.39" +"Music ","importoscholar #1 ","ought","Unknown","1999","2","556.19","188.07","529.24","292.57" +"Children ","importoexporti #1 ","able","Unknown","1999","3","525.01","157.51","494.70","657.36" +"Men ","importoimporto #1 ","able","Unknown","1999","4","695.05","329.45","228.92","422.13" +"Women ","edu packamalg #1 ","ought","Unknown","1999","3","715.94","357.24","523.23","314.15" +"Music ","amalgscholar #1 ","ought","Unknown","1999","7","574.43","219.61","272.14","982.65" +"Men ","amalgimporto #1 ","able","Unknown","1999","3","519.99","166.08","438.43","339.66" +"Music ","importoscholar #1 ","able","Unknown","1999","7","623.30","269.84","189.36","577.37" +"Women ","edu packamalg #1 ","ought","Unknown","1999","5","715.94","362.51","314.15","340.45" +"Music ","exportischolar #2 ","able","Unknown","1999","3","523.02","170.59","48.73","324.93" +"Children ","exportiexporti #1 ","ought","Unknown","1999","8","583.45","231.42","620.81","691.89" +"Men ","exportiimporto #1 ","ought","Unknown","1999","6","613.41","266.05","296.76","747.61" +"Music ","exportischolar #1 ","able","Unknown","1999","5","471.61","125.89","264.68","42.15" +"Music ","edu packscholar #1 ","ought","Unknown","1999","3","483.58","138.34","340.03","276.17" +"Men ","edu packimporto #2 ","ought","Unknown","1999","5","359.51","15.16","234.88","184.23" +"Children ","importoexporti #1 ","able","Unknown","1999","7","525.01","183.19","4.68","828.61" +"Men ","importoimporto #1 ","able","Unknown","1999","2","695.05","356.06","556.27","228.92" +"Shoes ","amalgedu pack #1 ","able","Unknown","1999","1","599.91","262.39","1254.78","176.22" +"Men ","edu packimporto #1 ","ought","Unknown","1999","7","602.95","269.47","334.84","543.41" +"Children ","importoexporti #1 ","able","Unknown","1999","10","525.01","191.78","691.82","1093.33" +"Shoes ","amalgedu pack #1 ","ought","Unknown","1999","1","504.33","172.08","1008.03","94.33" +"Children ","amalgexporti #1 ","ought","Unknown","1999","2","460.22","129.28","467.11","567.12" +"Children ","edu packexporti #1 ","able","Unknown","1999","4","547.93","217.77","160.97","268.18" +"Men ","importoimporto #1 ","ought","Unknown","1999","4","507.84","181.44","388.48","118.51" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00048.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00048.sql new file mode 100644 index 00000000000..1f48f2d0c37 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00048.sql @@ -0,0 +1,35 @@ +SELECT "sum"("ss_quantity") +FROM + store_sales +, store +, customer_demographics +, customer_address +, date_dim +WHERE ("s_store_sk" = "ss_store_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2000) + AND ((("cd_demo_sk" = "ss_cdemo_sk") + AND ("cd_marital_status" = 'M') + AND ("cd_education_status" = '4 yr Degree') + AND ("ss_sales_price" BETWEEN DECIMAL '100.00' AND DECIMAL '150.00')) + OR (("cd_demo_sk" = "ss_cdemo_sk") + AND ("cd_marital_status" = 'D') + AND ("cd_education_status" = '2 yr Degree') + AND ("ss_sales_price" BETWEEN DECIMAL '50.00' AND DECIMAL '100.00')) + OR (("cd_demo_sk" = "ss_cdemo_sk") + AND ("cd_marital_status" = 'S') + AND ("cd_education_status" = 'College') + AND ("ss_sales_price" BETWEEN DECIMAL '150.00' AND DECIMAL '200.00'))) + AND ((("ss_addr_sk" = "ca_address_sk") + AND ("ca_country" = 'United States') + AND ("ca_state" IN ('CO' , 'OH' , 'TX')) + AND ("ss_net_profit" BETWEEN 0 AND 2000)) + OR (("ss_addr_sk" = "ca_address_sk") + AND ("ca_country" = 'United States') + AND ("ca_state" IN ('OR' , 'MN' , 'KY')) + AND ("ss_net_profit" BETWEEN 150 AND 3000)) + OR (("ss_addr_sk" = "ca_address_sk") + AND ("ca_country" = 'United States') + AND ("ca_state" IN ('VA' , 'CA' , 'MS')) + AND ("ss_net_profit" BETWEEN 50 AND 25000))) +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00048.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00048.txt new file mode 100644 index 00000000000..99e74949c26 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00048.txt @@ -0,0 +1 @@ +"1494" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00049.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00049.sql new file mode 100644 index 00000000000..c65d1a14a5d --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00049.sql @@ -0,0 +1,114 @@ +SELECT + 'web' "channel" +, "web"."item" +, "web"."return_ratio" +, "web"."return_rank" +, "web"."currency_rank" +FROM + ( + SELECT + "item" + , "return_ratio" + , "currency_ratio" + , "rank"() OVER (ORDER BY "return_ratio" ASC) "return_rank" + , "rank"() OVER (ORDER BY "currency_ratio" ASC) "currency_rank" + FROM + ( + SELECT + "ws"."ws_item_sk" "item" + , (CAST("sum"(COALESCE("wr"."wr_return_quantity", 0)) AS DECIMAL(15,4)) / CAST("sum"(COALESCE("ws"."ws_quantity", 0)) AS DECIMAL(15,4))) "return_ratio" + , (CAST("sum"(COALESCE("wr"."wr_return_amt", 0)) AS DECIMAL(15,4)) / CAST("sum"(COALESCE("ws"."ws_net_paid", 0)) AS DECIMAL(15,4))) "currency_ratio" + FROM + (web_sales ws + LEFT JOIN web_returns wr ON ("ws"."ws_order_number" = "wr"."wr_order_number") + AND ("ws"."ws_item_sk" = "wr"."wr_item_sk")) + , date_dim + WHERE ("wr"."wr_return_amt" > 10000) + AND ("ws"."ws_net_profit" > 1) + AND ("ws"."ws_net_paid" > 0) + AND ("ws"."ws_quantity" > 0) + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ("d_moy" = 12) + GROUP BY "ws"."ws_item_sk" + ) in_web +) web +WHERE ("web"."return_rank" <= 10) + OR ("web"."currency_rank" <= 10) +UNION SELECT + 'catalog' "channel" +, "catalog"."item" +, "catalog"."return_ratio" +, "catalog"."return_rank" +, "catalog"."currency_rank" +FROM + ( + SELECT + "item" + , "return_ratio" + , "currency_ratio" + , "rank"() OVER (ORDER BY "return_ratio" ASC) "return_rank" + , "rank"() OVER (ORDER BY "currency_ratio" ASC) "currency_rank" + FROM + ( + SELECT + "cs"."cs_item_sk" "item" + , (CAST("sum"(COALESCE("cr"."cr_return_quantity", 0)) AS DECIMAL(15,4)) / CAST("sum"(COALESCE("cs"."cs_quantity", 0)) AS DECIMAL(15,4))) "return_ratio" + , (CAST("sum"(COALESCE("cr"."cr_return_amount", 0)) AS DECIMAL(15,4)) / CAST("sum"(COALESCE("cs"."cs_net_paid", 0)) AS DECIMAL(15,4))) "currency_ratio" + FROM + (catalog_sales cs + LEFT JOIN catalog_returns cr ON ("cs"."cs_order_number" = "cr"."cr_order_number") + AND ("cs"."cs_item_sk" = "cr"."cr_item_sk")) + , date_dim + WHERE ("cr"."cr_return_amount" > 10000) + AND ("cs"."cs_net_profit" > 1) + AND ("cs"."cs_net_paid" > 0) + AND ("cs"."cs_quantity" > 0) + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ("d_moy" = 12) + GROUP BY "cs"."cs_item_sk" + ) in_cat +) "CATALOG" +WHERE ("catalog"."return_rank" <= 10) + OR ("catalog"."currency_rank" <= 10) +UNION SELECT + 'store' "channel" +, "store"."item" +, "store"."return_ratio" +, "store"."return_rank" +, "store"."currency_rank" +FROM + ( + SELECT + "item" + , "return_ratio" + , "currency_ratio" + , "rank"() OVER (ORDER BY "return_ratio" ASC) "return_rank" + , "rank"() OVER (ORDER BY "currency_ratio" ASC) "currency_rank" + FROM + ( + SELECT + "sts"."ss_item_sk" "item" + , (CAST("sum"(COALESCE("sr"."sr_return_quantity", 0)) AS DECIMAL(15,4)) / CAST("sum"(COALESCE("sts"."ss_quantity", 0)) AS DECIMAL(15,4))) "return_ratio" + , (CAST("sum"(COALESCE("sr"."sr_return_amt", 0)) AS DECIMAL(15,4)) / CAST("sum"(COALESCE("sts"."ss_net_paid", 0)) AS DECIMAL(15,4))) "currency_ratio" + FROM + (store_sales sts + LEFT JOIN store_returns sr ON ("sts"."ss_ticket_number" = "sr"."sr_ticket_number") + AND ("sts"."ss_item_sk" = "sr"."sr_item_sk")) + , date_dim + WHERE ("sr"."sr_return_amt" > 10000) + AND ("sts"."ss_net_profit" > 1) + AND ("sts"."ss_net_paid" > 0) + AND ("sts"."ss_quantity" > 0) + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ("d_moy" = 12) + GROUP BY "sts"."ss_item_sk" + ) in_store +) store +WHERE ("store"."return_rank" <= 10) + OR ("store"."currency_rank" <= 10) +ORDER BY 1 ASC, 4 ASC, 5 ASC, 2 ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00049.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00049.txt new file mode 100644 index 00000000000..1f5a2fab3dc --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00049.txt @@ -0,0 +1,3 @@ +"catalog","767","1.0000","1","1" +"store","1841","0.7750","1","1" +"store","737","0.9420","2","2" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00050.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00050.sql new file mode 100644 index 00000000000..48fa581ed7b --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00050.sql @@ -0,0 +1,37 @@ +SELECT + "s_store_name" +, "s_company_id" +, "s_street_number" +, "s_street_name" +, "s_street_type" +, "s_suite_number" +, "s_city" +, "s_county" +, "s_state" +, "s_zip" +, "sum"((CASE WHEN (("sr_returned_date_sk" - "ss_sold_date_sk") <= 30) THEN 1 ELSE 0 END)) "30 days" +, "sum"((CASE WHEN (("sr_returned_date_sk" - "ss_sold_date_sk") > 30) + AND (("sr_returned_date_sk" - "ss_sold_date_sk") <= 60) THEN 1 ELSE 0 END)) "31-60 days" +, "sum"((CASE WHEN (("sr_returned_date_sk" - "ss_sold_date_sk") > 60) + AND (("sr_returned_date_sk" - "ss_sold_date_sk") <= 90) THEN 1 ELSE 0 END)) "61-90 days" +, "sum"((CASE WHEN (("sr_returned_date_sk" - "ss_sold_date_sk") > 90) + AND (("sr_returned_date_sk" - "ss_sold_date_sk") <= 120) THEN 1 ELSE 0 END)) "91-120 days" +, "sum"((CASE WHEN (("sr_returned_date_sk" - "ss_sold_date_sk") > 120) THEN 1 ELSE 0 END)) ">120 days" +FROM + store_sales +, store_returns +, store +, date_dim d1 +, date_dim d2 +WHERE ("d2"."d_year" = 2001) + AND ("d2"."d_moy" = 8) + AND ("ss_ticket_number" = "sr_ticket_number") + AND ("ss_item_sk" = "sr_item_sk") + AND ("ss_sold_date_sk" = "d1"."d_date_sk") + AND ("sr_returned_date_sk" = "d2"."d_date_sk") + AND ("ss_customer_sk" = "sr_customer_sk") + AND ("ss_store_sk" = "s_store_sk") +GROUP BY "s_store_name", "s_company_id", "s_street_number", "s_street_name", "s_street_type", "s_suite_number", "s_city", "s_county", "s_state", "s_zip" +ORDER BY "s_store_name" ASC, "s_company_id" ASC, "s_street_number" ASC, "s_street_name" ASC, "s_street_type" ASC, "s_suite_number" ASC, "s_city" ASC, "s_county" ASC, "s_state" ASC, "s_zip" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00050.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00050.txt new file mode 100644 index 00000000000..f8119f80292 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00050.txt @@ -0,0 +1,2 @@ +"able","1","255","Sycamore ","Dr. ","Suite 410 ","Midway","Williamson County","TN","31904 ","9","7","3","6","16" +"ought","1","767","Spring ","Wy ","Suite 250 ","Midway","Williamson County","TN","31904 ","8","9","4","6","10" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00051.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00051.sql new file mode 100644 index 00000000000..7f1c9973c76 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00051.sql @@ -0,0 +1,54 @@ +WITH + web_v1 AS ( + SELECT + "ws_item_sk" "item_sk" + , "d_date" + , "sum"("sum"("ws_sales_price")) OVER (PARTITION BY "ws_item_sk" ORDER BY "d_date" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) "cume_sales" + FROM + web_sales + , date_dim + WHERE ("ws_sold_date_sk" = "d_date_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + AND ("ws_item_sk" IS NOT NULL) + GROUP BY "ws_item_sk", "d_date" +) +, store_v1 AS ( + SELECT + "ss_item_sk" "item_sk" + , "d_date" + , "sum"("sum"("ss_sales_price")) OVER (PARTITION BY "ss_item_sk" ORDER BY "d_date" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) "cume_sales" + FROM + store_sales + , date_dim + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + AND ("ss_item_sk" IS NOT NULL) + GROUP BY "ss_item_sk", "d_date" +) +SELECT * +FROM + ( + SELECT + "item_sk" + , "d_date" + , "web_sales" + , "store_sales" + , "max"("web_sales") OVER (PARTITION BY "item_sk" ORDER BY "d_date" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) "web_cumulative" + , "max"("store_sales") OVER (PARTITION BY "item_sk" ORDER BY "d_date" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) "store_cumulative" + FROM + ( + SELECT + (CASE WHEN ("web"."item_sk" IS NOT NULL) THEN "web"."item_sk" ELSE "store"."item_sk" END) "item_sk" + , (CASE WHEN ("web"."d_date" IS NOT NULL) THEN "web"."d_date" ELSE "store"."d_date" END) "d_date" + , "web"."cume_sales" "web_sales" + , "store"."cume_sales" "store_sales" + FROM + (web_v1 web + FULL JOIN store_v1 store ON ("web"."item_sk" = "store"."item_sk") + AND ("web"."d_date" = "store"."d_date")) + ) x +) y +WHERE ("web_cumulative" > "store_cumulative") +ORDER BY "item_sk" ASC, "d_date" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00051.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00051.txt new file mode 100644 index 00000000000..9a2583064c9 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00051.txt @@ -0,0 +1,100 @@ +"5","2000-04-15","114.20","","114.20","79.51" +"5","2000-05-01","","110.03","114.20","110.03" +"11","2000-02-16","130.39","","130.39","126.45" +"23","2000-01-03","29.57","7.69","29.57","7.69" +"31","2000-05-26","49.63","","49.63","30.94" +"31","2000-06-25","","46.72","49.63","46.72" +"71","2000-02-02","75.48","","75.48","3.55" +"77","2000-03-11","","5.40","142.95","5.40" +"77","2000-03-25","","18.48","142.95","18.48" +"77","2000-04-02","","132.34","142.95","132.34" +"110","2000-07-28","240.89","","240.89","218.24" +"133","2000-04-25","202.69","","202.69","75.74" +"133","2000-06-20","","134.00","202.69","134.00" +"133","2000-06-25","","144.99","202.69","144.99" +"133","2000-07-08","","186.80","202.69","186.80" +"143","2000-08-18","99.55","","99.55","71.13" +"143","2000-08-23","","72.66","99.55","72.66" +"164","2000-05-14","66.19","","66.19","47.66" +"188","2000-02-04","46.94","","46.94","42.94" +"188","2000-03-23","","46.56","46.94","46.56" +"217","2000-01-29","188.84","","188.84","50.35" +"217","2000-02-08","","56.17","188.84","56.17" +"217","2000-04-03","","93.63","188.84","93.63" +"217","2000-04-19","","115.50","188.84","115.50" +"217","2000-05-17","","183.23","188.84","183.23" +"218","2000-08-16","","69.08","100.31","69.08" +"230","2000-05-05","159.59","","159.59","83.90" +"239","2000-01-25","120.88","","120.88","90.97" +"259","2000-04-25","31.83","","31.83","23.18" +"259","2000-05-26","","28.09","31.83","28.09" +"265","2000-03-24","190.14","","190.14","107.68" +"265","2000-03-26","","143.49","190.14","143.49" +"265","2000-04-22","","143.49","190.14","143.49" +"271","2000-05-25","110.04","","110.04","80.97" +"284","2000-10-20","540.88","","540.88","504.15" +"284","2000-10-22","595.09","","595.09","504.15" +"284","2000-11-10","","505.87","595.09","505.87" +"284","2000-11-15","","555.43","595.09","555.43" +"295","2000-02-09","","47.54","54.61","47.54" +"295","2000-08-16","314.89","","314.89","273.81" +"295","2000-08-18","","296.06","314.89","296.06" +"302","2000-08-16","","4.06","115.83","4.06" +"313","2000-02-05","","9.30","97.44","9.30" +"313","2000-03-08","","28.83","97.44","28.83" +"313","2000-08-21","129.35","","129.35","110.09" +"320","2000-02-23","184.28","","184.28","119.68" +"320","2000-03-02","","179.44","184.28","179.44" +"320","2000-05-05","","179.44","184.28","179.44" +"343","2000-05-25","111.68","","111.68","56.16" +"343","2000-05-30","","59.66","111.68","59.66" +"343","2000-06-17","156.49","","156.49","59.66" +"343","2000-06-19","","73.38","156.49","73.38" +"343","2000-08-14","","139.35","156.49","139.35" +"365","2000-02-24","","3.40","76.11","3.40" +"365","2000-03-10","","42.65","76.11","42.65" +"373","2000-01-29","51.79","","51.79","40.01" +"373","2000-02-26","","48.13","51.79","48.13" +"377","2000-04-20","187.84","","187.84","114.83" +"377","2000-05-22","","164.57","187.84","164.57" +"383","2000-08-31","133.87","","133.87","93.95" +"383","2000-09-08","331.00","","331.00","150.98" +"383","2000-09-15","","165.06","331.00","165.06" +"383","2000-09-18","","226.80","331.00","226.80" +"383","2000-10-03","","237.19","331.00","237.19" +"383","2000-10-11","","258.77","331.00","258.77" +"383","2000-11-26","434.14","","434.14","420.35" +"385","2000-03-08","32.98","","32.98","18.89" +"421","2000-04-29","79.76","","79.76","25.65" +"421","2000-05-04","","29.38","79.76","29.38" +"421","2000-06-07","","36.62","79.76","36.62" +"421","2000-08-14","118.97","","118.97","107.87" +"421","2000-09-06","","107.87","118.97","107.87" +"427","2000-04-15","257.77","","257.77","83.93" +"427","2000-04-20","","189.44","257.77","189.44" +"427","2000-04-28","","222.60","257.77","222.60" +"427","2000-07-07","","241.54","257.77","241.54" +"440","2000-03-23","","16.74","73.96","16.74" +"440","2000-07-07","215.72","","215.72","183.20" +"440","2000-08-04","","196.69","215.72","196.69" +"443","2000-05-02","14.11","","14.11","0.00" +"443","2000-07-31","","12.67","14.11","12.67" +"446","2000-01-27","","4.08","4.46","4.08" +"461","2000-09-20","156.42","","156.42","76.12" +"461","2000-09-30","","76.12","156.42","76.12" +"461","2000-10-11","","84.02","156.42","84.02" +"461","2000-10-14","","84.41","156.42","84.41" +"461","2000-11-01","","89.74","156.42","89.74" +"476","2000-01-23","93.75","","93.75","25.50" +"476","2000-02-26","","38.04","93.75","38.04" +"487","2000-09-18","235.30","","235.30","166.28" +"487","2000-10-04","","168.12","235.30","168.12" +"487","2000-10-12","","228.94","235.30","228.94" +"503","2000-02-28","82.11","","82.11","18.23" +"503","2000-03-02","","30.97","82.11","30.97" +"511","2000-03-14","","7.21","198.42","7.21" +"511","2000-04-05","","27.56","198.42","27.56" +"511","2000-05-14","","111.53","198.42","111.53" +"511","2000-08-21","294.88","","294.88","111.53" +"511","2000-09-12","327.17","","327.17","111.53" +"511","2000-09-18","","116.65","327.17","116.65" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00052.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00052.sql new file mode 100644 index 00000000000..0c066ee7ade --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00052.sql @@ -0,0 +1,18 @@ +SELECT + "dt"."d_year" +, "item"."i_brand_id" "brand_id" +, "item"."i_brand" "brand" +, "sum"("ss_ext_sales_price") "ext_price" +FROM + date_dim dt +, store_sales +, item +WHERE ("dt"."d_date_sk" = "store_sales"."ss_sold_date_sk") + AND ("store_sales"."ss_item_sk" = "item"."i_item_sk") + AND ("item"."i_manager_id" = 1) + AND ("dt"."d_moy" = 11) + AND ("dt"."d_year" = 2000) +GROUP BY "dt"."d_year", "item"."i_brand", "item"."i_brand_id" +ORDER BY "dt"."d_year" ASC, "ext_price" DESC, "brand_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00052.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00052.txt new file mode 100644 index 00000000000..c2ffc5c93d2 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00052.txt @@ -0,0 +1,11 @@ +"2000","7008009","namelessbrand #9 ","25825.18" +"2000","1002002","importoamalg #2 ","21693.31" +"2000","1001002","amalgamalg #2 ","14705.57" +"2000","10004004","edu packunivamalg #4 ","14449.16" +"2000","7006007","edu packamalg #2 ","14308.40" +"2000","7010004","univnameless #4 ","9581.88" +"2000","7008004","namelessbrand #4 ","8953.28" +"2000","10010013","univamalgamalg #13 ","7421.90" +"2000","5001001","brandunivamalg #11 ","4960.00" +"2000","4004001","edu packedu pack #1 ","2872.17" +"2000","10004005","importounivamalg #6 ","1793.27" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00053.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00053.sql new file mode 100644 index 00000000000..dc5f02552c5 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00053.sql @@ -0,0 +1,28 @@ +SELECT * +FROM + ( + SELECT + "i_manufact_id" + , "sum"("ss_sales_price") "sum_sales" + , "avg"("sum"("ss_sales_price")) OVER (PARTITION BY "i_manufact_id") "avg_quarterly_sales" + FROM + item + , store_sales + , date_dim + , store + WHERE ("ss_item_sk" = "i_item_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("d_month_seq" IN (1200 , (1200 + 1) , (1200 + 2) , (1200 + 3) , (1200 + 4) , (1200 + 5) , (1200 + 6) , (1200 + 7) , (1200 + 8) , (1200 + 9) , (1200 + 10) , (1200 + 11))) + AND ((("i_category" IN ('Books' , 'Children' , 'Electronics')) + AND ("i_class" IN ('personal' , 'portable' , 'reference' , 'self-help')) + AND ("i_brand" IN ('scholaramalgamalg #14' , 'scholaramalgamalg #7' , 'exportiunivamalg #9' , 'scholaramalgamalg #9'))) + OR (("i_category" IN ('Women' , 'Music' , 'Men')) + AND ("i_class" IN ('accessories' , 'classical' , 'fragrances' , 'pants')) + AND ("i_brand" IN ('amalgimporto #1' , 'edu packscholar #1' , 'exportiimporto #1' , 'importoamalg #1')))) + GROUP BY "i_manufact_id", "d_qoy" +) tmp1 +WHERE ((CASE WHEN ("avg_quarterly_sales" > 0) THEN ("abs"((CAST("sum_sales" AS DECIMAL(38,4)) - "avg_quarterly_sales")) / "avg_quarterly_sales") ELSE null END) > DECIMAL '0.1') +ORDER BY "avg_quarterly_sales" ASC, "sum_sales" ASC, "i_manufact_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00053.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00053.txt new file mode 100644 index 00000000000..793d1158714 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00053.txt @@ -0,0 +1,100 @@ +"451","51.42","122.38" +"451","53.40","122.38" +"451","142.01","122.38" +"451","242.68","122.38" +"107","0.00","124.18" +"107","25.41","124.18" +"107","347.14","124.18" +"227","36.67","162.55" +"227","87.04","162.55" +"227","246.82","162.55" +"227","279.66","162.55" +"110","60.17","166.53" +"110","200.43","166.53" +"110","238.37","166.53" +"411","43.17","172.00" +"411","114.53","172.00" +"411","257.99","172.00" +"411","272.32","172.00" +"775","90.16","180.54" +"775","201.36","180.54" +"775","261.66","180.54" +"546","25.96","183.19" +"546","103.88","183.19" +"546","284.13","183.19" +"546","318.80","183.19" +"182","18.62","190.20" +"182","46.17","190.20" +"182","304.76","190.20" +"182","391.26","190.20" +"246","6.97","192.02" +"246","145.41","192.02" +"246","261.86","192.02" +"246","353.85","192.02" +"77","81.69","192.67" +"77","144.80","192.67" +"77","157.90","192.67" +"77","386.29","192.67" +"24","93.02","196.35" +"24","107.25","196.35" +"24","289.86","196.35" +"24","295.28","196.35" +"921","103.11","201.97" +"921","155.58","201.97" +"921","170.48","201.97" +"921","378.72","201.97" +"185","18.83","203.37" +"185","130.46","203.37" +"185","476.43","203.37" +"100","28.17","204.22" +"100","146.03","204.22" +"100","288.25","204.22" +"100","354.43","204.22" +"732","96.54","204.92" +"732","257.56","204.92" +"732","260.66","204.92" +"134","16.98","210.52" +"134","51.86","210.52" +"134","379.37","210.52" +"134","393.87","210.52" +"93","96.65","214.24" +"93","162.10","214.24" +"93","390.75","214.24" +"466","9.78","215.32" +"466","116.42","215.32" +"466","262.72","215.32" +"466","472.37","215.32" +"638","19.44","219.47" +"638","268.71","219.47" +"638","285.99","219.47" +"638","303.74","219.47" +"860","67.74","219.59" +"860","105.69","219.59" +"860","352.43","219.59" +"860","352.49","219.59" +"380","98.11","224.45" +"380","105.06","224.45" +"380","258.87","224.45" +"380","435.77","224.45" +"285","81.01","227.15" +"285","116.28","227.15" +"285","467.25","227.15" +"434","30.33","228.71" +"434","90.55","228.71" +"434","341.14","228.71" +"434","452.82","228.71" +"59","97.86","236.00" +"59","129.46","236.00" +"59","279.49","236.00" +"59","437.19","236.00" +"151","65.62","242.26" +"151","111.88","242.26" +"151","366.60","242.26" +"151","424.93","242.26" +"201","78.48","246.73" +"201","105.26","246.73" +"201","397.04","246.73" +"201","406.12","246.73" +"767","79.06","256.88" +"767","144.33","256.88" +"767","295.91","256.88" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00055.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00055.sql new file mode 100644 index 00000000000..e7110d658b7 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00055.sql @@ -0,0 +1,17 @@ +SELECT + "i_brand_id" "brand_id" +, "i_brand" "brand" +, "sum"("ss_ext_sales_price") "ext_price" +FROM + date_dim +, store_sales +, item +WHERE ("d_date_sk" = "ss_sold_date_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("i_manager_id" = 28) + AND ("d_moy" = 11) + AND ("d_year" = 1999) +GROUP BY "i_brand", "i_brand_id" +ORDER BY "ext_price" DESC, "i_brand_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00055.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00055.txt new file mode 100644 index 00000000000..a52b320c32c --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00055.txt @@ -0,0 +1,20 @@ +"9016003","corpunivamalg #3 ","23226.35" +"3004001","edu packexporti #1 ","20841.63" +"6015001","scholarbrand #1 ","18992.54" +"1002001","importoamalg #1 ","13599.84" +"10015011","scholaramalgamalg #11 ","12423.67" +"5001001","amalgscholar #1 ","10041.40" +"3003001","exportiexporti #1 ","8211.40" +"6005003","scholarcorp #3 ","8090.16" +"5004001","edu packscholar #1 ","7866.96" +"2001001","amalgimporto #1 ","6862.47" +"5002001","importoscholar #1 ","5549.44" +"4003001","exportiedu pack #1 ","5037.50" +"1001002","amalgamalg #2 ","4641.67" +"8006005","corpnameless #5 ","4460.03" +"4001001","amalgedu pack #1 ","3615.11" +"2001002","amalgimporto #2 ","2778.88" +"10014016","edu packamalgamalg #16 ","2734.49" +"3002001","importoexporti #1 ","2311.73" +"4002001","importoedu pack #1 ","929.20" +"1001001","amalgamalg #1 ","805.93" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00056.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00056.sql new file mode 100644 index 00000000000..77552146ba6 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00056.sql @@ -0,0 +1,89 @@ +WITH + ss AS ( + SELECT + "i_item_id" + , "sum"("ss_ext_sales_price") "total_sales" + FROM + store_sales + , date_dim + , customer_address + , item + WHERE ("i_item_id" IN ( + SELECT "i_item_id" + FROM + item + WHERE ("i_color" IN ('slate' , 'blanched' , 'burnished')) + )) + AND ("ss_item_sk" = "i_item_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ("d_moy" = 2) + AND ("ss_addr_sk" = "ca_address_sk") + AND ("ca_gmt_offset" = -5) + GROUP BY "i_item_id" +) +, cs AS ( + SELECT + "i_item_id" + , "sum"("cs_ext_sales_price") "total_sales" + FROM + catalog_sales + , date_dim + , customer_address + , item + WHERE ("i_item_id" IN ( + SELECT "i_item_id" + FROM + item + WHERE ("i_color" IN ('slate' , 'blanched' , 'burnished')) + )) + AND ("cs_item_sk" = "i_item_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ("d_moy" = 2) + AND ("cs_bill_addr_sk" = "ca_address_sk") + AND ("ca_gmt_offset" = -5) + GROUP BY "i_item_id" +) +, ws AS ( + SELECT + "i_item_id" + , "sum"("ws_ext_sales_price") "total_sales" + FROM + web_sales + , date_dim + , customer_address + , item + WHERE ("i_item_id" IN ( + SELECT "i_item_id" + FROM + item + WHERE ("i_color" IN ('slate' , 'blanched' , 'burnished')) + )) + AND ("ws_item_sk" = "i_item_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ("d_moy" = 2) + AND ("ws_bill_addr_sk" = "ca_address_sk") + AND ("ca_gmt_offset" = -5) + GROUP BY "i_item_id" +) +SELECT + "i_item_id" +, "sum"("total_sales") "total_sales" +FROM + ( + SELECT * + FROM + ss +UNION ALL SELECT * + FROM + cs +UNION ALL SELECT * + FROM + ws +) tmp1 +GROUP BY "i_item_id" +ORDER BY "total_sales" ASC, "i_item_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00056.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00056.txt new file mode 100644 index 00000000000..b534618cb36 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00056.txt @@ -0,0 +1,24 @@ +"AAAAAAAAKBCAAAAA","57.59" +"AAAAAAAAGAHAAAAA","75.32" +"AAAAAAAAGJEAAAAA","100.00" +"AAAAAAAAIKFAAAAA","280.64" +"AAAAAAAAKMHAAAAA","389.95" +"AAAAAAAACBHAAAAA","510.45" +"AAAAAAAAKDEAAAAA","569.10" +"AAAAAAAAGBEAAAAA","678.54" +"AAAAAAAAJKAAAAAA","695.20" +"AAAAAAAAKMDAAAAA","719.70" +"AAAAAAAAIDFAAAAA","1579.31" +"AAAAAAAAIACAAAAA","1984.50" +"AAAAAAAAOCEAAAAA","2370.71" +"AAAAAAAANEFAAAAA","2510.39" +"AAAAAAAAEGBAAAAA","3425.08" +"AAAAAAAAKMBAAAAA","3437.92" +"AAAAAAAAMMCAAAAA","3831.83" +"AAAAAAAANCEAAAAA","4358.29" +"AAAAAAAAMACAAAAA","4547.64" +"AAAAAAAAGFGAAAAA","4705.41" +"AAAAAAAAEMEAAAAA","5485.76" +"AAAAAAAAELHAAAAA","6846.84" +"AAAAAAAAKJAAAAAA","8532.30" +"AAAAAAAAEADAAAAA","11970.02" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00057.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00057.sql new file mode 100644 index 00000000000..a9c6a64fccf --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00057.sql @@ -0,0 +1,59 @@ +WITH + v1 AS ( + SELECT + "i_category" + , "i_brand" + , "cc_name" + , "d_year" + , "d_moy" + , "sum"("cs_sales_price") "sum_sales" + , "avg"("sum"("cs_sales_price")) OVER (PARTITION BY "i_category", "i_brand", "cc_name", "d_year") "avg_monthly_sales" + , "rank"() OVER (PARTITION BY "i_category", "i_brand", "cc_name" ORDER BY "d_year" ASC, "d_moy" ASC) "rn" + FROM + item + , catalog_sales + , date_dim + , call_center + WHERE ("cs_item_sk" = "i_item_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("cc_call_center_sk" = "cs_call_center_sk") + AND (("d_year" = 1999) + OR (("d_year" = (1999 - 1)) + AND ("d_moy" = 12)) + OR (("d_year" = (1999 + 1)) + AND ("d_moy" = 1))) + GROUP BY "i_category", "i_brand", "cc_name", "d_year", "d_moy" +) +, v2 AS ( + SELECT + "v1"."i_category" + , "v1"."i_brand" + , "v1"."cc_name" + , "v1"."d_year" + , "v1"."d_moy" + , "v1"."avg_monthly_sales" + , "v1"."sum_sales" + , "v1_lag"."sum_sales" "psum" + , "v1_lead"."sum_sales" "nsum" + FROM + v1 + , v1 v1_lag + , v1 v1_lead + WHERE ("v1"."i_category" = "v1_lag"."i_category") + AND ("v1"."i_category" = "v1_lead"."i_category") + AND ("v1"."i_brand" = "v1_lag"."i_brand") + AND ("v1"."i_brand" = "v1_lead"."i_brand") + AND ("v1"."cc_name" = "v1_lag"."cc_name") + AND ("v1"."cc_name" = "v1_lead"."cc_name") + AND ("v1"."rn" = ("v1_lag"."rn" + 1)) + AND ("v1"."rn" = ("v1_lead"."rn" - 1)) +) +SELECT * +FROM + v2 +WHERE ("d_year" = 1999) + AND ("avg_monthly_sales" > 0) + AND ((CASE WHEN ("avg_monthly_sales" > 0) THEN ("abs"(("sum_sales" - "avg_monthly_sales")) / "avg_monthly_sales") ELSE null END) > DECIMAL '0.1') +ORDER BY ("sum_sales" - "avg_monthly_sales") ASC, 3 ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00057.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00057.txt new file mode 100644 index 00000000000..961e6dce7f7 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00057.txt @@ -0,0 +1,100 @@ +"Men ","exportiimporto #1 ","NY Metro","1999","6","815.93","45.63","570.54","476.17" +"Shoes ","edu packedu pack #1 ","Mid Atlantic","1999","4","866.93","126.89","294.79","558.99" +"Shoes ","edu packedu pack #1 ","Mid Atlantic","1999","7","866.93","129.07","486.59","1541.27" +"Men ","exportiimporto #1 ","NY Metro","1999","2","815.93","87.03","507.68","452.95" +"Shoes ","exportiedu pack #1 ","NY Metro","1999","3","812.75","150.52","307.75","242.01" +"Shoes ","edu packedu pack #1 ","NY Metro","1999","7","699.20","55.06","477.39","1041.43" +"Shoes ","amalgedu pack #1 ","Mid Atlantic","1999","2","708.97","66.28","513.00","272.12" +"Women ","edu packamalg #1 ","NY Metro","1999","4","737.46","101.67","652.80","520.38" +"Shoes ","edu packedu pack #1 ","Mid Atlantic","1999","2","866.93","244.85","494.34","294.79" +"Shoes ","exportiedu pack #1 ","Mid Atlantic","1999","2","851.33","269.64","555.43","420.01" +"Shoes ","edu packedu pack #1 ","Mid Atlantic","1999","3","866.93","294.79","244.85","126.89" +"Shoes ","exportiedu pack #1 ","NY Metro","1999","4","812.75","242.01","150.52","300.20" +"Music ","amalgscholar #1 ","Mid Atlantic","1999","3","668.03","101.29","220.04","558.31" +"Men ","edu packimporto #1 ","Mid Atlantic","1999","4","619.34","55.77","399.13","277.33" +"Women ","edu packamalg #1 ","NY Metro","1999","2","737.46","187.25","520.82","652.80" +"Music ","amalgscholar #1 ","NY Metro","1999","2","596.05","62.42","324.14","160.09" +"Music ","amalgscholar #1 ","Mid Atlantic","1999","6","668.03","134.81","864.06","354.42" +"Shoes ","exportiedu pack #1 ","Mid Atlantic","1999","7","851.33","324.81","409.14","1445.34" +"Children ","edu packexporti #1 ","NY Metro","1999","5","568.80","45.58","104.61","123.61" +"Shoes ","amalgedu pack #1 ","NY Metro","1999","6","572.15","51.85","311.81","293.64" +"Music ","exportischolar #2 ","Mid Atlantic","1999","2","609.77","90.95","116.29","332.20" +"Men ","edu packimporto #1 ","Mid Atlantic","1999","1","619.34","100.58","970.86","534.07" +"Music ","exportischolar #2 ","NY Metro","1999","4","522.58","4.52","384.21","527.21" +"Women ","amalgamalg #1 ","Mid Atlantic","1999","1","605.56","92.77","1925.70","160.36" +"Shoes ","exportiedu pack #1 ","NY Metro","1999","5","812.75","300.20","242.01","667.33" +"Shoes ","amalgedu pack #1 ","Mid Atlantic","1999","5","708.97","200.51","492.31","399.50" +"Music ","importoscholar #1 ","NY Metro","1999","1","621.43","116.08","707.58","206.65" +"Shoes ","exportiedu pack #1 ","NY Metro","1999","2","812.75","307.75","523.58","150.52" +"Shoes ","edu packedu pack #1 ","NY Metro","1999","5","699.20","195.32","292.87","477.39" +"Women ","edu packamalg #1 ","Mid Atlantic","1999","4","614.54","113.35","295.94","324.27" +"Music ","importoscholar #1 ","Mid Atlantic","1999","6","621.63","125.49","183.70","168.04" +"Music ","exportischolar #2 ","Mid Atlantic","1999","1","609.77","116.29","1007.99","90.95" +"Children ","exportiexporti #1 ","Mid Atlantic","1999","3","590.06","96.92","196.74","302.77" +"Women ","amalgamalg #1 ","NY Metro","1999","4","631.76","142.28","418.75","410.57" +"Men ","importoimporto #1 ","Mid Atlantic","1999","4","650.13","168.76","221.48","851.96" +"Women ","importoamalg #1 ","Mid Atlantic","1999","3","653.96","181.13","315.07","184.28" +"Men ","exportiimporto #1 ","Mid Atlantic","1999","2","640.45","169.31","477.90","223.75" +"Women ","importoamalg #1 ","Mid Atlantic","1999","4","653.96","184.28","181.13","415.02" +"Women ","exportiamalg #1 ","NY Metro","1999","4","533.44","68.92","789.86","395.38" +"Children ","edu packexporti #1 ","NY Metro","1999","4","568.80","104.61","200.95","45.58" +"Men ","amalgimporto #1 ","NY Metro","1999","4","500.24","39.80","180.51","306.87" +"Music ","importoscholar #1 ","Mid Atlantic","1999","7","621.63","168.04","125.49","1068.24" +"Children ","amalgexporti #2 ","Mid Atlantic","1999","6","519.60","66.40","199.78","436.06" +"Music ","exportischolar #2 ","Mid Atlantic","1999","7","609.77","156.65","708.17","786.42" +"Shoes ","importoedu pack #1 ","Mid Atlantic","1999","1","590.90","140.15","1728.52","561.48" +"Women ","exportiamalg #1 ","NY Metro","1999","7","533.44","85.28","271.37","790.17" +"Children ","importoexporti #1 ","Mid Atlantic","1999","3","539.59","91.57","155.20","332.66" +"Music ","amalgscholar #1 ","Mid Atlantic","1999","2","668.03","220.04","569.34","101.29" +"Music ","exportischolar #1 ","Mid Atlantic","1999","7","494.65","49.35","141.57","614.04" +"Women ","amalgamalg #1 ","Mid Atlantic","1999","2","605.56","160.36","92.77","402.65" +"Children ","edu packexporti #1 ","NY Metro","1999","6","568.80","123.61","45.58","252.87" +"Children ","importoexporti #1 ","NY Metro","1999","2","671.55","226.69","406.83","518.30" +"Shoes ","exportiedu pack #1 ","Mid Atlantic","1999","6","851.33","409.14","462.97","324.81" +"Music ","importoscholar #1 ","Mid Atlantic","1999","5","621.63","183.70","542.28","125.49" +"Shoes ","amalgedu pack #1 ","Mid Atlantic","1999","3","708.97","272.12","66.28","492.31" +"Music ","amalgscholar #1 ","NY Metro","1999","3","596.05","160.09","62.42","271.09" +"Shoes ","exportiedu pack #1 ","Mid Atlantic","1999","3","851.33","420.01","269.64","698.20" +"Children ","importoexporti #1 ","NY Metro","1999","4","671.55","242.11","518.30","279.07" +"Men ","importoimporto #1 ","Mid Atlantic","1999","3","650.13","221.48","297.49","168.76" +"Men ","amalgimporto #1 ","Mid Atlantic","1999","5","430.85","3.23","274.01","352.73" +"Children ","amalgexporti #1 ","Mid Atlantic","1999","6","501.32","79.48","425.23","162.68" +"Men ","exportiimporto #1 ","Mid Atlantic","1999","3","640.45","223.75","169.31","553.25" +"Men ","importoimporto #1 ","NY Metro","1999","3","565.97","150.86","360.98","157.11" +"Women ","importoamalg #1 ","NY Metro","1999","5","537.17","122.21","360.47","180.72" +"Music ","importoscholar #1 ","NY Metro","1999","2","621.43","206.65","116.08","391.67" +"Men ","amalgimporto #1 ","Mid Atlantic","1999","7","430.85","16.35","352.73","914.32" +"Children ","exportiexporti #1 ","Mid Atlantic","1999","7","590.06","176.88","231.42","649.66" +"Men ","amalgimporto #1 ","NY Metro","1999","2","500.24","88.94","301.43","180.51" +"Women ","exportiamalg #1 ","Mid Atlantic","1999","5","541.50","130.36","501.51","508.40" +"Shoes ","importoedu pack #1 ","NY Metro","1999","2","443.61","33.55","88.78","233.94" +"Men ","importoimporto #1 ","NY Metro","1999","4","565.97","157.11","150.86","353.88" +"Children ","importoexporti #1 ","Mid Atlantic","1999","7","539.59","132.87","362.24","755.44" +"Shoes ","edu packedu pack #1 ","NY Metro","1999","4","699.20","292.87","598.85","195.32" +"Women ","exportiamalg #1 ","Mid Atlantic","1999","2","541.50","138.50","220.14","165.24" +"Music ","importoscholar #1 ","Mid Atlantic","1999","2","621.63","221.21","381.07","299.65" +"Shoes ","importoedu pack #1 ","Mid Atlantic","1999","5","590.90","190.80","485.40","280.99" +"Women ","importoamalg #2 ","NY Metro","1999","5","443.14","45.71","292.85","133.99" +"Music ","amalgscholar #1 ","NY Metro","1999","7","596.05","200.29","210.76","727.86" +"Children ","exportiexporti #1 ","Mid Atlantic","1999","2","590.06","196.74","545.12","96.92" +"Children ","amalgexporti #1 ","NY Metro","1999","4","490.34","97.66","535.83","230.60" +"Children ","importoexporti #1 ","NY Metro","1999","5","671.55","279.07","242.11","408.60" +"Men ","edu packimporto #2 ","Mid Atlantic","1999","1","441.75","50.54","1058.81","132.13" +"Shoes ","exportiedu pack #1 ","Mid Atlantic","1999","5","851.33","462.97","698.20","409.14" +"Women ","importoamalg #1 ","Mid Atlantic","1999","6","653.96","266.57","415.02","658.15" +"Children ","edu packexporti #1 ","NY Metro","1999","1","568.80","182.53","1138.09","348.19" +"Music ","amalgscholar #1 ","NY Metro","1999","6","596.05","210.76","560.17","200.29" +"Children ","importoexporti #1 ","Mid Atlantic","1999","2","539.59","155.20","410.32","91.57" +"Shoes ","amalgedu pack #1 ","NY Metro","1999","2","572.15","187.90","738.64","195.18" +"Shoes ","importoedu pack #1 ","Mid Atlantic","1999","7","590.90","207.39","280.99","1154.44" +"Women ","importoamalg #1 ","NY Metro","1999","1","537.17","155.42","773.01","297.66" +"Women ","amalgamalg #1 ","Mid Atlantic","1999","7","605.56","224.87","530.40","1034.89" +"Shoes ","edu packedu pack #1 ","Mid Atlantic","1999","6","866.93","486.59","558.99","129.07" +"Shoes ","amalgedu pack #1 ","NY Metro","1999","3","572.15","195.18","187.90","345.36" +"Children ","amalgexporti #1 ","NY Metro","1999","9","490.34","113.61","676.43","588.15" +"Women ","exportiamalg #1 ","Mid Atlantic","1999","3","541.50","165.24","138.50","501.51" +"Men ","edu packimporto #1 ","NY Metro","1999","7","555.51","180.63","411.41","567.55" +"Shoes ","edu packedu pack #1 ","Mid Atlantic","1999","1","866.93","494.34","1463.53","244.85" +"Children ","amalgexporti #2 ","NY Metro","1999","5","474.08","102.04","295.22","289.85" +"Men ","edu packimporto #2 ","Mid Atlantic","1999","5","441.75","71.84","317.40","447.52" +"Children ","edu packexporti #1 ","NY Metro","1999","3","568.80","200.95","348.19","104.61" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00059.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00059.sql new file mode 100644 index 00000000000..9114f353d6c --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00059.sql @@ -0,0 +1,75 @@ +WITH + wss AS ( + SELECT + "d_week_seq" + , "ss_store_sk" + , "sum"((CASE WHEN ("d_day_name" = 'Sunday') THEN "ss_sales_price" ELSE null END)) "sun_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Monday') THEN "ss_sales_price" ELSE null END)) "mon_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Tuesday') THEN "ss_sales_price" ELSE null END)) "tue_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Wednesday') THEN "ss_sales_price" ELSE null END)) "wed_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Thursday') THEN "ss_sales_price" ELSE null END)) "thu_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Friday') THEN "ss_sales_price" ELSE null END)) "fri_sales" + , "sum"((CASE WHEN ("d_day_name" = 'Saturday') THEN "ss_sales_price" ELSE null END)) "sat_sales" + FROM + store_sales + , date_dim + WHERE ("d_date_sk" = "ss_sold_date_sk") + GROUP BY "d_week_seq", "ss_store_sk" +) +SELECT + "s_store_name1" +, "s_store_id1" +, "d_week_seq1" +, ("sun_sales1" / "sun_sales2") +, ("mon_sales1" / "mon_sales2") +, ("tue_sales1" / "tue_sales2") +, ("wed_sales1" / "wed_sales2") +, ("thu_sales1" / "thu_sales2") +, ("fri_sales1" / "fri_sales2") +, ("sat_sales1" / "sat_sales2") +FROM + ( + SELECT + "s_store_name" "s_store_name1" + , "wss"."d_week_seq" "d_week_seq1" + , "s_store_id" "s_store_id1" + , "sun_sales" "sun_sales1" + , "mon_sales" "mon_sales1" + , "tue_sales" "tue_sales1" + , "wed_sales" "wed_sales1" + , "thu_sales" "thu_sales1" + , "fri_sales" "fri_sales1" + , "sat_sales" "sat_sales1" + FROM + wss + , store + , date_dim d + WHERE ("d"."d_week_seq" = "wss"."d_week_seq") + AND ("ss_store_sk" = "s_store_sk") + AND ("d_month_seq" BETWEEN 1212 AND (1212 + 11)) +) y +, ( + SELECT + "s_store_name" "s_store_name2" + , "wss"."d_week_seq" "d_week_seq2" + , "s_store_id" "s_store_id2" + , "sun_sales" "sun_sales2" + , "mon_sales" "mon_sales2" + , "tue_sales" "tue_sales2" + , "wed_sales" "wed_sales2" + , "thu_sales" "thu_sales2" + , "fri_sales" "fri_sales2" + , "sat_sales" "sat_sales2" + FROM + wss + , store + , date_dim d + WHERE ("d"."d_week_seq" = "wss"."d_week_seq") + AND ("ss_store_sk" = "s_store_sk") + AND ("d_month_seq" BETWEEN (1212 + 12) AND (1212 + 23)) +) x +WHERE ("s_store_id1" = "s_store_id2") + AND ("d_week_seq1" = ("d_week_seq2" - 52)) +ORDER BY "s_store_name1" ASC, "s_store_id1" ASC, "d_week_seq1" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00059.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00059.txt new file mode 100644 index 00000000000..29d7ac4535c --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00059.txt @@ -0,0 +1,100 @@ +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5271","1.35","","","","0.89","0.56","1.57" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5272","0.42","","0.86","1.28","","","0.81" +"able","AAAAAAAACAAAAAAA","5273","","0.61","","0.65","1.90","1.25","" +"able","AAAAAAAACAAAAAAA","5273","","0.61","","0.65","1.90","1.25","" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00060.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00060.sql new file mode 100644 index 00000000000..af8c758938a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00060.sql @@ -0,0 +1,89 @@ +WITH + ss AS ( + SELECT + "i_item_id" + , "sum"("ss_ext_sales_price") "total_sales" + FROM + store_sales + , date_dim + , customer_address + , item + WHERE ("i_item_id" IN ( + SELECT "i_item_id" + FROM + item + WHERE ("i_category" IN ('Music')) + )) + AND ("ss_item_sk" = "i_item_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = 1998) + AND ("d_moy" = 9) + AND ("ss_addr_sk" = "ca_address_sk") + AND ("ca_gmt_offset" = -5) + GROUP BY "i_item_id" +) +, cs AS ( + SELECT + "i_item_id" + , "sum"("cs_ext_sales_price") "total_sales" + FROM + catalog_sales + , date_dim + , customer_address + , item + WHERE ("i_item_id" IN ( + SELECT "i_item_id" + FROM + item + WHERE ("i_category" IN ('Music')) + )) + AND ("cs_item_sk" = "i_item_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("d_year" = 1998) + AND ("d_moy" = 9) + AND ("cs_bill_addr_sk" = "ca_address_sk") + AND ("ca_gmt_offset" = -5) + GROUP BY "i_item_id" +) +, ws AS ( + SELECT + "i_item_id" + , "sum"("ws_ext_sales_price") "total_sales" + FROM + web_sales + , date_dim + , customer_address + , item + WHERE ("i_item_id" IN ( + SELECT "i_item_id" + FROM + item + WHERE ("i_category" IN ('Music')) + )) + AND ("ws_item_sk" = "i_item_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" = 1998) + AND ("d_moy" = 9) + AND ("ws_bill_addr_sk" = "ca_address_sk") + AND ("ca_gmt_offset" = -5) + GROUP BY "i_item_id" +) +SELECT + "i_item_id" +, "sum"("total_sales") "total_sales" +FROM + ( + SELECT * + FROM + ss +UNION ALL SELECT * + FROM + cs +UNION ALL SELECT * + FROM + ws +) tmp1 +GROUP BY "i_item_id" +ORDER BY "i_item_id" ASC, "total_sales" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00060.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00060.txt new file mode 100644 index 00000000000..0a76e03bbf6 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00060.txt @@ -0,0 +1,100 @@ +"AAAAAAAAAAHAAAAA","321.76" +"AAAAAAAAADBAAAAA","1648.20" +"AAAAAAAAAEBAAAAA","3378.42" +"AAAAAAAAAGFAAAAA","2937.12" +"AAAAAAAAAGHAAAAA","6229.09" +"AAAAAAAAAKBAAAAA","3336.13" +"AAAAAAAAAKDAAAAA","127.14" +"AAAAAAAAAKHAAAAA","2468.47" +"AAAAAAAAALAAAAAA","7240.78" +"AAAAAAAAAMEAAAAA","4301.22" +"AAAAAAAAAOCAAAAA","2242.91" +"AAAAAAAAAPBAAAAA","7735.75" +"AAAAAAAABAAAAAAA","587.88" +"AAAAAAAABFBAAAAA","8747.12" +"AAAAAAAABGDAAAAA","7273.60" +"AAAAAAAABKFAAAAA","92.70" +"AAAAAAAACDGAAAAA","73.37" +"AAAAAAAACFEAAAAA","84.37" +"AAAAAAAACFGAAAAA","3810.64" +"AAAAAAAACIAAAAAA","5505.10" +"AAAAAAAACIGAAAAA","984.00" +"AAAAAAAACIHAAAAA","4974.90" +"AAAAAAAACJFAAAAA","2555.53" +"AAAAAAAACKHAAAAA","288.20" +"AAAAAAAACLAAAAAA","5857.28" +"AAAAAAAACLBAAAAA","242.88" +"AAAAAAAACLHAAAAA","8420.02" +"AAAAAAAACNBAAAAA","633.57" +"AAAAAAAACNEAAAAA","21724.02" +"AAAAAAAACODAAAAA","32.43" +"AAAAAAAACPDAAAAA","4115.97" +"AAAAAAAADGBAAAAA","2653.90" +"AAAAAAAADGEAAAAA","1112.32" +"AAAAAAAADJBAAAAA","2961.42" +"AAAAAAAADNGAAAAA","3533.20" +"AAAAAAAAEABAAAAA","3250.00" +"AAAAAAAAEBCAAAAA","920.89" +"AAAAAAAAEBGAAAAA","359.04" +"AAAAAAAAECHAAAAA","287.05" +"AAAAAAAAEDGAAAAA","560.70" +"AAAAAAAAEEDAAAAA","24.69" +"AAAAAAAAEGAAAAAA","7574.72" +"AAAAAAAAEGDAAAAA","2020.58" +"AAAAAAAAEGGAAAAA","1960.32" +"AAAAAAAAEHCAAAAA","14308.50" +"AAAAAAAAEKGAAAAA","3727.86" +"AAAAAAAAELHAAAAA","223.08" +"AAAAAAAAEMBAAAAA","624.24" +"AAAAAAAAEMDAAAAA","19978.62" +"AAAAAAAAENAAAAAA","7994.77" +"AAAAAAAAENDAAAAA","2602.64" +"AAAAAAAAENFAAAAA","1245.90" +"AAAAAAAAEPBAAAAA","1694.46" +"AAAAAAAAEPDAAAAA","59.04" +"AAAAAAAAEPEAAAAA","1502.53" +"AAAAAAAAFIGAAAAA","563.85" +"AAAAAAAAFJFAAAAA","255.18" +"AAAAAAAAFMCAAAAA","13622.05" +"AAAAAAAAGAHAAAAA","734.16" +"AAAAAAAAGEAAAAAA","12788.07" +"AAAAAAAAGGBAAAAA","1643.45" +"AAAAAAAAGGEAAAAA","17446.53" +"AAAAAAAAGHEAAAAA","1464.21" +"AAAAAAAAGIFAAAAA","7514.79" +"AAAAAAAAGJBAAAAA","6878.09" +"AAAAAAAAGJCAAAAA","3955.84" +"AAAAAAAAGJEAAAAA","7896.10" +"AAAAAAAAGJFAAAAA","14023.21" +"AAAAAAAAGJHAAAAA","1311.53" +"AAAAAAAAGMBAAAAA","2874.30" +"AAAAAAAAGMEAAAAA","208.98" +"AAAAAAAAGMHAAAAA","11786.97" +"AAAAAAAAGOAAAAAA","2577.88" +"AAAAAAAAGPCAAAAA","58.90" +"AAAAAAAAHEFAAAAA","4005.16" +"AAAAAAAAHIBAAAAA","391.84" +"AAAAAAAAHNFAAAAA","1068.00" +"AAAAAAAAIBHAAAAA","20099.24" +"AAAAAAAAICAAAAAA","3730.45" +"AAAAAAAAICHAAAAA","1544.32" +"AAAAAAAAIEHAAAAA","5398.19" +"AAAAAAAAIFAAAAAA","90.48" +"AAAAAAAAIFBAAAAA","29.44" +"AAAAAAAAIFDAAAAA","860.60" +"AAAAAAAAIFGAAAAA","2421.76" +"AAAAAAAAIGFAAAAA","1455.65" +"AAAAAAAAIIBAAAAA","3301.28" +"AAAAAAAAIIDAAAAA","2719.79" +"AAAAAAAAIJAAAAAA","5542.24" +"AAAAAAAAIJCAAAAA","1440.74" +"AAAAAAAAILAAAAAA","9876.74" +"AAAAAAAAILBAAAAA","6674.03" +"AAAAAAAAILDAAAAA","14812.41" +"AAAAAAAAILHAAAAA","1139.43" +"AAAAAAAAIMAAAAAA","2344.87" +"AAAAAAAAIOAAAAAA","1257.32" +"AAAAAAAAIOGAAAAA","13029.61" +"AAAAAAAAIPAAAAAA","12948.69" +"AAAAAAAAIPFAAAAA","4037.76" +"AAAAAAAAJFCAAAAA","1758.76" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00061.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00061.sql new file mode 100644 index 00000000000..17cd1933864 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00061.sql @@ -0,0 +1,53 @@ +SELECT + "promotions" +, "total" +, ((CAST("promotions" AS DECIMAL(15,4)) / CAST("total" AS DECIMAL(15,4))) * 100) +FROM + ( + SELECT "sum"("ss_ext_sales_price") "promotions" + FROM + store_sales + , store + , promotion + , date_dim + , customer + , customer_address + , item + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("ss_promo_sk" = "p_promo_sk") + AND ("ss_customer_sk" = "c_customer_sk") + AND ("ca_address_sk" = "c_current_addr_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("ca_gmt_offset" = -5) + AND ("i_category" = 'Jewelry') + AND (("p_channel_dmail" = 'Y') + OR ("p_channel_email" = 'Y') + OR ("p_channel_tv" = 'Y')) + AND ("s_gmt_offset" = -5) + AND ("d_year" = 1998) + AND ("d_moy" = 11) +) promotional_sales +, ( + SELECT "sum"("ss_ext_sales_price") "total" + FROM + store_sales + , store + , date_dim + , customer + , customer_address + , item + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("ss_customer_sk" = "c_customer_sk") + AND ("ca_address_sk" = "c_current_addr_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("ca_gmt_offset" = -5) + AND ("i_category" = 'Jewelry') + AND ("s_gmt_offset" = -5) + AND ("d_year" = 1998) + AND ("d_moy" = 11) +) all_sales +ORDER BY "promotions" ASC, "total" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00061.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00061.txt new file mode 100644 index 00000000000..2bcb286bdbf --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00061.txt @@ -0,0 +1 @@ +"299773.09","304031.94","98.6000" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00062.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00062.sql new file mode 100644 index 00000000000..044ebe55da5 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00062.sql @@ -0,0 +1,27 @@ +SELECT + "substr"("w_warehouse_name", 1, 20) +, "sm_type" +, "web_name" +, "sum"((CASE WHEN (("ws_ship_date_sk" - "ws_sold_date_sk") <= 30) THEN 1 ELSE 0 END)) "30 days" +, "sum"((CASE WHEN (("ws_ship_date_sk" - "ws_sold_date_sk") > 30) + AND (("ws_ship_date_sk" - "ws_sold_date_sk") <= 60) THEN 1 ELSE 0 END)) "31-60 days" +, "sum"((CASE WHEN (("ws_ship_date_sk" - "ws_sold_date_sk") > 60) + AND (("ws_ship_date_sk" - "ws_sold_date_sk") <= 90) THEN 1 ELSE 0 END)) "61-90 days" +, "sum"((CASE WHEN (("ws_ship_date_sk" - "ws_sold_date_sk") > 90) + AND (("ws_ship_date_sk" - "ws_sold_date_sk") <= 120) THEN 1 ELSE 0 END)) "91-120 days" +, "sum"((CASE WHEN (("ws_ship_date_sk" - "ws_sold_date_sk") > 120) THEN 1 ELSE 0 END)) ">120 days" +FROM + web_sales +, warehouse +, ship_mode +, web_site +, date_dim +WHERE ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + AND ("ws_ship_date_sk" = "d_date_sk") + AND ("ws_warehouse_sk" = "w_warehouse_sk") + AND ("ws_ship_mode_sk" = "sm_ship_mode_sk") + AND ("ws_web_site_sk" = "web_site_sk") +GROUP BY "substr"("w_warehouse_name", 1, 20), "sm_type", "web_name" +ORDER BY "substr"("w_warehouse_name", 1, 20) ASC, "sm_type" ASC, "web_name" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00062.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00062.txt new file mode 100644 index 00000000000..cee34be65ac --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00062.txt @@ -0,0 +1,6 @@ +"Conventional childr","EXPRESS ","site_0","128","107","124","93","0" +"Conventional childr","LIBRARY ","site_0","77","77","90","75","0" +"Conventional childr","NEXT DAY ","site_0","109","117","114","109","0" +"Conventional childr","OVERNIGHT ","site_0","78","84","83","68","0" +"Conventional childr","REGULAR ","site_0","93","87","75","65","0" +"Conventional childr","TWO DAY ","site_0","93","97","78","93","0" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00063.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00063.sql new file mode 100644 index 00000000000..01ff37733dc --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00063.sql @@ -0,0 +1,28 @@ +SELECT * +FROM + ( + SELECT + "i_manager_id" + , "sum"("ss_sales_price") "sum_sales" + , "avg"("sum"("ss_sales_price")) OVER (PARTITION BY "i_manager_id") "avg_monthly_sales" + FROM + item + , store_sales + , date_dim + , store + WHERE ("ss_item_sk" = "i_item_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("d_month_seq" IN (1200 , (1200 + 1) , (1200 + 2) , (1200 + 3) , (1200 + 4) , (1200 + 5) , (1200 + 6) , (1200 + 7) , (1200 + 8) , (1200 + 9) , (1200 + 10) , (1200 + 11))) + AND ((("i_category" IN ('Books' , 'Children' , 'Electronics')) + AND ("i_class" IN ('personal' , 'portable' , 'refernece' , 'self-help')) + AND ("i_brand" IN ('scholaramalgamalg #14' , 'scholaramalgamalg #7' , 'exportiunivamalg #9' , 'scholaramalgamalg #9'))) + OR (("i_category" IN ('Women' , 'Music' , 'Men')) + AND ("i_class" IN ('accessories' , 'classical' , 'fragrances' , 'pants')) + AND ("i_brand" IN ('amalgimporto #1' , 'edu packscholar #1' , 'exportiimporto #1' , 'importoamalg #1')))) + GROUP BY "i_manager_id", "d_moy" +) tmp1 +WHERE ((CASE WHEN ("avg_monthly_sales" > 0) THEN ("abs"(("sum_sales" - "avg_monthly_sales")) / "avg_monthly_sales") ELSE null END) > DECIMAL '0.1') +ORDER BY "i_manager_id" ASC, "avg_monthly_sales" ASC, "sum_sales" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00063.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00063.txt new file mode 100644 index 00000000000..6b683aebc4e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00063.txt @@ -0,0 +1,100 @@ +"6","4.68","241.17" +"6","17.82","241.17" +"6","51.64","241.17" +"6","51.86","241.17" +"6","92.48","241.17" +"6","143.63","241.17" +"6","175.21","241.17" +"6","199.64","241.17" +"6","280.21","241.17" +"6","431.02","241.17" +"6","659.22","241.17" +"6","786.68","241.17" +"7","18.83","90.39" +"7","28.70","90.39" +"7","38.89","90.39" +"7","59.94","90.39" +"7","63.54","90.39" +"7","70.52","90.39" +"7","75.08","90.39" +"7","372.65","90.39" +"10","6.97","96.01" +"10","38.95","96.01" +"10","65.62","96.01" +"10","106.46","96.01" +"10","123.37","96.01" +"10","138.49","96.01" +"10","200.62","96.01" +"11","4.70","95.22" +"11","13.30","95.22" +"11","37.73","95.22" +"11","44.48","95.22" +"11","83.35","95.22" +"11","125.25","95.22" +"11","157.40","95.22" +"11","158.40","95.22" +"11","232.35","95.22" +"12","7.60","74.01" +"12","44.91","74.01" +"12","52.57","74.01" +"12","52.61","74.01" +"12","55.18","74.01" +"12","63.93","74.01" +"12","114.55","74.01" +"12","129.53","74.01" +"12","145.25","74.01" +"20","6.76","172.32" +"20","39.32","172.32" +"20","73.39","172.32" +"20","87.74","172.32" +"20","90.97","172.32" +"20","113.41","172.32" +"20","130.57","172.32" +"20","259.88","172.32" +"20","302.56","172.32" +"20","310.60","172.32" +"20","480.30","172.32" +"22","64.89","142.90" +"22","65.29","142.90" +"22","81.69","142.90" +"22","92.61","142.90" +"22","105.32","142.90" +"22","199.37","142.90" +"22","219.62","142.90" +"22","314.44","142.90" +"25","2.31","86.13" +"25","3.65","86.13" +"25","7.47","86.13" +"25","11.40","86.13" +"25","105.02","86.13" +"25","107.24","86.13" +"25","137.71","86.13" +"25","179.24","86.13" +"25","227.42","86.13" +"26","0.00","119.89" +"26","20.17","119.89" +"26","59.76","119.89" +"26","67.75","119.89" +"26","99.51","119.89" +"26","175.17","119.89" +"26","192.48","119.89" +"26","206.73","119.89" +"26","257.44","119.89" +"28","63.02","250.84" +"28","86.68","250.84" +"28","105.96","250.84" +"28","113.79","250.84" +"28","186.60","250.84" +"28","203.15","250.84" +"28","209.72","250.84" +"28","212.80","250.84" +"28","457.29","250.84" +"28","532.85","250.84" +"28","569.02","250.84" +"31","12.03","184.30" +"31","19.53","184.30" +"31","31.33","184.30" +"31","98.11","184.30" +"31","124.13","184.30" +"31","129.51","184.30" +"31","155.25","184.30" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00065.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00065.sql new file mode 100644 index 00000000000..8c68814be3a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00065.sql @@ -0,0 +1,50 @@ +SELECT + "s_store_name" +, "i_item_desc" +, "sc"."revenue" +, "i_current_price" +, "i_wholesale_cost" +, "i_brand" +FROM + store +, item +, ( + SELECT + "ss_store_sk" + , "avg"("revenue") "ave" + FROM + ( + SELECT + "ss_store_sk" + , "ss_item_sk" + , "sum"("ss_sales_price") "revenue" + FROM + store_sales + , date_dim + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("d_month_seq" BETWEEN 1176 AND (1176 + 11)) + GROUP BY "ss_store_sk", "ss_item_sk" + ) sa + GROUP BY "ss_store_sk" +) sb +, ( + SELECT + "ss_store_sk" + , "ss_item_sk" + , "sum"("ss_sales_price") "revenue" + FROM + store_sales + , date_dim + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("d_month_seq" BETWEEN 1176 AND (1176 + 11)) + GROUP BY "ss_store_sk", "ss_item_sk" +) sc +WHERE ("sb"."ss_store_sk" = "sc"."ss_store_sk") + AND ("sc"."revenue" <= (DECIMAL '0.1' * "sb"."ave")) + AND ("s_store_sk" = "sc"."ss_store_sk") + AND ("i_item_sk" = "sc"."ss_item_sk") +ORDER BY "s_store_name" ASC, "i_item_desc" ASC, + -- additional columns to assure results stability for larger scale factors, this is a deviation from TPC-DS specification + "i_brand" ASC, "sc"."revenue" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00065.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00065.txt new file mode 100644 index 00000000000..03d4fbe8105 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00065.txt @@ -0,0 +1,3 @@ +"ought","Everyday strings might wash for example about a pp.. Right physical specialists can break privately hungry journalists. Devices will not defend offices. Content, new projects should not se","36.59","2.40","1.99","edu packscholar #1 " +"ought","Grounds freeze previously then full rises. Familiar, big activities require as across a attitudes. Nuclear movies gain t","38.35","8.74","6.64","scholarbrand #3 " +"ought","Voters cause already urban, formal children. Medieval shares must not spare human, crazy things; so public ","30.42","9.27","3.98","maxibrand #10 " \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00066.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00066.sql new file mode 100644 index 00000000000..50a1633296b --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00066.sql @@ -0,0 +1,147 @@ +SELECT + "w_warehouse_name" +, "w_warehouse_sq_ft" +, "w_city" +, "w_county" +, "w_state" +, "w_country" +, "ship_carriers" +, "year" +, "sum"("jan_sales") "jan_sales" +, "sum"("feb_sales") "feb_sales" +, "sum"("mar_sales") "mar_sales" +, "sum"("apr_sales") "apr_sales" +, "sum"("may_sales") "may_sales" +, "sum"("jun_sales") "jun_sales" +, "sum"("jul_sales") "jul_sales" +, "sum"("aug_sales") "aug_sales" +, "sum"("sep_sales") "sep_sales" +, "sum"("oct_sales") "oct_sales" +, "sum"("nov_sales") "nov_sales" +, "sum"("dec_sales") "dec_sales" +, "sum"(("jan_sales" / "w_warehouse_sq_ft")) "jan_sales_per_sq_foot" +, "sum"(("feb_sales" / "w_warehouse_sq_ft")) "feb_sales_per_sq_foot" +, "sum"(("mar_sales" / "w_warehouse_sq_ft")) "mar_sales_per_sq_foot" +, "sum"(("apr_sales" / "w_warehouse_sq_ft")) "apr_sales_per_sq_foot" +, "sum"(("may_sales" / "w_warehouse_sq_ft")) "may_sales_per_sq_foot" +, "sum"(("jun_sales" / "w_warehouse_sq_ft")) "jun_sales_per_sq_foot" +, "sum"(("jul_sales" / "w_warehouse_sq_ft")) "jul_sales_per_sq_foot" +, "sum"(("aug_sales" / "w_warehouse_sq_ft")) "aug_sales_per_sq_foot" +, "sum"(("sep_sales" / "w_warehouse_sq_ft")) "sep_sales_per_sq_foot" +, "sum"(("oct_sales" / "w_warehouse_sq_ft")) "oct_sales_per_sq_foot" +, "sum"(("nov_sales" / "w_warehouse_sq_ft")) "nov_sales_per_sq_foot" +, "sum"(("dec_sales" / "w_warehouse_sq_ft")) "dec_sales_per_sq_foot" +, "sum"("jan_net") "jan_net" +, "sum"("feb_net") "feb_net" +, "sum"("mar_net") "mar_net" +, "sum"("apr_net") "apr_net" +, "sum"("may_net") "may_net" +, "sum"("jun_net") "jun_net" +, "sum"("jul_net") "jul_net" +, "sum"("aug_net") "aug_net" +, "sum"("sep_net") "sep_net" +, "sum"("oct_net") "oct_net" +, "sum"("nov_net") "nov_net" +, "sum"("dec_net") "dec_net" +FROM +( + SELECT + "w_warehouse_name" + , "w_warehouse_sq_ft" + , "w_city" + , "w_county" + , "w_state" + , "w_country" + , "concat"("concat"('DHL', ','), 'BARIAN') "ship_carriers" + , "d_year" "YEAR" + , "sum"((CASE WHEN ("d_moy" = 1) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "jan_sales" + , "sum"((CASE WHEN ("d_moy" = 2) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "feb_sales" + , "sum"((CASE WHEN ("d_moy" = 3) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "mar_sales" + , "sum"((CASE WHEN ("d_moy" = 4) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "apr_sales" + , "sum"((CASE WHEN ("d_moy" = 5) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "may_sales" + , "sum"((CASE WHEN ("d_moy" = 6) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "jun_sales" + , "sum"((CASE WHEN ("d_moy" = 7) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "jul_sales" + , "sum"((CASE WHEN ("d_moy" = 8) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "aug_sales" + , "sum"((CASE WHEN ("d_moy" = 9) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "sep_sales" + , "sum"((CASE WHEN ("d_moy" = 10) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "oct_sales" + , "sum"((CASE WHEN ("d_moy" = 11) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "nov_sales" + , "sum"((CASE WHEN ("d_moy" = 12) THEN ("ws_ext_sales_price" * "ws_quantity") ELSE 0 END)) "dec_sales" + , "sum"((CASE WHEN ("d_moy" = 1) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "jan_net" + , "sum"((CASE WHEN ("d_moy" = 2) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "feb_net" + , "sum"((CASE WHEN ("d_moy" = 3) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "mar_net" + , "sum"((CASE WHEN ("d_moy" = 4) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "apr_net" + , "sum"((CASE WHEN ("d_moy" = 5) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "may_net" + , "sum"((CASE WHEN ("d_moy" = 6) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "jun_net" + , "sum"((CASE WHEN ("d_moy" = 7) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "jul_net" + , "sum"((CASE WHEN ("d_moy" = 8) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "aug_net" + , "sum"((CASE WHEN ("d_moy" = 9) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "sep_net" + , "sum"((CASE WHEN ("d_moy" = 10) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "oct_net" + , "sum"((CASE WHEN ("d_moy" = 11) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "nov_net" + , "sum"((CASE WHEN ("d_moy" = 12) THEN ("ws_net_paid" * "ws_quantity") ELSE 0 END)) "dec_net" + FROM + web_sales + , warehouse + , date_dim + , time_dim + , ship_mode + WHERE ("ws_warehouse_sk" = "w_warehouse_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("ws_sold_time_sk" = "t_time_sk") + AND ("ws_ship_mode_sk" = "sm_ship_mode_sk") + AND ("d_year" = 2001) + AND ("t_time" BETWEEN 30838 AND (30838 + 28800)) + AND ("sm_carrier" IN ('DHL' , 'BARIAN')) + GROUP BY "w_warehouse_name", "w_warehouse_sq_ft", "w_city", "w_county", "w_state", "w_country", "d_year" + UNION ALL + SELECT + "w_warehouse_name" + , "w_warehouse_sq_ft" + , "w_city" + , "w_county" + , "w_state" + , "w_country" + , "concat"("concat"('DHL', ','), 'BARIAN') "ship_carriers" + , "d_year" "YEAR" + , "sum"((CASE WHEN ("d_moy" = 1) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "jan_sales" + , "sum"((CASE WHEN ("d_moy" = 2) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "feb_sales" + , "sum"((CASE WHEN ("d_moy" = 3) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "mar_sales" + , "sum"((CASE WHEN ("d_moy" = 4) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "apr_sales" + , "sum"((CASE WHEN ("d_moy" = 5) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "may_sales" + , "sum"((CASE WHEN ("d_moy" = 6) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "jun_sales" + , "sum"((CASE WHEN ("d_moy" = 7) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "jul_sales" + , "sum"((CASE WHEN ("d_moy" = 8) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "aug_sales" + , "sum"((CASE WHEN ("d_moy" = 9) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "sep_sales" + , "sum"((CASE WHEN ("d_moy" = 10) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "oct_sales" + , "sum"((CASE WHEN ("d_moy" = 11) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "nov_sales" + , "sum"((CASE WHEN ("d_moy" = 12) THEN ("cs_sales_price" * "cs_quantity") ELSE 0 END)) "dec_sales" + , "sum"((CASE WHEN ("d_moy" = 1) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "jan_net" + , "sum"((CASE WHEN ("d_moy" = 2) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "feb_net" + , "sum"((CASE WHEN ("d_moy" = 3) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "mar_net" + , "sum"((CASE WHEN ("d_moy" = 4) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "apr_net" + , "sum"((CASE WHEN ("d_moy" = 5) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "may_net" + , "sum"((CASE WHEN ("d_moy" = 6) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "jun_net" + , "sum"((CASE WHEN ("d_moy" = 7) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "jul_net" + , "sum"((CASE WHEN ("d_moy" = 8) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "aug_net" + , "sum"((CASE WHEN ("d_moy" = 9) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "sep_net" + , "sum"((CASE WHEN ("d_moy" = 10) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "oct_net" + , "sum"((CASE WHEN ("d_moy" = 11) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "nov_net" + , "sum"((CASE WHEN ("d_moy" = 12) THEN ("cs_net_paid_inc_tax" * "cs_quantity") ELSE 0 END)) "dec_net" + FROM + catalog_sales + , warehouse + , date_dim + , time_dim + , ship_mode + WHERE ("cs_warehouse_sk" = "w_warehouse_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("cs_sold_time_sk" = "t_time_sk") + AND ("cs_ship_mode_sk" = "sm_ship_mode_sk") + AND ("d_year" = 2001) + AND ("t_time" BETWEEN 30838 AND (30838 + 28800)) + AND ("sm_carrier" IN ('DHL' , 'BARIAN')) + GROUP BY "w_warehouse_name", "w_warehouse_sq_ft", "w_city", "w_county", "w_state", "w_country", "d_year" + ) x +GROUP BY "w_warehouse_name", "w_warehouse_sq_ft", "w_city", "w_county", "w_state", "w_country", "ship_carriers", "year" +ORDER BY "w_warehouse_name" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00066.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00066.txt new file mode 100644 index 00000000000..813eb8a0739 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00066.txt @@ -0,0 +1 @@ +"Conventional childr","977787","Midway","Williamson County","TN","United States","DHL,BARIAN","2001","661407.18","766942.78","307720.05","333390.59","1904937.34","2308974.68","1310866.26","2298210.15","1497771.61","2900278.47","5213564.64","2706805.34","0.68","0.78","0.32","0.35","1.94","2.36","1.34","2.35","1.53","2.97","5.33","2.77","7554063.29","8213766.03","7574329.97","4142886.32","3575413.31","4126236.48","5015953.55","9665997.01","10823343.90","13418884.62","23331407.18","19502364.49" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00067.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00067.sql new file mode 100644 index 00000000000..164076b6f80 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00067.sql @@ -0,0 +1,42 @@ +SELECT * +FROM + ( + SELECT + "i_category" + , "i_class" + , "i_brand" + , "i_product_name" + , "d_year" + , "d_qoy" + , "d_moy" + , "s_store_id" + , "sumsales" + , "rank"() OVER (PARTITION BY "i_category" ORDER BY "sumsales" DESC) "rk" + FROM + ( + SELECT + "i_category" + , "i_class" + , "i_brand" + , "i_product_name" + , "d_year" + , "d_qoy" + , "d_moy" + , "s_store_id" + , "sum"(COALESCE(("ss_sales_price" * "ss_quantity"), 0)) "sumsales" + FROM + store_sales + , date_dim + , store + , item + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + GROUP BY ROLLUP (i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id) + ) dw1 +) dw2 +WHERE ("rk" <= 100) +ORDER BY "i_category" ASC, "i_class" ASC, "i_brand" ASC, "i_product_name" ASC, "d_year" ASC, "d_qoy" ASC, "d_moy" ASC, "s_store_id" ASC, "sumsales" ASC, "rk" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00067.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00067.txt new file mode 100644 index 00000000000..79776dc8983 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00067.txt @@ -0,0 +1,100 @@ +"Books ","arts ","amalgmaxi #12 ","","","","","","106170.65","29" +"Books ","arts ","","","","","","","221757.66","14" +"Books ","business ","importomaxi #12 ","","","","","","68169.94","59" +"Books ","business ","importomaxi #9 ","esecallyn stought ","2000","","","","73055.57","46" +"Books ","business ","importomaxi #9 ","esecallyn stought ","","","","","73055.57","46" +"Books ","business ","importomaxi #9 ","","","","","","141150.65","21" +"Books ","business ","","","","","","","239811.65","12" +"Books ","computers ","exportimaxi #12 ","ationableeseought ","2000","","","","60204.14","78" +"Books ","computers ","exportimaxi #12 ","ationableeseought ","","","","","60204.14","78" +"Books ","computers ","exportimaxi #12 ","","","","","","60204.14","78" +"Books ","computers ","exportimaxi #3 ","","","","","","70771.88","54" +"Books ","computers ","exportimaxi #8 ","oughtoughteing ","2000","","","","65784.71","63" +"Books ","computers ","exportimaxi #8 ","oughtoughteing ","","","","","65784.71","63" +"Books ","computers ","exportimaxi #8 ","","","","","","65784.71","63" +"Books ","computers ","exportimaxi #9 ","eingeingn stought ","2000","","","","62441.73","73" +"Books ","computers ","exportimaxi #9 ","eingeingn stought ","","","","","62441.73","73" +"Books ","computers ","exportimaxi #9 ","","","","","","62441.73","73" +"Books ","computers ","","","","","","","284009.89","8" +"Books ","cooking ","","","","","","","156277.51","18" +"Books ","entertainments ","edu packmaxi #12 ","","","","","","110227.30","27" +"Books ","entertainments ","edu packmaxi #3 ","","","","","","89606.10","32" +"Books ","entertainments ","","","","","","","289817.88","7" +"Books ","fiction ","scholarunivamalg #8 ","","","","","","147115.61","20" +"Books ","fiction ","","","","","","","271225.05","10" +"Books ","history ","scholarmaxi #2 ","n stableoughtought ","2000","","","","65745.04","66" +"Books ","history ","scholarmaxi #2 ","n stableoughtought ","","","","","65745.04","66" +"Books ","history ","scholarmaxi #2 ","","","","","","65745.04","66" +"Books ","history ","scholarmaxi #3 ","","","","","","66622.05","62" +"Books ","history ","scholarmaxi #8 ","oughtn stableought ","2000","","","","82434.59","38" +"Books ","history ","scholarmaxi #8 ","oughtn stableought ","","","","","82434.59","38" +"Books ","history ","scholarmaxi #8 ","","","","","","82434.59","38" +"Books ","history ","scholarmaxi #9 ","eingablen stought ","2000","","","","67501.76","60" +"Books ","history ","scholarmaxi #9 ","eingablen stought ","","","","","67501.76","60" +"Books ","history ","scholarmaxi #9 ","","","","","","113376.69","26" +"Books ","history ","","","","","","","328178.37","5" +"Books ","home repair ","","","","","","","206323.67","15" +"Books ","mystery ","corpunivamalg #12 ","","","","","","79181.19","44" +"Books ","mystery ","corpunivamalg #3 ","","","","","","118391.78","25" +"Books ","mystery ","corpunivamalg #6 ","antieingn stought ","2000","","","","82591.78","35" +"Books ","mystery ","corpunivamalg #6 ","antieingn stought ","","","","","82591.78","35" +"Books ","mystery ","corpunivamalg #6 ","","","","","","82591.78","35" +"Books ","mystery ","corpunivamalg #9 ","","","","","","85588.12","34" +"Books ","mystery ","","","","","","","365752.87","4" +"Books ","parenting ","corpmaxi #2 ","","","","","","65408.33","69" +"Books ","parenting ","corpmaxi #3 ","ableableought ","2000","","","","51277.66","100" +"Books ","parenting ","corpmaxi #3 ","ableableought ","","","","","51277.66","100" +"Books ","parenting ","corpmaxi #3 ","","","","","","51277.66","100" +"Books ","parenting ","corpmaxi #6 ","priantically ","2000","","","","53307.56","95" +"Books ","parenting ","corpmaxi #6 ","priantically ","","","","","53307.56","95" +"Books ","parenting ","corpmaxi #6 ","","","","","","53307.56","95" +"Books ","parenting ","","","","","","","247607.04","11" +"Books ","reference ","brandmaxi #12 ","oughtoughtpri ","2000","","","","56564.86","86" +"Books ","reference ","brandmaxi #12 ","oughtoughtpri ","","","","","56564.86","86" +"Books ","reference ","brandmaxi #12 ","","","","","","86348.02","33" +"Books ","reference ","brandmaxi #2 ","n stcallyn stought ","2000","","","","62989.79","71" +"Books ","reference ","brandmaxi #2 ","n stcallyn stought ","","","","","62989.79","71" +"Books ","reference ","brandmaxi #2 ","","","","","","81984.16","41" +"Books ","reference ","brandmaxi #8 ","","","","","","101777.11","30" +"Books ","reference ","brandmaxi #9 ","","","","","","68275.25","58" +"Books ","reference ","","","","","","","385473.48","3" +"Books ","romance ","namelessmaxi #12 ","","","","","","59906.93","85" +"Books ","romance ","namelessmaxi #2 ","oughtablebarought ","2000","","","","69998.44","56" +"Books ","romance ","namelessmaxi #2 ","oughtablebarought ","","","","","69998.44","56" +"Books ","romance ","namelessmaxi #2 ","","","","","","131002.62","23" +"Books ","romance ","namelessmaxi #3 ","","","","","","65403.91","70" +"Books ","romance ","namelessmaxi #6 ","ationationantiought ","2000","","","","79832.98","42" +"Books ","romance ","namelessmaxi #6 ","ationationantiought ","","","","","79832.98","42" +"Books ","romance ","namelessmaxi #6 ","","","","","","158258.17","17" +"Books ","romance ","","","","","","","483217.86","2" +"Books ","science ","maximaxi #6 ","n stcallyeing ","2000","","","","59925.37","83" +"Books ","science ","maximaxi #6 ","n stcallyeing ","","","","","59925.37","83" +"Books ","science ","maximaxi #6 ","prioughtpriought ","2000","","","","60626.67","76" +"Books ","science ","maximaxi #6 ","prioughtpriought ","","","","","60626.67","76" +"Books ","science ","maximaxi #6 ","","","","","","120552.04","24" +"Books ","science ","maximaxi #8 ","antin stationought ","2000","","","","52895.51","98" +"Books ","science ","maximaxi #8 ","antin stationought ","","","","","52895.51","98" +"Books ","science ","maximaxi #8 ","ationcallyableought ","2000","","","","53896.14","90" +"Books ","science ","maximaxi #8 ","ationcallyableought ","","","","","53896.14","90" +"Books ","science ","maximaxi #8 ","","","","","","106791.65","28" +"Books ","science ","","","","","","","227600.89","13" +"Books ","self-help ","exportiunivamalg #2 ","antieseought ","2000","","","","56493.84","88" +"Books ","self-help ","exportiunivamalg #2 ","antieseought ","","","","","56493.84","88" +"Books ","self-help ","exportiunivamalg #2 ","prioughtcally ","2000","","","","60092.79","81" +"Books ","self-help ","exportiunivamalg #2 ","prioughtcally ","","","","","60092.79","81" +"Books ","self-help ","exportiunivamalg #2 ","","","","","","153506.64","19" +"Books ","self-help ","exportiunivamalg #3 ","barprioughtought ","2000","","","","53411.21","92" +"Books ","self-help ","exportiunivamalg #3 ","barprioughtought ","","","","","53411.21","92" +"Books ","self-help ","exportiunivamalg #3 ","","","","","","53411.21","92" +"Books ","self-help ","exportiunivamalg #6 ","","","","","","70235.42","55" +"Books ","self-help ","","","","","","","277153.27","9" +"Books ","sports ","edu packunivamalg #12 ","oughtation ","2000","","","","71207.82","52" +"Books ","sports ","edu packunivamalg #12 ","oughtation ","","","","","71207.82","52" +"Books ","sports ","edu packunivamalg #12 ","","","","","","92087.90","31" +"Books ","sports ","","","","","","","171111.30","16" +"Books ","travel ","univunivamalg #12 ","","","","","","75167.47","45" +"Books ","travel ","univunivamalg #8 ","","","","","","136952.97","22" +"Books ","travel ","","","","","","","296467.62","6" +"Books ","","corpunivamalg #3 ","esen stcallyought ","2000","","","","71879.43","48" +"Books ","","corpunivamalg #3 ","esen stcallyought ","","","","","71879.43","48" +"Books ","","corpunivamalg #3 ","","","","","","71879.43","48" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00068.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00068.sql new file mode 100644 index 00000000000..51293444d37 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00068.sql @@ -0,0 +1,43 @@ +SELECT + "c_last_name" +, "c_first_name" +, "ca_city" +, "bought_city" +, "ss_ticket_number" +, "extended_price" +, "extended_tax" +, "list_price" +FROM + ( + SELECT + "ss_ticket_number" + , "ss_customer_sk" + , "ca_city" "bought_city" + , "sum"("ss_ext_sales_price") "extended_price" + , "sum"("ss_ext_list_price") "list_price" + , "sum"("ss_ext_tax") "extended_tax" + FROM + store_sales + , date_dim + , store + , household_demographics + , customer_address + 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 ("store_sales"."ss_addr_sk" = "customer_address"."ca_address_sk") + AND ("date_dim"."d_dom" BETWEEN 1 AND 2) + AND (("household_demographics"."hd_dep_count" = 4) + OR ("household_demographics"."hd_vehicle_count" = 3)) + AND ("date_dim"."d_year" IN (1999 , (1999 + 1) , (1999 + 2))) + AND ("store"."s_city" IN ('Midway' , 'Fairview')) + GROUP BY "ss_ticket_number", "ss_customer_sk", "ss_addr_sk", "ca_city" +) dn +, customer +, customer_address current_addr +WHERE ("ss_customer_sk" = "c_customer_sk") + AND ("customer"."c_current_addr_sk" = "current_addr"."ca_address_sk") + AND ("current_addr"."ca_city" <> "bought_city") +ORDER BY "c_last_name" ASC, "ss_ticket_number" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00068.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00068.txt new file mode 100644 index 00000000000..5f7d78d42ef --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00068.txt @@ -0,0 +1,73 @@ +"Adams ","Catherine ","Riverdale","Summit","2987","25044.82","1202.93","62436.70" +"Bailey ","Robert ","Mount Olive","Woodland","8841","17281.74","1253.32","45966.38" +"Baker ","Joy ","Highland Park","Mount Zion","4416","24704.79","957.88","36746.67" +"Batson ","Gina ","Enterprise","Andover","1347","39883.83","1540.86","66458.59" +"Benitez ","Michele ","Newport","Greenville","4976","9996.21","471.37","37443.67" +"Berry ","Nancy ","Woodruff","Oak Ridge","2352","22546.58","1626.86","44868.62" +"Blair ","John ","Spring Valley","Hillcrest","8912","17089.06","511.34","29505.97" +"Britt ","Inez ","Sunnyside","Plainview","61","10161.88","276.81","25080.96" +"Brookins ","Thomas ","Walnut Grove","Bethel","2678","27999.84","1131.97","53250.77" +"Brown ","Michael ","Webb","Oak Grove","7856","21308.72","991.40","52522.99" +"Brunson ","Albert ","Whitesville","Willow","7453","25279.27","803.82","51683.81" +"Buchanan ","Theresa ","Brownsville","Valley View","7406","6814.02","325.55","10392.47" +"Carlson ","Maxine ","Warwick","Bridgeport","8622","27194.96","1264.46","55859.57" +"Child ","Hellen ","Providence","Riverside","7950","21839.98","933.81","46845.40" +"Clancy ","Gladys ","Macedonia","Belmont","7350","29933.43","683.17","48704.58" +"Clarke ","Walter ","Mount Zion","Spring Hill","3317","15728.92","579.17","48351.10" +"Cole ","Ruby ","Edgewood","Arlington","7637","23839.23","1659.91","49095.59" +"Collins ","Margaret ","Pine Grove","Union","7244","21138.78","1230.26","40388.74" +"Cook ","Ingrid ","Colfax","Glendale","4001","14498.24","966.98","46497.03" +"Davidson ","Darrell ","Shiloh","Mountain View","4114","24869.60","1798.89","53848.47" +"Davis ","Colleen ","Ashland","Waterloo","4322","8751.88","210.32","35424.00" +"Davis ","Colleen ","Ashland","Marion","5405","34551.54","1166.43","55551.05" +"Douglas ","Karen ","Oak Ridge","Hamilton","9280","10737.70","605.14","34359.16" +"Duarte ","Ruth ","Fairview","Lebanon","8414","5897.03","268.00","14227.07" +"Eller ","Christopher ","Friendship","Royal","1192","12251.82","256.18","51028.28" +"Espinoza ","Michael ","Lakewood","Mount Vernon","4342","23531.49","631.51","41707.57" +"Espinoza ","Michael ","Lakewood","Oak Ridge","9050","11395.93","168.13","54180.88" +"Foster ","","Oak Ridge","Jackson","1167","21861.54","839.69","49742.26" +"Gomez ","Ethelyn ","Riverdale","Lakewood","5802","23249.94","1727.69","30120.04" +"Harrison ","Bonnie ","Valley View","Harmony","8257","13869.29","717.38","40196.90" +"Hernandez ","Rachel ","Greenwood","Oakland","1864","19176.23","1300.92","36687.88" +"Hernandez ","Karen ","Wildwood","New Hope","7931","35868.87","1854.55","54601.43" +"Holden ","Earl ","Maple Grove","Oak Hill","3681","21787.19","518.13","44890.81" +"Hopson ","Machelle ","Mountain View","Oak Hill","4883","20178.41","511.92","38725.07" +"Horn ","Elizabeth ","Shady Grove","Liberty","5958","18813.46","402.76","42404.77" +"Jackson ","Jill ","Bunker Hill","Farmington","1605","22118.98","1096.06","39070.26" +"Kramer ","Carrie ","Lewisburg","Bunker Hill","4106","16755.58","813.18","54256.78" +"Lang ","Jo ","Harmony","Greenville","4003","25285.99","1234.60","45850.21" +"Layne ","Dan ","Lewisburg","Waterloo","9536","19013.62","785.13","41983.42" +"Madison ","Francis ","Rankin","Bethel","5177","19554.16","551.50","52073.20" +"Malloy ","Penelope ","Oakland","Greenville","3621","15771.91","163.93","30985.96" +"Marcum ","Issac ","Mount Zion","Waterloo","2102","28488.78","1333.10","46388.25" +"Martin ","Jason ","Fairview","Warwick","9669","20198.34","1104.75","45202.70" +"Mcdonnell ","Scott ","Providence","Marion","8798","10116.53","460.56","25106.14" +"Mcdonough ","Patrick ","Red Hill","Union","9063","22488.05","471.82","36545.34" +"Mcmanus ","Pattie ","Green Acres","Harmony","5901","11814.32","476.13","26882.50" +"Miller ","Veronica ","Spring Hill","Jackson","4969","9906.99","211.87","27083.41" +"Moore ","Eddie ","Five Forks","Union","6583","8565.54","346.76","38307.50" +"Muller ","Yolonda ","Wilson","Oak Hill","8539","28684.37","1159.76","41686.97" +"Nelson ","Eleanor ","Wilson","Union Hill","7859","37642.60","1625.17","71420.26" +"Orr ","Jeffrey ","Marion","Belmont","435","31900.70","1058.97","43120.31" +"Patterson ","Cecil ","Marion","Waterloo","3664","25003.43","1250.89","48765.06" +"Perkins ","Michael ","Ashland","Union","2858","35892.18","2290.68","53368.85" +"Pierce ","Joshua ","Oakland","Mountain View","1300","26440.78","1283.57","61272.65" +"Ponce ","Kathryn ","Cedar Grove","Jamestown","6096","25197.91","808.95","39756.81" +"Pond ","Nathan ","Pine Grove","Plainview","6664","31125.22","1933.36","53414.54" +"Prieto ","Victoria ","Belmont","Georgetown","2013","14523.00","522.10","43001.10" +"Roberts ","Iris ","Edgewood","Forest Hills","7514","18400.13","752.66","28107.05" +"Ruiz ","Robert ","Valley View","Shady Grove","8102","10769.32","642.83","20677.62" +"Sanderson ","Sean ","Marion","Spring Valley","2357","13068.42","537.71","30394.61" +"Sanderson ","Sean ","Marion","Frenchtown","3754","26401.00","1176.68","44523.55" +"Sandlin ","Eduardo ","Pleasant Grove","Waterloo","794","28339.70","841.18","67076.97" +"Shipman ","Ollie ","Shady Grove","Allison","8899","43541.30","2243.54","53917.94" +"Soto ","Victoria ","Bunker Hill","Oakdale","8451","34549.16","1227.22","55889.74" +"Spencer ","Stuart ","Glenwood","Providence","70","14472.01","383.45","27139.95" +"Taylor ","Ruth ","Five Points","Newport","8431","15094.21","893.27","23513.98" +"Vaughn ","Angelia ","Riverview","Riverside","3564","26757.71","781.53","57977.17" +"White ","Marcus ","Summit","Marion","4418","24520.81","680.54","44731.88" +"Wilkins ","Jill ","Florence","Woodland","1574","7691.88","91.58","16508.84" +"Williams ","Betty ","Fayetteville","Riverview","858","46956.27","1527.13","76708.16" +"Young ","Althea ","Green Acres","Riverside","1289","30098.22","1258.71","72642.54" +"Young ","John ","Lakeside","Woodland","6429","37241.08","1888.43","68719.34" +"","Leonel ","Red Hill","Cedar","6251","13788.79","693.25","37938.68" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00069.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00069.sql new file mode 100644 index 00000000000..514da5dda2f --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00069.sql @@ -0,0 +1,50 @@ +SELECT + "cd_gender" +, "cd_marital_status" +, "cd_education_status" +, "count"(*) "cnt1" +, "cd_purchase_estimate" +, "count"(*) "cnt2" +, "cd_credit_rating" +, "count"(*) "cnt3" +FROM + customer c +, customer_address ca +, customer_demographics +WHERE ("c"."c_current_addr_sk" = "ca"."ca_address_sk") + AND ("ca_state" IN ('KY', 'GA', 'NM')) + AND ("cd_demo_sk" = "c"."c_current_cdemo_sk") + AND (EXISTS ( + SELECT * + FROM + store_sales + , date_dim + WHERE ("c"."c_customer_sk" = "ss_customer_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ("d_moy" BETWEEN 4 AND (4 + 2)) +)) + AND (NOT (EXISTS ( + SELECT * + FROM + web_sales + , date_dim + WHERE ("c"."c_customer_sk" = "ws_bill_customer_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ("d_moy" BETWEEN 4 AND (4 + 2)) +))) + AND (NOT (EXISTS ( + SELECT * + FROM + catalog_sales + , date_dim + WHERE ("c"."c_customer_sk" = "cs_ship_customer_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + AND ("d_moy" BETWEEN 4 AND (4 + 2)) +))) +GROUP BY "cd_gender", "cd_marital_status", "cd_education_status", "cd_purchase_estimate", "cd_credit_rating" +ORDER BY "cd_gender" ASC, "cd_marital_status" ASC, "cd_education_status" ASC, "cd_purchase_estimate" ASC, "cd_credit_rating" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00069.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00069.txt new file mode 100644 index 00000000000..0e91a9d91ac --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00069.txt @@ -0,0 +1,31 @@ +"F","D","Primary ","1","5000","1","Unknown ","1" +"F","D","Primary ","1","7500","1","High Risk ","1" +"F","D","Secondary ","1","5000","1","Good ","1" +"F","D","Unknown ","1","6500","1","Good ","1" +"F","M","4 yr Degree ","1","500","1","Low Risk ","1" +"F","M","College ","1","6500","1","Low Risk ","1" +"F","M","Primary ","1","10000","1","Low Risk ","1" +"F","M","Secondary ","1","5000","1","Good ","1" +"F","M","Secondary ","1","9000","1","Good ","1" +"F","M","Unknown ","1","8500","1","High Risk ","1" +"F","M","Unknown ","1","10000","1","Good ","1" +"F","S","2 yr Degree ","1","5000","1","Unknown ","1" +"F","S","2 yr Degree ","1","10000","1","Low Risk ","1" +"F","S","4 yr Degree ","1","5000","1","High Risk ","1" +"F","S","College ","1","500","1","Low Risk ","1" +"F","S","Secondary ","1","4000","1","High Risk ","1" +"F","U","2 yr Degree ","1","7500","1","Low Risk ","1" +"F","U","4 yr Degree ","1","500","1","High Risk ","1" +"F","U","Secondary ","1","4000","1","Unknown ","1" +"F","W","Advanced Degree ","1","1000","1","High Risk ","1" +"F","W","College ","1","2500","1","Unknown ","1" +"F","W","College ","1","5500","1","High Risk ","1" +"F","W","Secondary ","1","3500","1","High Risk ","1" +"F","W","Secondary ","1","4000","1","Low Risk ","1" +"M","D","Primary ","1","1500","1","Unknown ","1" +"M","M","2 yr Degree ","1","7000","1","High Risk ","1" +"M","M","College ","1","7500","1","Good ","1" +"M","M","Unknown ","1","7500","1","High Risk ","1" +"M","S","Secondary ","1","6500","1","High Risk ","1" +"M","U","Advanced Degree ","1","8500","1","Unknown ","1" +"M","U","College ","1","5500","1","High Risk ","1" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00070.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00070.sql new file mode 100644 index 00000000000..a5709698edb --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00070.sql @@ -0,0 +1,35 @@ +SELECT + "sum"("ss_net_profit") "total_sum" +, "s_state" +, "s_county" +, (GROUPING ("s_state") + GROUPING ("s_county")) "lochierarchy" +, "rank"() OVER (PARTITION BY (GROUPING ("s_state") + GROUPING ("s_county")), (CASE WHEN (GROUPING ("s_county") = 0) THEN "s_state" END) ORDER BY "sum"("ss_net_profit") DESC) "rank_within_parent" +FROM + store_sales +, date_dim d1 +, store +WHERE ("d1"."d_month_seq" BETWEEN 1200 AND (1200 + 11)) + AND ("d1"."d_date_sk" = "ss_sold_date_sk") + AND ("s_store_sk" = "ss_store_sk") + AND ("s_state" IN ( + SELECT "s_state" + FROM + ( + SELECT + "s_state" "s_state" + , "rank"() OVER (PARTITION BY "s_state" ORDER BY "sum"("ss_net_profit") DESC) "ranking" + FROM + store_sales + , store + , date_dim + WHERE ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + AND ("d_date_sk" = "ss_sold_date_sk") + AND ("s_store_sk" = "ss_store_sk") + GROUP BY "s_state" + ) tmp1 + WHERE ("ranking" <= 5) +)) +GROUP BY ROLLUP (s_state, s_county) +ORDER BY "lochierarchy" DESC, (CASE WHEN ("lochierarchy" = 0) THEN "s_state" END) ASC, "rank_within_parent" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00070.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00070.txt new file mode 100644 index 00000000000..36058c0d786 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00070.txt @@ -0,0 +1,3 @@ +"-18926197.59","","","2","1" +"-18926197.59","TN","","1","1" +"-18926197.59","TN","Williamson County","0","1" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00071.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00071.sql new file mode 100644 index 00000000000..bd380b71a5f --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00071.sql @@ -0,0 +1,54 @@ +SELECT + "i_brand_id" "brand_id" +, "i_brand" "brand" +, "t_hour" +, "t_minute" +, "sum"("ext_price") "ext_price" +FROM + item +, ( + SELECT + "ws_ext_sales_price" "ext_price" + , "ws_sold_date_sk" "sold_date_sk" + , "ws_item_sk" "sold_item_sk" + , "ws_sold_time_sk" "time_sk" + FROM + web_sales + , date_dim + WHERE ("d_date_sk" = "ws_sold_date_sk") + AND ("d_moy" = 11) + AND ("d_year" = 1999) +UNION ALL SELECT + "cs_ext_sales_price" "ext_price" + , "cs_sold_date_sk" "sold_date_sk" + , "cs_item_sk" "sold_item_sk" + , "cs_sold_time_sk" "time_sk" + FROM + catalog_sales + , date_dim + WHERE ("d_date_sk" = "cs_sold_date_sk") + AND ("d_moy" = 11) + AND ("d_year" = 1999) +UNION ALL SELECT + "ss_ext_sales_price" "ext_price" + , "ss_sold_date_sk" "sold_date_sk" + , "ss_item_sk" "sold_item_sk" + , "ss_sold_time_sk" "time_sk" + FROM + store_sales + , date_dim + WHERE ("d_date_sk" = "ss_sold_date_sk") + AND ("d_moy" = 11) + AND ("d_year" = 1999) +) tmp +, time_dim +WHERE ("sold_item_sk" = "i_item_sk") + AND ("i_manager_id" = 1) + AND ("time_sk" = "t_time_sk") + AND (("t_meal_time" = 'breakfast') + OR ("t_meal_time" = 'dinner')) +GROUP BY "i_brand", "i_brand_id", "t_hour", "t_minute" +ORDER BY "ext_price" DESC, "i_brand_id" ASC, + -- additional columns to assure results stability for larger scale factors. this is a deviation from TPC-DS specification + "t_hour" ASC, "t_minute" ASC +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00071.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00071.txt new file mode 100644 index 00000000000..0f623e02a00 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00071.txt @@ -0,0 +1,26 @@ +"7008009","namelessbrand #9 ","18","6","13102.66" +"10010013","univamalgamalg #13 ","9","28","4239.00" +"1002002","importoamalg #2 ","19","41","4005.60" +"6007003","brandcorp #3 ","17","58","3831.52" +"6007003","brandcorp #3 ","9","46","2555.64" +"9015011","scholarunivamalg #11 ","18","50","2085.32" +"1002002","importoamalg #2 ","18","47","2075.75" +"7010004","univnameless #4 ","7","25","1621.80" +"7010004","univnameless #4 ","19","24","1603.50" +"6007003","brandcorp #3 ","18","30","1253.95" +"10010013","univamalgamalg #13 ","17","0","1246.41" +"10004004","edu packunivamalg #4 ","9","10","1098.26" +"9015011","scholarunivamalg #11 ","17","5","1028.84" +"4004001","edu packedu pack #1 ","17","41","1006.47" +"1002002","importoamalg #2 ","18","14","856.24" +"6007003","brandcorp #3 ","7","45","842.84" +"6007003","brandcorp #3 ","9","44","706.23" +"1002002","importoamalg #2 ","9","5","544.68" +"10010013","univamalgamalg #13 ","19","53","393.84" +"7008009","namelessbrand #9 ","19","21","244.80" +"7010004","univnameless #4 ","17","9","153.02" +"7010004","univnameless #4 ","18","27","138.18" +"4004001","edu packedu pack #1 ","19","36","120.96" +"10004004","edu packunivamalg #4 ","17","0","86.10" +"10010013","univamalgamalg #13 ","7","17","76.16" +"6007003","brandcorp #3 ","18","59","35.77" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00072.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00072.sql new file mode 100644 index 00000000000..90c1479a9d0 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00072.sql @@ -0,0 +1,30 @@ +SELECT + "i_item_desc" +, "w_warehouse_name" +, "d1"."d_week_seq" +, "sum"((CASE WHEN ("p_promo_sk" IS NULL) THEN 1 ELSE 0 END)) "no_promo" +, "sum"((CASE WHEN ("p_promo_sk" IS NOT NULL) THEN 1 ELSE 0 END)) "promo" +, "count"(*) "total_cnt" +FROM + ((((((((((catalog_sales +INNER JOIN inventory ON ("cs_item_sk" = "inv_item_sk")) +INNER JOIN warehouse ON ("w_warehouse_sk" = "inv_warehouse_sk")) +INNER JOIN item ON ("i_item_sk" = "cs_item_sk")) +INNER JOIN customer_demographics ON ("cs_bill_cdemo_sk" = "cd_demo_sk")) +INNER JOIN household_demographics ON ("cs_bill_hdemo_sk" = "hd_demo_sk")) +INNER JOIN date_dim d1 ON ("cs_sold_date_sk" = "d1"."d_date_sk")) +INNER JOIN date_dim d2 ON ("inv_date_sk" = "d2"."d_date_sk")) +INNER JOIN date_dim d3 ON ("cs_ship_date_sk" = "d3"."d_date_sk")) +LEFT JOIN promotion ON ("cs_promo_sk" = "p_promo_sk")) +LEFT JOIN catalog_returns ON ("cr_item_sk" = "cs_item_sk") + AND ("cr_order_number" = "cs_order_number")) +WHERE ("d1"."d_week_seq" = "d2"."d_week_seq") + AND ("inv_quantity_on_hand" < "cs_quantity") + AND ("d3"."d_date" > ("d1"."d_date" + INTERVAL '5' DAY)) + AND ("hd_buy_potential" = '>10000') + AND ("d1"."d_year" = 1999) + AND ("cd_marital_status" = 'D') +GROUP BY "i_item_desc", "w_warehouse_name", "d1"."d_week_seq" +ORDER BY "total_cnt" DESC, "i_item_desc" ASC, "w_warehouse_name" ASC, "d1"."d_week_seq" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00072.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00072.txt new file mode 100644 index 00000000000..7a426749961 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00072.txt @@ -0,0 +1,28 @@ +"Activities used to get firms. Positive resources would need too across a posts. Bad issues used to sit closely. Slightly true boundaries follow all model courses. Obvious methods attract little o","Conventional childr","5214","0","1","1" +"Agencies shall not ignore detailed costs. About small others cann","Conventional childr","5201","0","1","1" +"Also poor relations take equal, metropolitan courses. Peculiar, popular authorities lose","Conventional childr","5212","0","1","1" +"Children may close necessary dates. Short opportunities improve. Han","Conventional childr","5199","0","1","1" +"English, public guards enter for a friends. Others must accept physically in a bodies. Sons may get by the years. Wide, possible versions examine at least different, econ","Conventional childr","5206","0","1","1" +"Exactl","Conventional childr","5168","0","1","1" +"Fears obtain still blind, active others. Forever numerous signs last even here civil strate","Conventional childr","5209","0","1","1" +"Full-time, lovely miles employ home. Regular assets may not protect much for the relationships. So good guidelines may care small figures. Financial, happy parents call also much real op","Conventional childr","5207","0","1","1" +"Girls replace far chosen factories; other adults see very with the taxes. Sure short sectors may relinquish so nasty women. More warm me","Conventional childr","5211","0","1","1" +"Individuals cast artificially quite irish clients. Fundamentally left changes suggest also easy years. Only social numbers ought","Conventional childr","5199","0","1","1" +"Key names make somewhere. Women develop moreover favorite, widespread needs; also new","Conventional childr","5211","0","1","1" +"National, superior costs act ","Conventional childr","5205","0","1","1" +"New, concerned movements will write at the charges. So advanced friends become. Pregnant versions will in","Conventional childr","5197","0","1","1" +"New, new signals would not take gently exactly brief games. Devices should feel always efforts. Obvious manage","Conventional childr","5209","0","1","1" +"Now federal women stay really. Hugely usual events should include at a children. Mutual observations hea","Conventional childr","5201","0","1","1" +"Only, s","Conventional childr","5183","0","1","1" +"Open places believe modern children. Increased techniques might not compare from a charges; recently international phrases strike in the modules; so","Conventional childr","5211","0","1","1" +"Other officers tell months. Also favorite enquiries might welcome in a women. Principles pay uncomfortably young, new others. Halfway immediate comments","Conventional childr","5216","0","1","1" +"Powers feel in the affairs. Hands might determine for the eyes. Young, elderly parameters would not pe","Conventional childr","5171","0","1","1" +"Public rights talk more twice new duties; political criteria ought to balance in the years. Things try then independent personnel. Likel","Conventional childr","5214","0","1","1" +"Real techniques intend by the fields; mothers interpret aut","Conventional childr","5171","0","1","1" +"Sharp, poor rights make in the r","Conventional childr","5218","0","1","1" +"Straight, immediate parents help more than reso","Conventional childr","5216","0","1","1" +"Sure, successive titles know undoubtedly additional, hot centres; since different prospects would not tell into a ideas. Cattle will not play enough modern charges. Unnecessary, delighted me","Conventional childr","5190","0","1","1" +"Unusually small programmes would lift recently social, small workshops. Offices s","Conventional childr","5218","0","1","1" +"Urgent, simple cases may not help. Industrial, other pp. reverse as a schools. Asleep, free systems make then more available discussions. Soci","Conventional childr","5216","0","1","1" +"Words might not sell to a rounds; duties must exceed never systems; quiet, shy years advertise in a poles; easy, large customers might consider as yet hostile shares. Indeed formal c","Conventional childr","5207","0","1","1" +"","Conventional childr","5214","0","1","1" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00073.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00073.sql new file mode 100644 index 00000000000..2bcbbab8242 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00073.sql @@ -0,0 +1,37 @@ +SELECT + "c_last_name" +, "c_first_name" +, "c_salutation" +, "c_preferred_cust_flag" +, "ss_ticket_number" +, "cnt" +FROM + ( + SELECT + "ss_ticket_number" + , "ss_customer_sk" + , "count"(*) "cnt" + 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 ("date_dim"."d_dom" BETWEEN 1 AND 2) + AND (("household_demographics"."hd_buy_potential" = '>10000') + OR ("household_demographics"."hd_buy_potential" = 'Unknown')) + AND ("household_demographics"."hd_vehicle_count" > 0) + AND ((CASE WHEN ("household_demographics"."hd_vehicle_count" > 0) THEN (CAST("household_demographics"."hd_dep_count" AS DECIMAL(7,2)) / "household_demographics"."hd_vehicle_count") ELSE null END) > 1) + AND ("date_dim"."d_year" IN (1999 , (1999 + 1) , (1999 + 2))) + AND ("store"."s_county" IN ('Williamson County' , 'Franklin Parish' , 'Bronx County' , 'Orange County')) + GROUP BY "ss_ticket_number", "ss_customer_sk" +) dj +, customer +WHERE ("ss_customer_sk" = "c_customer_sk") + AND ("cnt" BETWEEN 1 AND 5) +ORDER BY "cnt" DESC, "c_last_name" ASC, + -- additional column to assure results stability for larger scale factors. this is a deviation from TPC-DS specification + "ss_ticket_number" ASC +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00073.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00073.txt new file mode 100644 index 00000000000..7e9afadf4c1 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00073.txt @@ -0,0 +1 @@ +"Hermann ","Rebecca ","Mrs. ","N","1541","5" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00074.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00074.sql new file mode 100644 index 00000000000..f65c38792e6 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00074.sql @@ -0,0 +1,59 @@ +WITH + year_total AS ( + SELECT + "c_customer_id" "customer_id" + , "c_first_name" "customer_first_name" + , "c_last_name" "customer_last_name" + , "d_year" "YEAR" + , "sum"("ss_net_paid") "year_total" + , 's' "sale_type" + FROM + customer + , store_sales + , date_dim + WHERE ("c_customer_sk" = "ss_customer_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" IN (2001 , (2001 + 1))) + GROUP BY "c_customer_id", "c_first_name", "c_last_name", "d_year" +UNION ALL SELECT + "c_customer_id" "customer_id" + , "c_first_name" "customer_first_name" + , "c_last_name" "customer_last_name" + , "d_year" "YEAR" + , "sum"("ws_net_paid") "year_total" + , 'w' "sale_type" + FROM + customer + , web_sales + , date_dim + WHERE ("c_customer_sk" = "ws_bill_customer_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" IN (2001 , (2001 + 1))) + GROUP BY "c_customer_id", "c_first_name", "c_last_name", "d_year" +) +SELECT + "t_s_secyear"."customer_id" +, "t_s_secyear"."customer_first_name" +, "t_s_secyear"."customer_last_name" +FROM + year_total t_s_firstyear +, year_total t_s_secyear +, year_total t_w_firstyear +, year_total t_w_secyear +WHERE ("t_s_secyear"."customer_id" = "t_s_firstyear"."customer_id") + AND ("t_s_firstyear"."customer_id" = "t_w_secyear"."customer_id") + AND ("t_s_firstyear"."customer_id" = "t_w_firstyear"."customer_id") + AND ("t_s_firstyear"."sale_type" = 's') + AND ("t_w_firstyear"."sale_type" = 'w') + AND ("t_s_secyear"."sale_type" = 's') + AND ("t_w_secyear"."sale_type" = 'w') + AND ("t_s_firstyear"."year" = 2001) + AND ("t_s_secyear"."year" = (2001 + 1)) + AND ("t_w_firstyear"."year" = 2001) + AND ("t_w_secyear"."year" = (2001 + 1)) + AND ("t_s_firstyear"."year_total" > 0) + AND ("t_w_firstyear"."year_total" > 0) + AND ((CASE WHEN ("t_w_firstyear"."year_total" > 0) THEN ("t_w_secyear"."year_total" / "t_w_firstyear"."year_total") ELSE null END) > (CASE WHEN ("t_s_firstyear"."year_total" > 0) THEN ("t_s_secyear"."year_total" / "t_s_firstyear"."year_total") ELSE null END)) +ORDER BY 1 ASC, 1 ASC, 1 ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00074.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00074.txt new file mode 100644 index 00000000000..1bb3833e542 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00074.txt @@ -0,0 +1,11 @@ +"AAAAAAAABMDAAAAA","Jose ","Guzman " +"AAAAAAAADOCAAAAA","Joy ","Baker " +"AAAAAAAAFBDAAAAA","Tara ","Rodgers " +"AAAAAAAAFLAAAAAA","Joseph ","Riley " +"AAAAAAAAFNCAAAAA","Jennifer ","Fitzpatrick " +"AAAAAAAAJCAAAAAA","Maxine ","Carlson " +"AAAAAAAAJGBAAAAA","Bonnie ","Harrison " +"AAAAAAAAKMDAAAAA","Alexander ","White " +"AAAAAAAAOFCAAAAA","Timothy ","Grogan " +"AAAAAAAAPCBAAAAA","Luz ","Ransom " +"AAAAAAAAPDDAAAAA","Reginald ","Garcia " \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00075.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00075.sql new file mode 100644 index 00000000000..33017f9fd92 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00075.sql @@ -0,0 +1,84 @@ +WITH + all_sales AS ( + SELECT + "d_year" + , "i_brand_id" + , "i_class_id" + , "i_category_id" + , "i_manufact_id" + , "sum"("sales_cnt") "sales_cnt" + , "sum"("sales_amt") "sales_amt" + FROM + ( + SELECT + "d_year" + , "i_brand_id" + , "i_class_id" + , "i_category_id" + , "i_manufact_id" + , ("cs_quantity" - COALESCE("cr_return_quantity", 0)) "sales_cnt" + , ("cs_ext_sales_price" - COALESCE("cr_return_amount", DECIMAL '0.0')) "sales_amt" + FROM + (((catalog_sales + INNER JOIN item ON ("i_item_sk" = "cs_item_sk")) + INNER JOIN date_dim ON ("d_date_sk" = "cs_sold_date_sk")) + LEFT JOIN catalog_returns ON ("cs_order_number" = "cr_order_number") + AND ("cs_item_sk" = "cr_item_sk")) + WHERE ("i_category" = 'Books') +UNION SELECT + "d_year" + , "i_brand_id" + , "i_class_id" + , "i_category_id" + , "i_manufact_id" + , ("ss_quantity" - COALESCE("sr_return_quantity", 0)) "sales_cnt" + , ("ss_ext_sales_price" - COALESCE("sr_return_amt", DECIMAL '0.0')) "sales_amt" + FROM + (((store_sales + INNER JOIN item ON ("i_item_sk" = "ss_item_sk")) + INNER JOIN date_dim ON ("d_date_sk" = "ss_sold_date_sk")) + LEFT JOIN store_returns ON ("ss_ticket_number" = "sr_ticket_number") + AND ("ss_item_sk" = "sr_item_sk")) + WHERE ("i_category" = 'Books') +UNION SELECT + "d_year" + , "i_brand_id" + , "i_class_id" + , "i_category_id" + , "i_manufact_id" + , ("ws_quantity" - COALESCE("wr_return_quantity", 0)) "sales_cnt" + , ("ws_ext_sales_price" - COALESCE("wr_return_amt", DECIMAL '0.0')) "sales_amt" + FROM + (((web_sales + INNER JOIN item ON ("i_item_sk" = "ws_item_sk")) + INNER JOIN date_dim ON ("d_date_sk" = "ws_sold_date_sk")) + LEFT JOIN web_returns ON ("ws_order_number" = "wr_order_number") + AND ("ws_item_sk" = "wr_item_sk")) + WHERE ("i_category" = 'Books') + ) sales_detail + GROUP BY "d_year", "i_brand_id", "i_class_id", "i_category_id", "i_manufact_id" +) +SELECT + "prev_yr"."d_year" "prev_year" +, "curr_yr"."d_year" "year" +, "curr_yr"."i_brand_id" +, "curr_yr"."i_class_id" +, "curr_yr"."i_category_id" +, "curr_yr"."i_manufact_id" +, "prev_yr"."sales_cnt" "prev_yr_cnt" +, "curr_yr"."sales_cnt" "curr_yr_cnt" +, ("curr_yr"."sales_cnt" - "prev_yr"."sales_cnt") "sales_cnt_diff" +, ("curr_yr"."sales_amt" - "prev_yr"."sales_amt") "sales_amt_diff" +FROM + all_sales curr_yr +, all_sales prev_yr +WHERE ("curr_yr"."i_brand_id" = "prev_yr"."i_brand_id") + AND ("curr_yr"."i_class_id" = "prev_yr"."i_class_id") + AND ("curr_yr"."i_category_id" = "prev_yr"."i_category_id") + AND ("curr_yr"."i_manufact_id" = "prev_yr"."i_manufact_id") + AND ("curr_yr"."d_year" = 2002) + AND ("prev_yr"."d_year" = (2002 - 1)) + AND ((CAST("curr_yr"."sales_cnt" AS DECIMAL(17,2)) / CAST("prev_yr"."sales_cnt" AS DECIMAL(17,2))) < DECIMAL '0.9') +ORDER BY "sales_cnt_diff" ASC, "sales_amt_diff" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00075.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00075.txt new file mode 100644 index 00000000000..75d7f157e6f --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00075.txt @@ -0,0 +1,31 @@ +"2001","2002","9008002","8","9","12","2788","1560","-1228","-91938.97" +"2001","2002","4001001","15","9","42","2998","1873","-1125","-53106.14" +"2001","2002","9015002","15","9","275","2827","1715","-1112","-68057.69" +"2001","2002","9012008","12","9","474","3054","2018","-1036","-41320.66" +"2001","2002","9010008","10","9","301","2235","1408","-827","-17432.59" +"2001","2002","9010004","3","9","948","1962","1139","-823","-64840.00" +"2001","2002","9007008","7","9","614","2516","1705","-811","-69842.25" +"2001","2002","10003008","8","9","175","2378","1663","-715","-43833.59" +"2001","2002","9009010","1","9","503","2342","1637","-705","-31349.51" +"2001","2002","9010008","10","9","621","2584","1890","-694","-52230.80" +"2001","2002","9011008","11","9","269","2284","1599","-685","4842.02" +"2001","2002","4003001","4","9","985","2674","2091","-583","-11848.88" +"2001","2002","9008010","2","9","954","2391","1817","-574","12751.90" +"2001","2002","9003003","3","9","397","2098","1528","-570","12428.60" +"2001","2002","2001001","1","9","2","1890","1325","-565","-64093.15" +"2001","2002","7014009","1","9","270","2002","1446","-556","-38593.72" +"2001","2002","2001001","1","9","495","1812","1257","-555","-20360.02" +"2001","2002","9011002","11","9","390","2042","1496","-546","-37597.82" +"2001","2002","9006010","6","9","100","2016","1480","-536","-31465.13" +"2001","2002","9001002","1","9","571","2568","2049","-519","-17420.13" +"2001","2002","9006010","3","9","99","2606","2093","-513","-9755.34" +"2001","2002","9009008","9","9","453","2352","1844","-508","-9801.70" +"2001","2002","2004001","2","9","368","1973","1487","-486","-12556.49" +"2001","2002","9008010","9","9","229","2163","1681","-482","-43415.65" +"2001","2002","5002001","2","9","91","2714","2248","-466","3287.60" +"2001","2002","9015010","2","9","286","2242","1826","-416","-38274.18" +"2001","2002","9012002","12","9","622","2156","1799","-357","-36676.32" +"2001","2002","9008002","8","9","219","2103","1768","-335","-5876.51" +"2001","2002","9013002","13","9","548","2323","2002","-321","-36394.56" +"2001","2002","1004001","4","9","286","2271","1952","-319","-16091.58" +"2001","2002","9005002","5","9","654","2058","1752","-306","-21192.16" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00076.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00076.sql new file mode 100644 index 00000000000..ab4d33eba2e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00076.sql @@ -0,0 +1,57 @@ +SELECT + "channel" +, "col_name" +, "d_year" +, "d_qoy" +, "i_category" +, "count"(*) "sales_cnt" +, "sum"("ext_sales_price") "sales_amt" +FROM + ( + SELECT + 'store' "channel" + , 'ss_store_sk' "col_name" + , "d_year" + , "d_qoy" + , "i_category" + , "ss_ext_sales_price" "ext_sales_price" + FROM + store_sales + , item + , date_dim + WHERE ("ss_store_sk" IS NULL) + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_item_sk" = "i_item_sk") +UNION ALL SELECT + 'web' "channel" + , 'ws_ship_customer_sk' "col_name" + , "d_year" + , "d_qoy" + , "i_category" + , "ws_ext_sales_price" "ext_sales_price" + FROM + web_sales + , item + , date_dim + WHERE ("ws_ship_customer_sk" IS NULL) + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("ws_item_sk" = "i_item_sk") +UNION ALL SELECT + 'catalog' "channel" + , 'cs_ship_addr_sk' "col_name" + , "d_year" + , "d_qoy" + , "i_category" + , "cs_ext_sales_price" "ext_sales_price" + FROM + catalog_sales + , item + , date_dim + WHERE ("cs_ship_addr_sk" IS NULL) + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("cs_item_sk" = "i_item_sk") +) foo +GROUP BY "channel", "col_name", "d_year", "d_qoy", "i_category" +ORDER BY "channel" ASC, "col_name" ASC, "d_year" ASC, "d_qoy" ASC, "i_category" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00076.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00076.txt new file mode 100644 index 00000000000..1380a917a8b --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00076.txt @@ -0,0 +1,100 @@ +"catalog","cs_ship_addr_sk","1998","1","Books ","1","411.07" +"catalog","cs_ship_addr_sk","1998","1","Children ","3","5081.44" +"catalog","cs_ship_addr_sk","1998","1","Electronics ","2","2289.60" +"catalog","cs_ship_addr_sk","1998","1","Home ","3","20528.20" +"catalog","cs_ship_addr_sk","1998","1","Men ","1","" +"catalog","cs_ship_addr_sk","1998","1","Music ","1","7169.65" +"catalog","cs_ship_addr_sk","1998","1","Women ","1","783.30" +"catalog","cs_ship_addr_sk","1998","2","Electronics ","3","988.68" +"catalog","cs_ship_addr_sk","1998","2","Home ","1","5616.97" +"catalog","cs_ship_addr_sk","1998","2","Shoes ","1","" +"catalog","cs_ship_addr_sk","1998","2","Sports ","1","" +"catalog","cs_ship_addr_sk","1998","2","Women ","2","2018.66" +"catalog","cs_ship_addr_sk","1998","3","Electronics ","3","" +"catalog","cs_ship_addr_sk","1998","3","Home ","4","16414.34" +"catalog","cs_ship_addr_sk","1998","3","Jewelry ","2","1485.80" +"catalog","cs_ship_addr_sk","1998","3","Men ","1","" +"catalog","cs_ship_addr_sk","1998","3","Music ","3","5168.32" +"catalog","cs_ship_addr_sk","1998","3","Shoes ","1","6325.48" +"catalog","cs_ship_addr_sk","1998","3","Women ","1","2587.99" +"catalog","cs_ship_addr_sk","1998","4","Books ","2","10982.79" +"catalog","cs_ship_addr_sk","1998","4","Electronics ","2","" +"catalog","cs_ship_addr_sk","1998","4","Home ","1","" +"catalog","cs_ship_addr_sk","1998","4","Jewelry ","2","502.80" +"catalog","cs_ship_addr_sk","1998","4","Men ","3","" +"catalog","cs_ship_addr_sk","1998","4","Music ","6","1944.39" +"catalog","cs_ship_addr_sk","1998","4","Shoes ","3","10873.96" +"catalog","cs_ship_addr_sk","1998","4","Sports ","1","615.68" +"catalog","cs_ship_addr_sk","1998","4","Women ","1","" +"catalog","cs_ship_addr_sk","1999","1","Children ","1","3401.60" +"catalog","cs_ship_addr_sk","1999","1","Electronics ","1","5949.64" +"catalog","cs_ship_addr_sk","1999","1","Home ","1","4617.60" +"catalog","cs_ship_addr_sk","1999","1","Jewelry ","1","" +"catalog","cs_ship_addr_sk","1999","1","Music ","1","" +"catalog","cs_ship_addr_sk","1999","1","Shoes ","1","" +"catalog","cs_ship_addr_sk","1999","1","Sports ","1","" +"catalog","cs_ship_addr_sk","1999","1","Women ","2","" +"catalog","cs_ship_addr_sk","1999","2","Books ","1","" +"catalog","cs_ship_addr_sk","1999","2","Home ","2","2451.60" +"catalog","cs_ship_addr_sk","1999","2","Sports ","1","929.61" +"catalog","cs_ship_addr_sk","1999","3","Books ","1","" +"catalog","cs_ship_addr_sk","1999","3","Children ","1","4644.36" +"catalog","cs_ship_addr_sk","1999","3","Electronics ","3","719.86" +"catalog","cs_ship_addr_sk","1999","3","Home ","1","13627.53" +"catalog","cs_ship_addr_sk","1999","3","Jewelry ","1","" +"catalog","cs_ship_addr_sk","1999","3","Men ","1","" +"catalog","cs_ship_addr_sk","1999","3","Music ","1","" +"catalog","cs_ship_addr_sk","1999","3","Shoes ","2","320.00" +"catalog","cs_ship_addr_sk","1999","3","Women ","1","" +"catalog","cs_ship_addr_sk","1999","4","Books ","1","355.64" +"catalog","cs_ship_addr_sk","1999","4","Children ","5","3494.36" +"catalog","cs_ship_addr_sk","1999","4","Home ","2","4285.15" +"catalog","cs_ship_addr_sk","1999","4","Jewelry ","1","" +"catalog","cs_ship_addr_sk","1999","4","Men ","3","3802.19" +"catalog","cs_ship_addr_sk","1999","4","Music ","3","7736.54" +"catalog","cs_ship_addr_sk","1999","4","Shoes ","2","" +"catalog","cs_ship_addr_sk","1999","4","Sports ","1","1908.00" +"catalog","cs_ship_addr_sk","1999","4","Women ","1","0.00" +"catalog","cs_ship_addr_sk","2000","1","Electronics ","1","3637.44" +"catalog","cs_ship_addr_sk","2000","1","Jewelry ","1","5254.92" +"catalog","cs_ship_addr_sk","2000","1","Men ","1","1407.56" +"catalog","cs_ship_addr_sk","2000","1","Music ","1","" +"catalog","cs_ship_addr_sk","2000","1","Sports ","2","261.56" +"catalog","cs_ship_addr_sk","2000","1","Women ","1","" +"catalog","cs_ship_addr_sk","2000","3","Children ","2","17293.39" +"catalog","cs_ship_addr_sk","2000","3","Electronics ","1","" +"catalog","cs_ship_addr_sk","2000","3","Jewelry ","1","513.88" +"catalog","cs_ship_addr_sk","2000","3","Men ","3","" +"catalog","cs_ship_addr_sk","2000","3","Music ","3","871.40" +"catalog","cs_ship_addr_sk","2000","3","Sports ","1","" +"catalog","cs_ship_addr_sk","2000","3","Women ","2","11188.46" +"catalog","cs_ship_addr_sk","2000","4","Children ","3","4957.80" +"catalog","cs_ship_addr_sk","2000","4","Electronics ","2","694.35" +"catalog","cs_ship_addr_sk","2000","4","Home ","1","" +"catalog","cs_ship_addr_sk","2000","4","Jewelry ","5","3850.72" +"catalog","cs_ship_addr_sk","2000","4","Men ","1","1913.42" +"catalog","cs_ship_addr_sk","2000","4","Music ","2","3908.30" +"catalog","cs_ship_addr_sk","2000","4","Shoes ","3","5489.84" +"catalog","cs_ship_addr_sk","2000","4","Sports ","1","386.00" +"catalog","cs_ship_addr_sk","2000","4","Women ","4","23596.92" +"catalog","cs_ship_addr_sk","2001","1","Men ","1","" +"catalog","cs_ship_addr_sk","2001","1","Sports ","1","1828.96" +"catalog","cs_ship_addr_sk","2001","1","Women ","1","3771.48" +"catalog","cs_ship_addr_sk","2001","2","Books ","2","" +"catalog","cs_ship_addr_sk","2001","2","Electronics ","1","" +"catalog","cs_ship_addr_sk","2001","2","Shoes ","1","" +"catalog","cs_ship_addr_sk","2001","2","Sports ","1","" +"catalog","cs_ship_addr_sk","2001","2","Women ","2","" +"catalog","cs_ship_addr_sk","2001","2","","1","" +"catalog","cs_ship_addr_sk","2001","3","Children ","1","5406.96" +"catalog","cs_ship_addr_sk","2001","3","Electronics ","1","" +"catalog","cs_ship_addr_sk","2001","3","Jewelry ","2","365.64" +"catalog","cs_ship_addr_sk","2001","3","Men ","1","" +"catalog","cs_ship_addr_sk","2001","3","Music ","2","7328.70" +"catalog","cs_ship_addr_sk","2001","3","Sports ","2","713.58" +"catalog","cs_ship_addr_sk","2001","4","Children ","4","14013.84" +"catalog","cs_ship_addr_sk","2001","4","Electronics ","2","1540.36" +"catalog","cs_ship_addr_sk","2001","4","Home ","2","3852.50" +"catalog","cs_ship_addr_sk","2001","4","Jewelry ","5","12789.31" +"catalog","cs_ship_addr_sk","2001","4","Men ","3","11276.70" +"catalog","cs_ship_addr_sk","2001","4","Music ","3","2311.16" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00077.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00077.sql new file mode 100644 index 00000000000..3d5fba6f9dd --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00077.sql @@ -0,0 +1,121 @@ +WITH + ss AS ( + SELECT + "s_store_sk" + , "sum"("ss_ext_sales_price") "sales" + , "sum"("ss_net_profit") "profit" + FROM + store_sales + , date_dim + , store + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("d_date" BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '30' DAY)) + AND ("ss_store_sk" = "s_store_sk") + GROUP BY "s_store_sk" +) +, sr AS ( + SELECT + "s_store_sk" + , "sum"("sr_return_amt") "returns" + , "sum"("sr_net_loss") "profit_loss" + FROM + store_returns + , date_dim + , store + WHERE ("sr_returned_date_sk" = "d_date_sk") + AND ("d_date" BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '30' DAY)) + AND ("sr_store_sk" = "s_store_sk") + GROUP BY "s_store_sk" +) +, cs AS ( + SELECT + "cs_call_center_sk" + , "sum"("cs_ext_sales_price") "sales" + , "sum"("cs_net_profit") "profit" + FROM + catalog_sales + , date_dim + WHERE ("cs_sold_date_sk" = "d_date_sk") + AND ("d_date" BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '30' DAY)) + GROUP BY "cs_call_center_sk" +) +, cr AS ( + SELECT + "cr_call_center_sk" + , "sum"("cr_return_amount") "returns" + , "sum"("cr_net_loss") "profit_loss" + FROM + catalog_returns + , date_dim + WHERE ("cr_returned_date_sk" = "d_date_sk") + AND ("d_date" BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '30' DAY)) + GROUP BY "cr_call_center_sk" +) +, ws AS ( + SELECT + "wp_web_page_sk" + , "sum"("ws_ext_sales_price") "sales" + , "sum"("ws_net_profit") "profit" + FROM + web_sales + , date_dim + , web_page + WHERE ("ws_sold_date_sk" = "d_date_sk") + AND ("d_date" BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '30' DAY)) + AND ("ws_web_page_sk" = "wp_web_page_sk") + GROUP BY "wp_web_page_sk" +) +, wr AS ( + SELECT + "wp_web_page_sk" + , "sum"("wr_return_amt") "returns" + , "sum"("wr_net_loss") "profit_loss" + FROM + web_returns + , date_dim + , web_page + WHERE ("wr_returned_date_sk" = "d_date_sk") + AND ("d_date" BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '30' DAY)) + AND ("wr_web_page_sk" = "wp_web_page_sk") + GROUP BY "wp_web_page_sk" +) +SELECT + "channel" +, "id" +, "sum"("sales") "sales" +, "sum"("returns") "returns" +, "sum"("profit") "profit" +FROM + ( + SELECT + 'store channel' "channel" + , "ss"."s_store_sk" "id" + , "sales" + , COALESCE("returns", 0) "returns" + , ("profit" - COALESCE("profit_loss", 0)) "profit" + FROM + (ss + LEFT JOIN sr ON ("ss"."s_store_sk" = "sr"."s_store_sk")) +UNION ALL SELECT + 'catalog channel' "channel" + , "cs_call_center_sk" "id" + , "sales" + , "returns" + , ("profit" - "profit_loss") "profit" + FROM + cs + , cr +UNION ALL SELECT + 'web channel' "channel" + , "ws"."wp_web_page_sk" "id" + , "sales" + , COALESCE("returns", 0) "returns" + , ("profit" - COALESCE("profit_loss", 0)) "profit" + FROM + (ws + LEFT JOIN wr ON ("ws"."wp_web_page_sk" = "wr"."wp_web_page_sk")) +) x +GROUP BY ROLLUP (channel, id) +ORDER BY "channel" ASC, "id" ASC, "sales" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00077.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00077.txt new file mode 100644 index 00000000000..7fcf0050a6a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00077.txt @@ -0,0 +1,11 @@ +"catalog channel","1","8309735.67","93651.44","-702794.60" +"catalog channel","2","8506405.29","93651.44","-675315.32" +"catalog channel","","22821.90","93651.44","-73863.53" +"catalog channel","","16838962.86","280954.32","-1451973.45" +"store channel","1","2878513.36","39454.33","-1189038.66" +"store channel","2","2352930.06","59460.59","-1121311.45" +"store channel","","5231443.42","98914.92","-2310350.11" +"web channel","1","356906.40","7883.23","-13495.01" +"web channel","2","400021.10","13644.47","-23570.60" +"web channel","","756927.50","21527.70","-37065.61" +"","","22827333.78","401396.94","-3799389.17" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00078.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00078.sql new file mode 100644 index 00000000000..c3fdb2a2657 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00078.sql @@ -0,0 +1,74 @@ +WITH + ws AS ( + SELECT + "d_year" "ws_sold_year" + , "ws_item_sk" + , "ws_bill_customer_sk" "ws_customer_sk" + , "sum"("ws_quantity") "ws_qty" + , "sum"("ws_wholesale_cost") "ws_wc" + , "sum"("ws_sales_price") "ws_sp" + FROM + ((web_sales + LEFT JOIN web_returns ON ("wr_order_number" = "ws_order_number") + AND ("ws_item_sk" = "wr_item_sk")) + INNER JOIN date_dim ON ("ws_sold_date_sk" = "d_date_sk")) + WHERE ("wr_order_number" IS NULL) + GROUP BY "d_year", "ws_item_sk", "ws_bill_customer_sk" +) +, cs AS ( + SELECT + "d_year" "cs_sold_year" + , "cs_item_sk" + , "cs_bill_customer_sk" "cs_customer_sk" + , "sum"("cs_quantity") "cs_qty" + , "sum"("cs_wholesale_cost") "cs_wc" + , "sum"("cs_sales_price") "cs_sp" + FROM + ((catalog_sales + LEFT JOIN catalog_returns ON ("cr_order_number" = "cs_order_number") + AND ("cs_item_sk" = "cr_item_sk")) + INNER JOIN date_dim ON ("cs_sold_date_sk" = "d_date_sk")) + WHERE ("cr_order_number" IS NULL) + GROUP BY "d_year", "cs_item_sk", "cs_bill_customer_sk" +) +, ss AS ( + SELECT + "d_year" "ss_sold_year" + , "ss_item_sk" + , "ss_customer_sk" + , "sum"("ss_quantity") "ss_qty" + , "sum"("ss_wholesale_cost") "ss_wc" + , "sum"("ss_sales_price") "ss_sp" + FROM + ((store_sales + LEFT JOIN store_returns ON ("sr_ticket_number" = "ss_ticket_number") + AND ("ss_item_sk" = "sr_item_sk")) + INNER JOIN date_dim ON ("ss_sold_date_sk" = "d_date_sk")) + WHERE ("sr_ticket_number" IS NULL) + GROUP BY "d_year", "ss_item_sk", "ss_customer_sk" +) +SELECT + "ss_sold_year" +, "ss_item_sk" +, "ss_customer_sk" +, "round"((CAST("ss_qty" AS DECIMAL(10,2)) / COALESCE(("ws_qty" + "cs_qty"), 1)), 2) "ratio" +, "ss_qty" "store_qty" +, "ss_wc" "store_wholesale_cost" +, "ss_sp" "store_sales_price" +, (COALESCE("ws_qty", 0) + COALESCE("cs_qty", 0)) "other_chan_qty" +, (COALESCE("ws_wc", 0) + COALESCE("cs_wc", 0)) "other_chan_wholesale_cost" +, (COALESCE("ws_sp", 0) + COALESCE("cs_sp", 0)) "other_chan_sales_price" +FROM + ((ss +LEFT JOIN ws ON ("ws_sold_year" = "ss_sold_year") + AND ("ws_item_sk" = "ss_item_sk") + AND ("ws_customer_sk" = "ss_customer_sk")) +LEFT JOIN cs ON ("cs_sold_year" = "ss_sold_year") + AND ("cs_item_sk" = "cs_item_sk") + AND ("cs_customer_sk" = "ss_customer_sk")) +WHERE (COALESCE("ws_qty", 0) > 0) + AND (COALESCE("cs_qty", 0) > 0) + AND ("ss_sold_year" = 2000) +ORDER BY "ss_sold_year" ASC, "ss_item_sk" ASC, "ss_customer_sk" ASC, "ss_qty" DESC, "ss_wc" DESC, "ss_sp" DESC, "other_chan_qty" ASC, "other_chan_wholesale_cost" ASC, "other_chan_sales_price" ASC, "round"((CAST("ss_qty" AS DECIMAL(10,2)) / COALESCE(("ws_qty" + "cs_qty"), 1)), 2) ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00078.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00078.txt new file mode 100644 index 00000000000..8dab760cd92 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00078.txt @@ -0,0 +1,100 @@ +"2000","55","70","0.46","30","4.94","4.34","65","90.60","11.70" +"2000","55","70","0.39","30","4.94","4.34","77","74.13","25.89" +"2000","55","70","0.35","30","4.94","4.34","86","85.73","103.72" +"2000","55","70","0.24","30","4.94","4.34","123","114.52","112.55" +"2000","127","200","0.56","27","55.62","77.78","48","84.72","23.08" +"2000","127","200","0.53","27","55.62","77.78","51","4.19","4.04" +"2000","127","200","0.53","27","55.62","77.78","51","83.59","4.76" +"2000","127","200","0.51","27","55.62","77.78","53","40.74","51.68" +"2000","127","200","0.47","27","55.62","77.78","58","26.17","41.27" +"2000","127","200","0.44","27","55.62","77.78","61","14.74","22.00" +"2000","127","200","0.38","27","55.62","77.78","72","65.24","108.28" +"2000","127","200","0.35","27","55.62","77.78","78","16.99","24.72" +"2000","127","200","0.31","27","55.62","77.78","86","77.58","95.38" +"2000","127","200","0.31","27","55.62","77.78","88","83.86","77.50" +"2000","127","200","0.28","27","55.62","77.78","95","8.86","16.29" +"2000","127","200","0.23","27","55.62","77.78","118","7.58","8.46" +"2000","127","200","0.22","27","55.62","77.78","123","23.96","61.57" +"2000","127","200","0.21","27","55.62","77.78","128","78.56","51.55" +"2000","127","200","0.19","27","55.62","77.78","143","98.14","106.56" +"2000","137","982","1.36","83","69.67","63.39","61","158.99","102.61" +"2000","137","982","1.14","83","69.67","63.39","73","148.01","12.30" +"2000","137","982","1.11","83","69.67","63.39","75","156.62","88.95" +"2000","137","982","1.09","83","69.67","63.39","76","122.99","9.25" +"2000","137","982","0.99","83","69.67","63.39","84","137.98","84.96" +"2000","137","982","0.98","83","69.67","63.39","85","112.77","33.31" +"2000","137","982","0.88","83","69.67","63.39","94","109.22","18.40" +"2000","137","982","0.84","83","69.67","63.39","99","131.00","10.12" +"2000","137","982","0.84","83","69.67","63.39","99","131.56","43.79" +"2000","137","982","0.80","83","69.67","63.39","104","194.43","24.51" +"2000","137","982","0.73","83","69.67","63.39","113","99.94","7.40" +"2000","137","982","0.66","83","69.67","63.39","125","187.13","136.68" +"2000","137","982","0.62","83","69.67","63.39","133","112.55","21.96" +"2000","137","982","0.62","83","69.67","63.39","134","190.74","15.01" +"2000","137","982","0.61","83","69.67","63.39","135","190.84","147.47" +"2000","137","982","0.61","83","69.67","63.39","137","142.85","126.93" +"2000","137","982","0.61","83","69.67","63.39","137","192.27","135.00" +"2000","137","982","0.60","83","69.67","63.39","138","122.21","44.66" +"2000","137","982","0.60","83","69.67","63.39","138","146.43","34.66" +"2000","137","982","0.60","83","69.67","63.39","139","124.09","37.19" +"2000","137","982","0.57","83","69.67","63.39","146","156.36","105.98" +"2000","137","982","0.57","83","69.67","63.39","146","187.76","25.68" +"2000","137","982","0.56","83","69.67","63.39","148","152.33","149.95" +"2000","137","982","0.54","83","69.67","63.39","153","117.26","53.22" +"2000","170","399","0.24","9","34.78","46.43","37","121.97","83.27" +"2000","170","399","0.12","9","34.78","46.43","74","132.00","31.94" +"2000","170","399","0.10","9","34.78","46.43","90","57.44","15.42" +"2000","170","399","0.10","9","34.78","46.43","94","124.50","91.07" +"2000","170","399","0.09","9","34.78","46.43","97","64.93","26.94" +"2000","170","399","0.09","9","34.78","46.43","103","51.83","19.64" +"2000","170","399","0.08","9","34.78","46.43","110","79.05","44.00" +"2000","170","399","0.08","9","34.78","46.43","111","97.38","101.57" +"2000","170","399","0.08","9","34.78","46.43","111","139.45","96.87" +"2000","170","399","0.07","9","34.78","46.43","125","70.70","15.33" +"2000","197","437","1.75","56","76.43","22.08","32","61.00","26.49" +"2000","197","437","1.65","56","76.43","22.08","34","100.67","49.85" +"2000","197","437","1.51","56","76.43","22.08","37","52.10","32.26" +"2000","197","437","1.44","56","76.43","22.08","39","40.56","41.82" +"2000","197","437","1.33","56","76.43","22.08","42","24.42","26.49" +"2000","197","437","1.30","56","76.43","22.08","43","79.86","92.12" +"2000","197","437","1.19","56","76.43","22.08","47","82.46","52.45" +"2000","197","437","1.10","56","76.43","22.08","51","55.21","79.80" +"2000","197","437","1.08","56","76.43","22.08","52","37.38","37.65" +"2000","197","437","1.04","56","76.43","22.08","54","53.88","87.95" +"2000","197","437","1.04","56","76.43","22.08","54","114.19","58.17" +"2000","197","437","1.02","56","76.43","22.08","55","71.66","72.69" +"2000","197","437","0.95","56","76.43","22.08","59","93.59","90.68" +"2000","197","437","0.84","56","76.43","22.08","67","87.10","153.22" +"2000","197","437","0.82","56","76.43","22.08","68","87.93","122.26" +"2000","197","437","0.80","56","76.43","22.08","70","110.93","59.13" +"2000","197","437","0.78","56","76.43","22.08","72","96.95","80.00" +"2000","197","437","0.77","56","76.43","22.08","73","110.45","59.22" +"2000","197","437","0.76","56","76.43","22.08","74","69.88","97.90" +"2000","197","437","0.75","56","76.43","22.08","75","93.66","148.87" +"2000","197","437","0.74","56","76.43","22.08","76","53.91","56.41" +"2000","197","437","0.72","56","76.43","22.08","78","92.03","78.06" +"2000","197","437","0.71","56","76.43","22.08","79","108.52","200.13" +"2000","197","437","0.70","56","76.43","22.08","80","122.79","286.16" +"2000","197","437","0.69","56","76.43","22.08","81","45.66","43.56" +"2000","197","437","0.69","56","76.43","22.08","81","54.22","52.21" +"2000","197","437","0.69","56","76.43","22.08","81","102.68","58.36" +"2000","197","437","0.62","56","76.43","22.08","90","36.40","37.03" +"2000","197","437","0.61","56","76.43","22.08","92","86.39","32.68" +"2000","197","437","0.60","56","76.43","22.08","93","92.59","78.35" +"2000","197","437","0.58","56","76.43","22.08","96","32.99","38.50" +"2000","197","437","0.58","56","76.43","22.08","97","26.78","30.90" +"2000","197","437","0.57","56","76.43","22.08","99","122.32","117.22" +"2000","197","437","0.55","56","76.43","22.08","102","35.58","33.56" +"2000","197","437","0.54","56","76.43","22.08","104","51.03","56.39" +"2000","197","437","0.53","56","76.43","22.08","105","79.13","59.34" +"2000","197","437","0.52","56","76.43","22.08","107","79.43","46.99" +"2000","197","437","0.51","56","76.43","22.08","109","34.47","43.98" +"2000","197","437","0.51","56","76.43","22.08","109","77.87","96.19" +"2000","197","437","0.51","56","76.43","22.08","109","91.66","34.68" +"2000","197","437","0.51","56","76.43","22.08","110","57.97","115.34" +"2000","197","437","0.50","56","76.43","22.08","113","81.66","94.86" +"2000","197","437","0.47","56","76.43","22.08","118","64.20","131.70" +"2000","197","437","0.47","56","76.43","22.08","118","86.11","94.44" +"2000","197","437","0.46","56","76.43","22.08","123","75.72","26.51" +"2000","197","437","0.46","56","76.43","22.08","123","117.60","88.49" +"2000","197","437","0.45","56","76.43","22.08","125","92.26","178.99" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00079.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00079.sql new file mode 100644 index 00000000000..4b7e756e9e4 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00079.sql @@ -0,0 +1,35 @@ +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" = 6) + OR ("household_demographics"."hd_vehicle_count" > 2)) + AND ("date_dim"."d_dow" = 1) + AND ("date_dim"."d_year" IN (1999 , (1999 + 1) , (1999 + 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" ASC, "c_first_name" ASC, "substr"("s_city", 1, 30) ASC, "profit" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00079.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00079.txt new file mode 100644 index 00000000000..6d17e9e77d6 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00079.txt @@ -0,0 +1,100 @@ +"Adams ","Chris ","Midway","8820","1235.35","-2353.80" +"Adams ","Matilde ","Midway","1947","2358.31","-8518.66" +"Akers ","Richard ","Midway","6952","3354.30","-5627.48" +"Albert ","Howard ","Midway","7342","165.30","-1971.74" +"Albert ","John ","Midway","9939","335.04","-15360.34" +"Albert ","John ","Midway","3615","2181.76","-10633.03" +"Albert ","John ","Midway","3615","53.15","" +"Albert ","Nadia ","Midway","4636","385.21","-7438.65" +"Albert ","Nadia ","Midway","4636","0.00","" +"Aleman ","William ","Midway","5810","6274.85","-14380.98" +"Allen ","Kimberly ","Midway","4864","8042.73","-18081.10" +"Allison ","Ralph ","Midway","9977","3805.97","-18955.09" +"Amos ","Ima ","Midway","1837","120.65","-5450.26" +"Anderson ","Teri ","Midway","5078","1930.00","-24121.73" +"Andrews ","Catherine ","Midway","4195","6442.84","-6744.94" +"Angel ","Denise ","Midway","6628","922.22","-7174.33" +"Aponte ","Joseph ","Midway","7979","1676.58","-6743.53" +"Bailey ","Robert ","Midway","3459","3412.81","-2316.38" +"Baldwin ","Michele ","Midway","9548","890.37","-7300.98" +"Ball ","Steven ","Midway","2630","4400.91","-9978.73" +"Ball ","Steven ","Midway","2238","98.71","-3467.89" +"Bartley ","Mark ","Midway","6257","5682.44","-12995.03" +"Bass ","Valerie ","Midway","1411","0.00","-17016.07" +"Beach ","Herbert ","Midway","9043","1127.70","-9794.55" +"Beatty ","Marjorie ","Midway","5094","4326.17","-12495.44" +"Benitez ","Michele ","Midway","2008","628.35","-5026.60" +"Benitez ","Michele ","Midway","2008","447.93","-2761.02" +"Black ","Margaret ","Midway","952","10707.47","-13376.43" +"Blair ","John ","Midway","5297","251.43","-3145.20" +"Bowles ","Sherry ","Midway","5470","0.00","-2173.38" +"Bowles ","Sherry ","Midway","5470","","" +"Brill ","David ","Midway","7259","2899.49","-1788.44" +"Brown ","Lisa ","Midway","5358","1719.96","-11929.40" +"Brown ","Marie ","Midway","3807","1780.79","-6401.76" +"Brown ","Robert ","Midway","3683","4788.52","-15953.52" +"Browning ","Margie ","Midway","4283","0.00","-12667.63" +"Browning ","Margie ","Midway","4101","0.00","-7642.36" +"Brunson ","Albert ","Midway","7453","1075.72","-10888.00" +"Bruton ","Stephen ","Midway","5271","3319.55","-22040.65" +"Bryan ","Dusty ","Midway","5775","206.07","-14288.84" +"Bryan ","Dusty ","Midway","8766","538.48","-2664.28" +"Bryant ","Rosemary ","Midway","534","79.68","-7065.29" +"Buchanan ","Theresa ","Midway","1558","9667.13","-9509.11" +"Buchanan ","Theresa ","Midway","6637","4553.69","-7147.81" +"Burch ","James ","Midway","234","372.71","-2881.33" +"Burt ","Evelyn ","Midway","7487","648.06","-6986.68" +"Butcher ","Bruno ","Midway","740","132.83","-7579.82" +"Butler ","Claudia ","Midway","187","319.98","2546.39" +"Butler ","Rebecca ","Midway","9040","430.19","-11521.31" +"Byrd ","James ","Midway","8871","2001.62","-12923.52" +"Caldwell ","Joseph ","Midway","9041","7303.69","-14035.06" +"Campbell ","Daniel ","Midway","2466","26.74","1705.49" +"Carlson ","Maxine ","Midway","1256","632.52","-16983.12" +"Carlton ","Gloria ","Midway","362","545.72","-12767.12" +"Carroll ","Bryan ","Midway","2633","148.47","-6311.33" +"Carter ","Debra ","Midway","62","6026.87","-10441.95" +"Casillas ","Debra ","Midway","3332","294.66","-5328.59" +"Chambers ","Adam ","Midway","3465","4833.35","-17772.62" +"Chang ","Richard ","Midway","4643","2207.98","-10938.56" +"Child ","Hellen ","Midway","2076","2736.24","178.93" +"Chu ","William ","Midway","6730","1864.32","-1738.30" +"Clark ","Lisa ","Midway","4857","1379.13","-8015.67" +"Clay ","Nellie ","Midway","5828","0.00","140.68" +"Coffin ","Billy ","Midway","2801","0.00","-12806.83" +"Combs ","Betty ","Midway","8542","2268.20","-8578.05" +"Contreras ","Joni ","Midway","3365","0.00","-15585.17" +"Contreras ","Joni ","Midway","485","5608.60","-13830.80" +"Conway ","Kymberly ","Midway","8192","914.51","-6169.15" +"Conyers ","Joseph ","Midway","8340","3355.28","-8950.43" +"Cosgrove ","Allison ","Midway","6504","4731.21","-3557.49" +"Coulter ","Jose ","Midway","5255","3495.56","-3276.76" +"Craig ","Richard ","Midway","5401","4319.41","-10468.08" +"Crowley ","Francis ","Midway","221","6359.95","-7921.07" +"Cunningham ","Bonnie ","Midway","2267","1446.57","-9164.03" +"Dabney ","Elnora ","Midway","3867","1861.68","-8792.10" +"Davidson ","Darrell ","Midway","6338","4690.96","-14035.54" +"Davis ","Chris ","Midway","9990","3214.94","-15264.33" +"Davis ","Chris ","Midway","519","469.26","-10880.20" +"Davis ","Chris ","Midway","519","0.00","-270.57" +"Davis ","Wanda ","Midway","1152","60.78","-6788.81" +"Dawkins ","Steven ","Midway","6008","509.59","-20668.46" +"Dawkins ","Steven ","Midway","2029","21.92","-12237.81" +"Delgadillo ","Katrina ","Midway","4270","1703.36","-11178.02" +"Delgado ","Brenda ","Midway","7215","1399.93","-16665.15" +"Delgado ","Brenda ","Midway","1891","3418.70","-6730.22" +"Derr ","Joanne ","Midway","1224","108.61","-14.40" +"Dewey ","Lucas ","Midway","6542","5405.58","-10287.74" +"Duarte ","Ruth ","Midway","5862","3975.41","-1347.02" +"Duke ","Felicia ","Midway","8025","2532.69","-18942.58" +"Dye ","Dana ","Midway","7641","3459.87","-4785.40" +"Eastman ","Yvette ","Midway","8188","1708.99","-2423.45" +"Eaton ","Joanne ","Midway","6190","4610.75","-11385.04" +"Farley ","Timothy ","Midway","9076","0.00","-10264.42" +"Ferguson ","Debra ","Midway","7789","3369.65","-10921.47" +"Ferrell ","Eva ","Midway","7872","308.29","-6937.90" +"Field ","Augusta ","Midway","6236","457.91","-871.41" +"Fitzpatrick ","Jennifer ","Midway","6270","3722.46","-13734.50" +"Fitzpatrick ","Jennifer ","Midway","5319","0.00","-7982.26" +"Fitzpatrick ","Jennifer ","Midway","3885","3745.19","-5219.52" +"Flores ","Lydia ","Midway","2837","322.62","-15337.25" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00080.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00080.sql new file mode 100644 index 00000000000..12f440a9e8a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00080.sql @@ -0,0 +1,107 @@ +WITH + ssr AS ( + SELECT + "s_store_id" "store_id" + , "sum"("ss_ext_sales_price") "sales" + , "sum"(COALESCE("sr_return_amt", 0)) "returns" + , "sum"(("ss_net_profit" - COALESCE("sr_net_loss", 0))) "profit" + FROM + (store_sales + LEFT JOIN store_returns ON ("ss_item_sk" = "sr_item_sk") + AND ("ss_ticket_number" = "sr_ticket_number")) + , date_dim + , store + , item + , promotion + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND (CAST("d_date" AS DATE) BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '30' DAY)) + AND ("ss_store_sk" = "s_store_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("i_current_price" > 50) + AND ("ss_promo_sk" = "p_promo_sk") + AND ("p_channel_tv" = 'N') + GROUP BY "s_store_id" +) +, csr AS ( + SELECT + "cp_catalog_page_id" "catalog_page_id" + , "sum"("cs_ext_sales_price") "sales" + , "sum"(COALESCE("cr_return_amount", 0)) "returns" + , "sum"(("cs_net_profit" - COALESCE("cr_net_loss", 0))) "profit" + FROM + (catalog_sales + LEFT JOIN catalog_returns ON ("cs_item_sk" = "cr_item_sk") + AND ("cs_order_number" = "cr_order_number")) + , date_dim + , catalog_page + , item + , promotion + WHERE ("cs_sold_date_sk" = "d_date_sk") + AND (CAST("d_date" AS DATE) BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '30' DAY)) + AND ("cs_catalog_page_sk" = "cp_catalog_page_sk") + AND ("cs_item_sk" = "i_item_sk") + AND ("i_current_price" > 50) + AND ("cs_promo_sk" = "p_promo_sk") + AND ("p_channel_tv" = 'N') + GROUP BY "cp_catalog_page_id" +) +, wsr AS ( + SELECT + "web_site_id" + , "sum"("ws_ext_sales_price") "sales" + , "sum"(COALESCE("wr_return_amt", 0)) "returns" + , "sum"(("ws_net_profit" - COALESCE("wr_net_loss", 0))) "profit" + FROM + (web_sales + LEFT JOIN web_returns ON ("ws_item_sk" = "wr_item_sk") + AND ("ws_order_number" = "wr_order_number")) + , date_dim + , web_site + , item + , promotion + WHERE ("ws_sold_date_sk" = "d_date_sk") + AND (CAST("d_date" AS DATE) BETWEEN CAST('2000-08-23' AS DATE) AND (CAST('2000-08-23' AS DATE) + INTERVAL '30' DAY)) + AND ("ws_web_site_sk" = "web_site_sk") + AND ("ws_item_sk" = "i_item_sk") + AND ("i_current_price" > 50) + AND ("ws_promo_sk" = "p_promo_sk") + AND ("p_channel_tv" = 'N') + GROUP BY "web_site_id" +) +SELECT + "channel" +, "id" +, "sum"("sales") "sales" +, "sum"("returns") "returns" +, "sum"("profit") "profit" +FROM + ( + SELECT + 'store channel' "channel" + , "concat"('store', "store_id") "id" + , "sales" + , "returns" + , "profit" + FROM + ssr +UNION ALL SELECT + 'catalog channel' "channel" + , "concat"('catalog_page', "catalog_page_id") "id" + , "sales" + , "returns" + , "profit" + FROM + csr +UNION ALL SELECT + 'web channel' "channel" + , "concat"('web_site', "web_site_id") "id" + , "sales" + , "returns" + , "profit" + FROM + wsr +) x +GROUP BY ROLLUP (channel, id) +ORDER BY "channel" ASC, "id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00080.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00080.txt new file mode 100644 index 00000000000..fd807937e93 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00080.txt @@ -0,0 +1,100 @@ +"catalog channel","catalog_pageAAAAAAAAABABAAAA","0.00","0.00","-147.11" +"catalog channel","catalog_pageAAAAAAAAAEABAAAA","3697.98","0.00","1652.64" +"catalog channel","catalog_pageAAAAAAAAAKCBAAAA","850.41","0.00","-7159.68" +"catalog channel","catalog_pageAAAAAAAAALCBAAAA","335.04","0.00","-256.33" +"catalog channel","catalog_pageAAAAAAAAALPAAAAA","0.00","0.00","-1445.22" +"catalog channel","catalog_pageAAAAAAAABBABAAAA","7491.21","0.00","4022.86" +"catalog channel","catalog_pageAAAAAAAABJCBAAAA","7827.79","0.00","2974.02" +"catalog channel","catalog_pageAAAAAAAABKPAAAAA","5292.94","0.00","-372.00" +"catalog channel","catalog_pageAAAAAAAABLPAAAAA","4302.50","0.00","2251.70" +"catalog channel","catalog_pageAAAAAAAABOPAAAAA","1880.81","0.00","-7132.27" +"catalog channel","catalog_pageAAAAAAAABPCBAAAA","406.00","0.00","-2015.50" +"catalog channel","catalog_pageAAAAAAAABPPAAAAA","5535.82","0.00","-676.96" +"catalog channel","catalog_pageAAAAAAAACCABAAAA","21860.62","0.00","11372.93" +"catalog channel","catalog_pageAAAAAAAACDABAAAA","3945.01","0.00","-6749.29" +"catalog channel","catalog_pageAAAAAAAACFABAAAA","1092.88","0.00","-251.32" +"catalog channel","catalog_pageAAAAAAAACFCBAAAA","3043.04","0.00","-4557.63" +"catalog channel","catalog_pageAAAAAAAACKPAAAAA","734.56","550.92","-462.64" +"catalog channel","catalog_pageAAAAAAAACNPAAAAA","7015.90","0.00","3092.42" +"catalog channel","catalog_pageAAAAAAAACOPAAAAA","4041.37","0.00","-2152.98" +"catalog channel","catalog_pageAAAAAAAACPPAAAAA","31.05","0.00","9.18" +"catalog channel","catalog_pageAAAAAAAADFCBAAAA","61.02","0.00","-168.12" +"catalog channel","catalog_pageAAAAAAAADHABAAAA","6647.76","0.00","1634.21" +"catalog channel","catalog_pageAAAAAAAADKCBAAAA","661.50","0.00","81.69" +"catalog channel","catalog_pageAAAAAAAADKPAAAAA","8604.96","0.00","-1563.48" +"catalog channel","catalog_pageAAAAAAAAECABAAAA","2484.01","0.00","-835.21" +"catalog channel","catalog_pageAAAAAAAAEDCBAAAA","1928.64","0.00","-249.41" +"catalog channel","catalog_pageAAAAAAAAEEABAAAA","1744.38","0.00","-1337.82" +"catalog channel","catalog_pageAAAAAAAAEGABAAAA","1172.80","0.00","-3953.60" +"catalog channel","catalog_pageAAAAAAAAEGCBAAAA","202.47","0.00","-2361.81" +"catalog channel","catalog_pageAAAAAAAAEHCBAAAA","1427.36","0.00","777.48" +"catalog channel","catalog_pageAAAAAAAAENCBAAAA","3532.90","0.00","8.50" +"catalog channel","catalog_pageAAAAAAAAFAABAAAA","948.48","0.00","-2017.08" +"catalog channel","catalog_pageAAAAAAAAFEABAAAA","1584.72","0.00","-27.90" +"catalog channel","catalog_pageAAAAAAAAFFABAAAA","149.28","0.00","-70.74" +"catalog channel","catalog_pageAAAAAAAAFICBAAAA","24292.00","0.00","15029.00" +"catalog channel","catalog_pageAAAAAAAAFKPAAAAA","2803.70","0.00","-1856.06" +"catalog channel","catalog_pageAAAAAAAAFNPAAAAA","570.24","0.00","-5743.71" +"catalog channel","catalog_pageAAAAAAAAFOCBAAAA","815.20","0.00","98.00" +"catalog channel","catalog_pageAAAAAAAAGGABAAAA","1574.40","0.00","375.36" +"catalog channel","catalog_pageAAAAAAAAGKPAAAAA","1143.00","0.00","623.40" +"catalog channel","catalog_pageAAAAAAAAHAABAAAA","5441.36","0.00","714.82" +"catalog channel","catalog_pageAAAAAAAAHICBAAAA","152.82","0.00","36.72" +"catalog channel","catalog_pageAAAAAAAAHKCBAAAA","6252.87","0.00","2845.83" +"catalog channel","catalog_pageAAAAAAAAHKPAAAAA","2867.10","0.00","-1107.30" +"catalog channel","catalog_pageAAAAAAAAHMPAAAAA","4176.30","0.00","-1052.22" +"catalog channel","catalog_pageAAAAAAAAHNPAAAAA","139.58","0.00","-758.66" +"catalog channel","catalog_pageAAAAAAAAIBABAAAA","360.78","0.00","-1450.89" +"catalog channel","catalog_pageAAAAAAAAIDCBAAAA","40.50","0.00","-192.51" +"catalog channel","catalog_pageAAAAAAAAIEABAAAA","6463.00","0.00","-2158.09" +"catalog channel","catalog_pageAAAAAAAAIGCBAAAA","1082.48","0.00","542.08" +"catalog channel","catalog_pageAAAAAAAAIJCBAAAA","195.00","0.00","-1492.00" +"catalog channel","catalog_pageAAAAAAAAIKPAAAAA","270.40","0.00","-304.00" +"catalog channel","catalog_pageAAAAAAAAIMPAAAAA","123.62","0.00","35.14" +"catalog channel","catalog_pageAAAAAAAAIOPAAAAA","287.10","0.00","-1883.64" +"catalog channel","catalog_pageAAAAAAAAIPCBAAAA","75.30","0.00","22.41" +"catalog channel","catalog_pageAAAAAAAAIPPAAAAA","436.32","0.00","-71.10" +"catalog channel","catalog_pageAAAAAAAAJFCBAAAA","489.40","0.00","217.75" +"catalog channel","catalog_pageAAAAAAAAJKPAAAAA","10181.61","0.00","-27.06" +"catalog channel","catalog_pageAAAAAAAAKCCBAAAA","2017.79","0.00","-1307.62" +"catalog channel","catalog_pageAAAAAAAAKLPAAAAA","70.50","0.00","-383.85" +"catalog channel","catalog_pageAAAAAAAAKOPAAAAA","2711.49","0.00","1126.70" +"catalog channel","catalog_pageAAAAAAAAKPPAAAAA","973.59","0.00","-209.61" +"catalog channel","catalog_pageAAAAAAAALFABAAAA","1887.55","950.72","9.37" +"catalog channel","catalog_pageAAAAAAAALICBAAAA","46.41","0.00","-1136.31" +"catalog channel","catalog_pageAAAAAAAALKPAAAAA","6912.96","0.00","208.05" +"catalog channel","catalog_pageAAAAAAAALLCBAAAA","162.75","0.00","-1504.90" +"catalog channel","catalog_pageAAAAAAAALLPAAAAA","2140.45","0.00","-1603.55" +"catalog channel","catalog_pageAAAAAAAALMPAAAAA","0.00","0.00","-358.74" +"catalog channel","catalog_pageAAAAAAAALNPAAAAA","374.52","0.00","107.24" +"catalog channel","catalog_pageAAAAAAAAMAABAAAA","43.45","0.00","-847.00" +"catalog channel","catalog_pageAAAAAAAAMDABAAAA","4204.62","0.00","737.10" +"catalog channel","catalog_pageAAAAAAAAMFABAAAA","4597.62","2500.46","-1868.52" +"catalog channel","catalog_pageAAAAAAAAMJCBAAAA","7754.96","0.00","2991.50" +"catalog channel","catalog_pageAAAAAAAAMLCBAAAA","301.50","0.00","-116.50" +"catalog channel","catalog_pageAAAAAAAANBABAAAA","588.24","0.00","-1966.50" +"catalog channel","catalog_pageAAAAAAAANDCBAAAA","470.34","0.00","-532.24" +"catalog channel","catalog_pageAAAAAAAANMPAAAAA","9944.50","0.00","4188.76" +"catalog channel","catalog_pageAAAAAAAANNPAAAAA","255.00","0.00","-60.52" +"catalog channel","catalog_pageAAAAAAAANOPAAAAA","703.29","0.00","-240.89" +"catalog channel","catalog_pageAAAAAAAANPPAAAAA","3532.58","0.00","1355.09" +"catalog channel","catalog_pageAAAAAAAAOAABAAAA","1658.15","0.00","-2309.45" +"catalog channel","catalog_pageAAAAAAAAOCABAAAA","4712.71","3116.50","1695.17" +"catalog channel","catalog_pageAAAAAAAAOEABAAAA","10893.64","0.00","5434.68" +"catalog channel","catalog_pageAAAAAAAAOGCBAAAA","325.68","0.00","4.14" +"catalog channel","catalog_pageAAAAAAAAOLPAAAAA","9602.04","0.00","-2137.17" +"catalog channel","catalog_pageAAAAAAAAOMCBAAAA","141.29","0.00","-1137.42" +"catalog channel","catalog_pageAAAAAAAAOOPAAAAA","55.20","0.00","-5486.04" +"catalog channel","catalog_pageAAAAAAAAOPPAAAAA","4769.18","2185.98","-1767.20" +"catalog channel","catalog_pageAAAAAAAAPAABAAAA","3961.16","2781.24","-8465.49" +"catalog channel","catalog_pageAAAAAAAAPECBAAAA","2746.95","0.00","-3744.80" +"catalog channel","catalog_pageAAAAAAAAPGABAAAA","10357.20","0.00","6027.00" +"catalog channel","catalog_pageAAAAAAAAPJCBAAAA","438.44","207.92","-1101.70" +"catalog channel","catalog_pageAAAAAAAAPJPAAAAA","1611.17","0.00","-5556.16" +"catalog channel","catalog_pageAAAAAAAAPOPAAAAA","4273.75","0.00","188.20" +"catalog channel","","286009.96","12293.74","-35412.38" +"store channel","storeAAAAAAAABAAAAAAA ","186861.52","14258.85","-83857.30" +"store channel","storeAAAAAAAACAAAAAAA ","115825.62","2970.78","-57289.84" +"store channel","","302687.14","17229.63","-141147.14" +"web channel","web_siteAAAAAAAABAAAAAAA ","10859.87","0.00","719.72" +"web channel","web_siteAAAAAAAACAAAAAAA ","17199.17","495.18","-11337.52" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00081.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00081.sql new file mode 100644 index 00000000000..8049fdd7f4c --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00081.sql @@ -0,0 +1,48 @@ +WITH + customer_total_return AS ( + SELECT + "cr_returning_customer_sk" "ctr_customer_sk" + , "ca_state" "ctr_state" + , "sum"("cr_return_amt_inc_tax") "ctr_total_return" + FROM + catalog_returns + , date_dim + , customer_address + WHERE ("cr_returned_date_sk" = "d_date_sk") + AND ("d_year" = 2000) + AND ("cr_returning_addr_sk" = "ca_address_sk") + GROUP BY "cr_returning_customer_sk", "ca_state" +) +SELECT + "c_customer_id" +, "c_salutation" +, "c_first_name" +, "c_last_name" +, "ca_street_number" +, "ca_street_name" +, "ca_street_type" +, "ca_suite_number" +, "ca_city" +, "ca_county" +, "ca_state" +, "ca_zip" +, "ca_country" +, "ca_gmt_offset" +, "ca_location_type" +, "ctr_total_return" +FROM + customer_total_return ctr1 +, customer_address +, customer +WHERE ("ctr1"."ctr_total_return" > ( + SELECT ("avg"("ctr_total_return") * DECIMAL '1.2') + FROM + customer_total_return ctr2 + WHERE ("ctr1"."ctr_state" = "ctr2"."ctr_state") + )) + AND ("ca_address_sk" = "c_current_addr_sk") + AND ("ca_state" = 'GA') + AND ("ctr1"."ctr_customer_sk" = "c_customer_sk") +ORDER BY "c_customer_id" ASC, "c_salutation" ASC, "c_first_name" ASC, "c_last_name" ASC, "ca_street_number" ASC, "ca_street_name" ASC, "ca_street_type" ASC, "ca_suite_number" ASC, "ca_city" ASC, "ca_county" ASC, "ca_state" ASC, "ca_zip" ASC, "ca_country" ASC, "ca_gmt_offset" ASC, "ca_location_type" ASC, "ctr_total_return" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00081.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00081.txt new file mode 100644 index 00000000000..494d1457aac --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00081.txt @@ -0,0 +1,29 @@ +"AAAAAAAABKCAAAAA","Dr. ","Terrence ","Albright ","419 ","View Miller","Wy ","Suite 360 ","Pleasant Grove","Cobb County","GA","34136 ","United States","-5.00","single family ","5079.60" +"AAAAAAAACKBAAAAA","Dr. ","Maurice ","Morales ","313 ","2nd Eigth","Avenue ","Suite 40 ","Marion","Glascock County","GA","30399 ","United States","-5.00","condo ","3038.84" +"AAAAAAAACNAAAAAA","Ms. ","Diane ","Blount ","780 ","4th ","Ave ","Suite T ","Spring Hill","Worth County","GA","36787 ","United States","-5.00","single family ","5614.20" +"AAAAAAAADADAAAAA","Mr. ","Charles ","Loveless ","24 ","Central ","Blvd ","Suite 490 ","Crossroads","Brooks County","GA","30534 ","United States","-5.00","single family ","1429.42" +"AAAAAAAADGDAAAAA","Mr. ","Alberto ","Mccreary ","379 ","Spring Eigth","Street ","Suite R ","Cedar Grove","Wilcox County","GA","30411 ","United States","-5.00","single family ","544.12" +"AAAAAAAADGDAAAAA","Mr. ","Alberto ","Mccreary ","379 ","Spring Eigth","Street ","Suite R ","Cedar Grove","Wilcox County","GA","30411 ","United States","-5.00","single family ","2712.19" +"AAAAAAAAEMDAAAAA","Dr. ","Aline ","Ramos ","416 ","10th ","Boulevard ","Suite R ","Calhoun","Miller County","GA","36909 ","United States","-5.00","condo ","2204.66" +"AAAAAAAAEMDAAAAA","Dr. ","Aline ","Ramos ","416 ","10th ","Boulevard ","Suite R ","Calhoun","Miller County","GA","36909 ","United States","-5.00","condo ","4518.97" +"AAAAAAAAENDAAAAA","Sir ","Richard ","Bell ","419 ","View Miller","Wy ","Suite 360 ","Pleasant Grove","Cobb County","GA","34136 ","United States","-5.00","single family ","14670.20" +"AAAAAAAAFBCAAAAA","Mr. ","Douglas ","Scott ","498 ","Lake ","Way ","Suite 490 ","Spring Valley","Habersham County","GA","36060 ","United States","-5.00","single family ","6745.16" +"AAAAAAAAFDAAAAAA","Mr. ","Paul ","Higgins ","828 ","2nd Miller","ST ","Suite S ","Mechanicsburg","Wheeler County","GA","32219 ","United States","-5.00","apartment ","2881.20" +"AAAAAAAAFGAAAAAA","Dr. ","Jeffrey ","Bruce ","52 ","6th Park","Drive ","Suite E ","Farmington","Johnson County","GA","39145 ","United States","-5.00","condo ","3347.84" +"AAAAAAAAFLDAAAAA","Ms. ","Margaret ","Roberts ","780 ","4th ","Ave ","Suite T ","Spring Hill","Worth County","GA","36787 ","United States","-5.00","single family ","2150.71" +"AAAAAAAAFLDAAAAA","Ms. ","Margaret ","Roberts ","780 ","4th ","Ave ","Suite T ","Spring Hill","Worth County","GA","36787 ","United States","-5.00","single family ","2369.63" +"AAAAAAAAHMAAAAAA","Mr. ","Edwardo ","Porter ","986 ","West East","Blvd ","Suite F ","Pleasant Grove","Coweta County","GA","34136 ","United States","-5.00","apartment ","3294.48" +"AAAAAAAAHNAAAAAA","Miss ","Lillian ","Morgan ","420 ","Park ","Street ","Suite L ","Oakwood","Lamar County","GA","30169 ","United States","-5.00","single family ","1885.51" +"AAAAAAAAIHDAAAAA","Sir ","Mark ","Bartley ","353 ","Sixth ","Ln ","Suite 410 ","Oak Ridge","Charlton County","GA","38371 ","United States","-5.00","condo ","1834.90" +"AAAAAAAAIOCAAAAA","Dr. ","Julio ","Mcdaniel ","344 ","Oak ","Circle ","Suite S ","Five Forks","Montgomery County","GA","32293 ","United States","-5.00","single family ","2765.35" +"AAAAAAAAJHAAAAAA","Mrs. ","","","780 ","4th ","Ave ","Suite T ","Spring Hill","Worth County","GA","36787 ","United States","-5.00","single family ","3618.05" +"AAAAAAAAJMAAAAAA","Dr. ","James ","Scott ","562 ","5th Smith","Ct. ","Suite G ","Concord","Marion County","GA","34107 ","United States","-5.00","single family ","1967.80" +"AAAAAAAAKCAAAAAA","Dr. ","Deborah ","Burton ","129 ","Valley ","Circle ","Suite 410 ","Ashland","Decatur County","GA","34244 ","United States","-5.00","single family ","3480.13" +"AAAAAAAAKCAAAAAA","Dr. ","Deborah ","Burton ","129 ","Valley ","Circle ","Suite 410 ","Ashland","Decatur County","GA","34244 ","United States","-5.00","single family ","3625.94" +"AAAAAAAALJBAAAAA","Sir ","Cleo ","Spangler ","264 ","Main ","Drive ","Suite V ","Cedar Grove","Wilcox County","GA","30411 ","United States","-5.00","condo ","2334.40" +"AAAAAAAALOAAAAAA","Mr. ","Salvador ","Ramirez ","444 ","Lake ","Boulevard ","Suite A ","Marion","Macon County","GA","30399 ","United States","-5.00","single family ","3057.86" +"AAAAAAAALOAAAAAA","Mr. ","Salvador ","Ramirez ","444 ","Lake ","Boulevard ","Suite A ","Marion","Macon County","GA","30399 ","United States","-5.00","single family ","3212.18" +"AAAAAAAAMPBAAAAA","Mr. ","Carlos ","Garza ","335 ","7th ","Blvd ","Suite 230 ","Plainview","Taylor County","GA","33683 ","United States","-5.00","apartment ","4215.74" +"AAAAAAAANJCAAAAA","Mrs. ","Ella ","Barnette ","949 ","12th ","Boulevard ","Suite V ","Arlington","Tift County","GA","36557 ","United States","-5.00","single family ","4484.34" +"AAAAAAAAPMBAAAAA","Sir ","Charlie ","Deleon ","148 ","Fourth Elm","Street ","Suite W ","Oak Hill","Clayton County","GA","37838 ","United States","-5.00","condo ","2505.77" +"AAAAAAAAPMBAAAAA","Sir ","Charlie ","Deleon ","148 ","Fourth Elm","Street ","Suite W ","Oak Hill","Clayton County","GA","37838 ","United States","-5.00","condo ","4005.21" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00086.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00086.sql new file mode 100644 index 00000000000..941c89775b0 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00086.sql @@ -0,0 +1,17 @@ +SELECT + "sum"("ws_net_paid") "total_sum" +, "i_category" +, "i_class" +, (GROUPING ("i_category") + GROUPING ("i_class")) "lochierarchy" +, "rank"() OVER (PARTITION BY (GROUPING ("i_category") + GROUPING ("i_class")), (CASE WHEN (GROUPING ("i_class") = 0) THEN "i_category" END) ORDER BY "sum"("ws_net_paid") DESC) "rank_within_parent" +FROM + web_sales +, date_dim d1 +, item +WHERE ("d1"."d_month_seq" BETWEEN 1200 AND (1200 + 11)) + AND ("d1"."d_date_sk" = "ws_sold_date_sk") + AND ("i_item_sk" = "ws_item_sk") +GROUP BY ROLLUP (i_category, i_class) +ORDER BY "lochierarchy" DESC, (CASE WHEN ("lochierarchy" = 0) THEN "i_category" END) ASC, "rank_within_parent" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00086.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00086.txt new file mode 100644 index 00000000000..fddffb5cf62 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00086.txt @@ -0,0 +1,100 @@ +"5189585.33","","","2","1" +"655046.32","Men ","","1","1" +"626624.82","Women ","","1","2" +"581067.68","Books ","","1","3" +"561790.19","Music ","","1","4" +"510840.54","Shoes ","","1","5" +"495178.04","Electronics ","","1","6" +"472123.12","Jewelry ","","1","7" +"459386.12","Children ","","1","8" +"405665.89","Sports ","","1","9" +"401556.14","Home ","","1","10" +"20306.47","","","1","11" +"68702.95","Books ","romance ","0","1" +"65051.89","Books ","fiction ","0","2" +"59783.06","Books ","business ","0","3" +"45029.55","Books ","entertainments ","0","4" +"44560.70","Books ","reference ","0","5" +"39990.72","Books ","cooking ","0","6" +"34990.25","Books ","self-help ","0","7" +"29650.97","Books ","computers ","0","8" +"29327.70","Books ","travel ","0","9" +"28930.75","Books ","history ","0","10" +"25491.36","Books ","sports ","0","11" +"24398.83","Books ","arts ","0","12" +"24164.51","Books ","parenting ","0","13" +"23909.89","Books ","home repair ","0","14" +"22835.73","Books ","mystery ","0","15" +"13053.94","Books ","science ","0","16" +"1194.88","Books ","","0","17" +"130979.49","Children ","toddlers ","0","1" +"128151.67","Children ","newborn ","0","2" +"111833.79","Children ","school-uniforms ","0","3" +"88421.17","Children ","infants ","0","4" +"85432.91","Electronics ","televisions ","0","1" +"61661.11","Electronics ","dvd/vcr players ","0","2" +"42718.00","Electronics ","stereo ","0","3" +"37591.39","Electronics ","cameras ","0","4" +"37375.54","Electronics ","disk drives ","0","5" +"35997.36","Electronics ","karoke ","0","6" +"26723.20","Electronics ","musical ","0","7" +"23368.30","Electronics ","memory ","0","8" +"23305.78","Electronics ","camcorders ","0","9" +"22707.58","Electronics ","monitors ","0","10" +"19521.01","Electronics ","automotive ","0","11" +"19237.68","Electronics ","scanners ","0","12" +"18458.48","Electronics ","wireless ","0","13" +"17131.00","Electronics ","audio ","0","14" +"13635.23","Electronics ","portable ","0","15" +"10313.47","Electronics ","personal ","0","16" +"56487.04","Home ","rugs ","0","1" +"45508.16","Home ","lighting ","0","2" +"39962.88","Home ","bedding ","0","3" +"32120.99","Home ","flatware ","0","4" +"31748.57","Home ","decor ","0","5" +"30547.36","Home ","paint ","0","6" +"29553.20","Home ","curtains/drapes ","0","7" +"27484.90","Home ","furniture ","0","8" +"25394.01","Home ","mattresses ","0","9" +"21519.60","Home ","blinds/shades ","0","10" +"20562.09","Home ","glassware ","0","11" +"15843.61","Home ","kids ","0","12" +"13783.44","Home ","accent ","0","13" +"6563.55","Home ","bathroom ","0","14" +"3573.14","Home ","wallpaper ","0","15" +"903.60","Home ","tables ","0","16" +"63303.57","Jewelry ","bracelets ","0","1" +"56115.38","Jewelry ","pendants ","0","2" +"53681.29","Jewelry ","costume ","0","3" +"52150.66","Jewelry ","jewelry boxes ","0","4" +"40625.64","Jewelry ","gold ","0","5" +"38009.46","Jewelry ","loose stones ","0","6" +"35536.66","Jewelry ","diamonds ","0","7" +"31842.23","Jewelry ","womens watch ","0","8" +"31031.51","Jewelry ","estate ","0","9" +"21041.50","Jewelry ","birdal ","0","10" +"14870.47","Jewelry ","rings ","0","11" +"12185.93","Jewelry ","custom ","0","12" +"10806.73","Jewelry ","earings ","0","13" +"4282.96","Jewelry ","semi-precious ","0","14" +"3864.57","Jewelry ","mens watch ","0","15" +"2774.56","Jewelry ","consignment ","0","16" +"248232.12","Men ","accessories ","0","1" +"168075.09","Men ","sports-apparel ","0","2" +"125910.01","Men ","shirts ","0","3" +"112829.10","Men ","pants ","0","4" +"172709.93","Music ","pop ","0","1" +"136352.75","Music ","rock ","0","2" +"129374.40","Music ","country ","0","3" +"123353.11","Music ","classical ","0","4" +"158284.43","Shoes ","mens ","0","1" +"121177.11","Shoes ","kids ","0","2" +"119174.81","Shoes ","athletic ","0","3" +"112204.19","Shoes ","womens ","0","4" +"76821.59","Sports ","guns ","0","1" +"53949.93","Sports ","golf ","0","2" +"36112.01","Sports ","hockey ","0","3" +"35802.31","Sports ","outdoor ","0","4" +"35004.59","Sports ","fitness ","0","5" +"31211.29","Sports ","camping ","0","6" +"27549.99","Sports ","fishing ","0","7" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00087.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00087.sql new file mode 100644 index 00000000000..545af8674ff --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00087.sql @@ -0,0 +1,41 @@ +SELECT "count"(*) +FROM + ( +( + SELECT DISTINCT + "c_last_name" + , "c_first_name" + , "d_date" + FROM + store_sales + , date_dim + , customer + WHERE ("store_sales"."ss_sold_date_sk" = "date_dim"."d_date_sk") + AND ("store_sales"."ss_customer_sk" = "customer"."c_customer_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + ) EXCEPT ( + SELECT DISTINCT + "c_last_name" + , "c_first_name" + , "d_date" + FROM + catalog_sales + , date_dim + , customer + WHERE ("catalog_sales"."cs_sold_date_sk" = "date_dim"."d_date_sk") + AND ("catalog_sales"."cs_bill_customer_sk" = "customer"."c_customer_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + ) EXCEPT ( + SELECT DISTINCT + "c_last_name" + , "c_first_name" + , "d_date" + FROM + web_sales + , date_dim + , customer + WHERE ("web_sales"."ws_sold_date_sk" = "date_dim"."d_date_sk") + AND ("web_sales"."ws_bill_customer_sk" = "customer"."c_customer_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + ) ) cool_cust +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00087.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00087.txt new file mode 100644 index 00000000000..50cc2301511 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00087.txt @@ -0,0 +1 @@ +"1994" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00088.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00088.sql new file mode 100644 index 00000000000..bf01da44a74 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00088.sql @@ -0,0 +1,163 @@ +SELECT * +FROM + ( + SELECT "count"(*) "h8_30_to_9" + FROM + store_sales + , household_demographics + , time_dim + , store + WHERE ("ss_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ss_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("time_dim"."t_hour" = 8) + AND ("time_dim"."t_minute" >= 30) + AND ((("household_demographics"."hd_dep_count" = 4) + AND ("household_demographics"."hd_vehicle_count" <= (4 + 2))) + OR (("household_demographics"."hd_dep_count" = 2) + AND ("household_demographics"."hd_vehicle_count" <= (2 + 2))) + OR (("household_demographics"."hd_dep_count" = 0) + AND ("household_demographics"."hd_vehicle_count" <= (0 + 2)))) + AND ("store"."s_store_name" = 'ese') +) s1 +, ( + SELECT "count"(*) "h9_to_9_30" + FROM + store_sales + , household_demographics + , time_dim + , store + WHERE ("ss_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ss_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("time_dim"."t_hour" = 9) + AND ("time_dim"."t_minute" < 30) + AND ((("household_demographics"."hd_dep_count" = 4) + AND ("household_demographics"."hd_vehicle_count" <= (4 + 2))) + OR (("household_demographics"."hd_dep_count" = 2) + AND ("household_demographics"."hd_vehicle_count" <= (2 + 2))) + OR (("household_demographics"."hd_dep_count" = 0) + AND ("household_demographics"."hd_vehicle_count" <= (0 + 2)))) + AND ("store"."s_store_name" = 'ese') +) s2 +, ( + SELECT "count"(*) "h9_30_to_10" + FROM + store_sales + , household_demographics + , time_dim + , store + WHERE ("ss_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ss_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("time_dim"."t_hour" = 9) + AND ("time_dim"."t_minute" >= 30) + AND ((("household_demographics"."hd_dep_count" = 4) + AND ("household_demographics"."hd_vehicle_count" <= (4 + 2))) + OR (("household_demographics"."hd_dep_count" = 2) + AND ("household_demographics"."hd_vehicle_count" <= (2 + 2))) + OR (("household_demographics"."hd_dep_count" = 0) + AND ("household_demographics"."hd_vehicle_count" <= (0 + 2)))) + AND ("store"."s_store_name" = 'ese') +) s3 +, ( + SELECT "count"(*) "h10_to_10_30" + FROM + store_sales + , household_demographics + , time_dim + , store + WHERE ("ss_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ss_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("time_dim"."t_hour" = 10) + AND ("time_dim"."t_minute" < 30) + AND ((("household_demographics"."hd_dep_count" = 4) + AND ("household_demographics"."hd_vehicle_count" <= (4 + 2))) + OR (("household_demographics"."hd_dep_count" = 2) + AND ("household_demographics"."hd_vehicle_count" <= (2 + 2))) + OR (("household_demographics"."hd_dep_count" = 0) + AND ("household_demographics"."hd_vehicle_count" <= (0 + 2)))) + AND ("store"."s_store_name" = 'ese') +) s4 +, ( + SELECT "count"(*) "h10_30_to_11" + FROM + store_sales + , household_demographics + , time_dim + , store + WHERE ("ss_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ss_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("time_dim"."t_hour" = 10) + AND ("time_dim"."t_minute" >= 30) + AND ((("household_demographics"."hd_dep_count" = 4) + AND ("household_demographics"."hd_vehicle_count" <= (4 + 2))) + OR (("household_demographics"."hd_dep_count" = 2) + AND ("household_demographics"."hd_vehicle_count" <= (2 + 2))) + OR (("household_demographics"."hd_dep_count" = 0) + AND ("household_demographics"."hd_vehicle_count" <= (0 + 2)))) + AND ("store"."s_store_name" = 'ese') +) s5 +, ( + SELECT "count"(*) "h11_to_11_30" + FROM + store_sales + , household_demographics + , time_dim + , store + WHERE ("ss_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ss_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("time_dim"."t_hour" = 11) + AND ("time_dim"."t_minute" < 30) + AND ((("household_demographics"."hd_dep_count" = 4) + AND ("household_demographics"."hd_vehicle_count" <= (4 + 2))) + OR (("household_demographics"."hd_dep_count" = 2) + AND ("household_demographics"."hd_vehicle_count" <= (2 + 2))) + OR (("household_demographics"."hd_dep_count" = 0) + AND ("household_demographics"."hd_vehicle_count" <= (0 + 2)))) + AND ("store"."s_store_name" = 'ese') +) s6 +, ( + SELECT "count"(*) "h11_30_to_12" + FROM + store_sales + , household_demographics + , time_dim + , store + WHERE ("ss_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ss_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("time_dim"."t_hour" = 11) + AND ("time_dim"."t_minute" >= 30) + AND ((("household_demographics"."hd_dep_count" = 4) + AND ("household_demographics"."hd_vehicle_count" <= (4 + 2))) + OR (("household_demographics"."hd_dep_count" = 2) + AND ("household_demographics"."hd_vehicle_count" <= (2 + 2))) + OR (("household_demographics"."hd_dep_count" = 0) + AND ("household_demographics"."hd_vehicle_count" <= (0 + 2)))) + AND ("store"."s_store_name" = 'ese') +) s7 +, ( + SELECT "count"(*) "h12_to_12_30" + FROM + store_sales + , household_demographics + , time_dim + , store + WHERE ("ss_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ss_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("time_dim"."t_hour" = 12) + AND ("time_dim"."t_minute" < 30) + AND ((("household_demographics"."hd_dep_count" = 4) + AND ("household_demographics"."hd_vehicle_count" <= (4 + 2))) + OR (("household_demographics"."hd_dep_count" = 2) + AND ("household_demographics"."hd_vehicle_count" <= (2 + 2))) + OR (("household_demographics"."hd_dep_count" = 0) + AND ("household_demographics"."hd_vehicle_count" <= (0 + 2)))) + AND ("store"."s_store_name" = 'ese') +) s8 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00088.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00088.txt new file mode 100644 index 00000000000..ea976756191 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00088.txt @@ -0,0 +1 @@ +"0","0","0","0","0","0","0","0" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00089.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00089.sql new file mode 100644 index 00000000000..934b8cdf033 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00089.sql @@ -0,0 +1,31 @@ +SELECT * +FROM + ( + SELECT + "i_category" + , "i_class" + , "i_brand" + , "s_store_name" + , "s_company_name" + , "d_moy" + , "sum"("ss_sales_price") "sum_sales" + , "avg"("sum"("ss_sales_price")) OVER (PARTITION BY "i_category", "i_brand", "s_store_name", "s_company_name") "avg_monthly_sales" + FROM + item + , store_sales + , date_dim + , store + WHERE ("ss_item_sk" = "i_item_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("d_year" IN (1999)) + AND ((("i_category" IN ('Books' , 'Electronics' , 'Sports')) + AND ("i_class" IN ('computers' , 'stereo' , 'football'))) + OR (("i_category" IN ('Men' , 'Jewelry' , 'Women')) + AND ("i_class" IN ('shirts' , 'birdal' , 'dresses')))) + GROUP BY "i_category", "i_class", "i_brand", "s_store_name", "s_company_name", "d_moy" +) tmp1 +WHERE ((CASE WHEN ("avg_monthly_sales" <> 0) THEN ("abs"(("sum_sales" - "avg_monthly_sales")) / "avg_monthly_sales") ELSE null END) > DECIMAL '0.1') +ORDER BY ("sum_sales" - "avg_monthly_sales") ASC, "s_store_name" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00089.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00089.txt new file mode 100644 index 00000000000..b1a6fdfde50 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00089.txt @@ -0,0 +1,100 @@ +"Women ","dresses ","amalgamalg #1 ","ought","Unknown","3","95.65","609.84" +"Women ","dresses ","amalgamalg #1 ","able","Unknown","7","99.64","603.49" +"Women ","dresses ","amalgamalg #1 ","able","Unknown","6","102.02","603.49" +"Men ","shirts ","importoimporto #1 ","able","Unknown","3","228.92","695.05" +"Men ","shirts ","importoimporto #1 ","able","Unknown","6","267.60","695.05" +"Men ","shirts ","importoimporto #1 ","ought","Unknown","5","118.51","507.84" +"Men ","shirts ","importoimporto #1 ","ought","Unknown","6","119.36","507.84" +"Women ","dresses ","amalgamalg #1 ","able","Unknown","2","234.31","603.49" +"Men ","shirts ","importoimporto #1 ","able","Unknown","4","329.45","695.05" +"Men ","shirts ","importoimporto #1 ","able","Unknown","2","356.06","695.05" +"Men ","shirts ","importoimporto #1 ","ought","Unknown","4","181.44","507.84" +"Women ","dresses ","amalgamalg #1 ","ought","Unknown","2","298.74","609.84" +"Men ","shirts ","importoimporto #1 ","able","Unknown","5","422.13","695.05" +"Men ","shirts ","importoimporto #1 ","ought","Unknown","2","242.42","507.84" +"Women ","dresses ","amalgamalg #1 ","able","Unknown","4","341.41","603.49" +"Women ","dresses ","amalgamalg #2 ","ought","Unknown","5","0.00","253.74" +"Women ","dresses ","amalgamalg #1 ","ought","Unknown","7","361.89","609.84" +"Women ","dresses ","amalgamalg #1 ","able","Unknown","3","358.39","603.49" +"Women ","dresses ","amalgamalg #1 ","ought","Unknown","5","368.71","609.84" +"Men ","shirts ","importoimporto #1 ","ought","Unknown","1","278.84","507.84" +"Women ","dresses ","amalgamalg #1 ","ought","Unknown","6","404.81","609.84" +"Men ","shirts ","importoimporto #1 ","able","Unknown","7","495.95","695.05" +"Women ","dresses ","amalgamalg #2 ","ought","Unknown","4","79.13","253.74" +"Women ","dresses ","amalgamalg #2 ","able","Unknown","6","111.61","279.54" +"Men ","shirts ","importoimporto #2 ","ought","Unknown","2","87.84","255.49" +"Men ","shirts ","importoimporto #2 ","able","Unknown","6","40.21","198.12" +"Women ","dresses ","amalgamalg #2 ","able","Unknown","4","125.30","279.54" +"Men ","shirts ","importoimporto #2 ","ought","Unknown","6","102.66","255.49" +"Men ","shirts ","importoimporto #2 ","ought","Unknown","1","109.36","255.49" +"Women ","dresses ","amalgamalg #1 ","able","Unknown","5","461.94","603.49" +"Women ","dresses ","amalgamalg #2 ","able","Unknown","9","140.25","279.54" +"Men ","shirts ","importoimporto #1 ","able","Unknown","1","556.27","695.05" +"Men ","shirts ","importoimporto #1 ","able","Unknown","9","561.29","695.05" +"Women ","dresses ","amalgamalg #1 ","ought","Unknown","4","488.70","609.84" +"Men ","shirts ","importoimporto #2 ","ought","Unknown","3","135.22","255.49" +"Men ","shirts ","importoimporto #2 ","ought","Unknown","4","135.37","255.49" +"Men ","shirts ","importoimporto #1 ","ought","Unknown","3","388.48","507.84" +"Men ","shirts ","importoimporto #2 ","ought","Unknown","5","137.72","255.49" +"Women ","dresses ","amalgamalg #2 ","ought","Unknown","2","136.13","253.74" +"Men ","shirts ","importoimporto #2 ","able","Unknown","9","83.86","198.12" +"Women ","dresses ","amalgamalg #1 ","ought","Unknown","8","496.44","609.84" +"Men ","shirts ","importoimporto #2 ","ought","Unknown","10","144.54","255.49" +"Electronics ","stereo ","exportiamalgamalg #14 ","able","Unknown","12","8.56","113.23" +"Electronics ","stereo ","exportiamalgamalg #14 ","able","Unknown","1","14.00","113.23" +"Women ","dresses ","amalgamalg #2 ","ought","Unknown","7","155.49","253.74" +"Electronics ","stereo ","exportiamalgamalg #14 ","able","Unknown","11","17.56","113.23" +"Electronics ","stereo ","exportiamalgamalg #14 ","ought","Unknown","4","65.05","157.16" +"Sports ","football ","corpnameless #8 ","ought","Unknown","1","23.79","115.57" +"Sports ","football ","corpnameless #8 ","ought","Unknown","2","25.91","115.57" +"Sports ","football ","corpnameless #5 ","ought","Unknown","5","6.16","91.23" +"Books ","computers ","exportimaxi #5 ","able","Unknown","5","5.96","90.89" +"Women ","dresses ","amalgamalg #2 ","able","Unknown","2","195.04","279.54" +"Jewelry ","birdal ","amalgcorp #8 ","able","Unknown","9","1.39","84.84" +"Books ","computers ","exportimaxi #5 ","able","Unknown","10","8.57","90.89" +"Sports ","football ","corpnameless #2 ","ought","Unknown","12","12.63","94.80" +"Jewelry ","birdal ","amalgcorp #8 ","ought","Unknown","9","15.73","96.70" +"Women ","dresses ","amalgamalg #1 ","ought","Unknown","1","529.28","609.84" +"Men ","shirts ","importoimporto #1 ","ought","Unknown","7","427.57","507.84" +"Jewelry ","birdal ","amalgcorp #8 ","ought","Unknown","8","17.96","96.70" +"Jewelry ","birdal ","amalgcorp #8 ","able","Unknown","5","7.98","84.84" +"Jewelry ","birdal ","amalgcorp #8 ","able","Unknown","7","8.48","84.84" +"Books ","computers ","exportimaxi #3 ","ought","Unknown","2","2.11","78.47" +"Electronics ","stereo ","exportiamalgamalg #5 ","ought","Unknown","8","10.25","85.30" +"Books ","computers ","exportimaxi #3 ","ought","Unknown","10","3.58","78.47" +"Men ","shirts ","importoimporto #2 ","able","Unknown","2","123.49","198.12" +"Women ","dresses ","amalgamalg #2 ","ought","Unknown","6","179.26","253.74" +"Jewelry ","birdal ","amalgcorp #1 ","ought","Unknown","9","16.68","89.55" +"Books ","computers ","exportimaxi #3 ","able","Unknown","2","4.03","76.29" +"Electronics ","stereo ","exportiamalgamalg #5 ","ought","Unknown","11","13.36","85.30" +"Jewelry ","birdal ","amalgcorp #8 ","ought","Unknown","3","25.80","96.70" +"Sports ","football ","corpnameless #2 ","able","Unknown","9","40.63","110.64" +"Jewelry ","birdal ","amalgcorp #8 ","able","Unknown","3","15.51","84.84" +"Electronics ","stereo ","exportiamalgamalg #12 ","ought","Unknown","6","5.60","72.17" +"Books ","computers ","exportimaxi #5 ","able","Unknown","6","24.94","90.89" +"Electronics ","stereo ","exportiamalgamalg #6 ","able","Unknown","4","0.00","65.90" +"Books ","computers ","exportimaxi #2 ","able","Unknown","7","18.60","83.69" +"Electronics ","stereo ","exportiamalgamalg #12 ","ought","Unknown","5","8.43","72.17" +"Electronics ","stereo ","exportiamalgamalg #14 ","ought","Unknown","9","93.81","157.16" +"Books ","computers ","exportimaxi #3 ","able","Unknown","3","13.54","76.29" +"Electronics ","stereo ","exportiamalgamalg #12 ","ought","Unknown","11","9.44","72.17" +"Women ","dresses ","amalgamalg #2 ","able","Unknown","3","217.19","279.54" +"Electronics ","stereo ","exportiamalgamalg #6 ","able","Unknown","10","4.62","65.90" +"Electronics ","stereo ","exportiamalgamalg #6 ","able","Unknown","3","5.48","65.90" +"Electronics ","stereo ","exportiamalgamalg #5 ","able","Unknown","3","3.72","62.33" +"Electronics ","stereo ","exportiamalgamalg #5 ","able","Unknown","10","3.96","62.33" +"Electronics ","stereo ","exportiamalgamalg #16 ","able","Unknown","1","14.89","72.38" +"Sports ","football ","corpnameless #5 ","able","Unknown","7","33.27","90.73" +"Books ","computers ","exportimaxi #2 ","ought","Unknown","8","2.73","60.12" +"Men ","shirts ","importoimporto #2 ","able","Unknown","8","141.01","198.12" +"Electronics ","stereo ","exportiamalgamalg #12 ","able","Unknown","11","8.48","65.36" +"Electronics ","stereo ","exportiamalgamalg #16 ","able","Unknown","6","15.97","72.38" +"Electronics ","stereo ","exportiamalgamalg #6 ","ought","Unknown","1","11.44","67.50" +"Sports ","football ","corpnameless #2 ","able","Unknown","2","57.34","110.64" +"Jewelry ","birdal ","amalgcorp #1 ","able","Unknown","8","3.15","56.31" +"Books ","computers ","exportimaxi #2 ","able","Unknown","8","30.98","83.69" +"Jewelry ","birdal ","amalgcorp #1 ","able","Unknown","7","5.16","56.31" +"Electronics ","stereo ","exportiamalgamalg #16 ","able","Unknown","10","22.45","72.38" +"Electronics ","stereo ","exportiamalgamalg #12 ","able","Unknown","9","16.27","65.36" +"Books ","computers ","exportimaxi #9 ","ought","Unknown","1","1.02","49.90" +"Books ","computers ","exportimaxi #3 ","able","Unknown","4","27.45","76.29" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00090.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00090.sql new file mode 100644 index 00000000000..106349bf33c --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00090.sql @@ -0,0 +1,33 @@ +SELECT (CAST("amc" AS DECIMAL(15,4)) / CAST("pmc" + 0.001 AS DECIMAL(15,4))) "am_pm_ratio" +FROM + ( + SELECT "count"(*) "amc" + FROM + web_sales + , household_demographics + , time_dim + , web_page + WHERE ("ws_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ws_ship_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ws_web_page_sk" = "web_page"."wp_web_page_sk") + AND ("time_dim"."t_hour" BETWEEN 8 AND (8 + 1)) + AND ("household_demographics"."hd_dep_count" = 6) + AND ("web_page"."wp_char_count" BETWEEN 5000 AND 5200) +) "at" +, ( + SELECT "count"(*) "pmc" + FROM + web_sales + , household_demographics + , time_dim + , web_page + WHERE ("ws_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ws_ship_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ws_web_page_sk" = "web_page"."wp_web_page_sk") + AND ("time_dim"."t_hour" BETWEEN 19 AND (19 + 1)) + AND ("household_demographics"."hd_dep_count" = 6) + AND ("web_page"."wp_char_count" BETWEEN 5000 AND 5200) +) pt +ORDER BY "am_pm_ratio" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00090.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00090.txt new file mode 100644 index 00000000000..760b79b432b --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00090.txt @@ -0,0 +1 @@ +"0.0000" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00092.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00092.sql new file mode 100644 index 00000000000..c7bc7cc3f9b --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00092.sql @@ -0,0 +1,21 @@ +SELECT "sum"("ws_ext_discount_amt") "Excess Discount Amount" +FROM + web_sales +, item +, date_dim +WHERE ("i_manufact_id" = 350) + AND ("i_item_sk" = "ws_item_sk") + AND ("d_date" BETWEEN CAST('2000-01-27' AS DATE) AND (CAST('2000-01-27' AS DATE) + INTERVAL '90' DAY)) + AND ("d_date_sk" = "ws_sold_date_sk") + AND ("ws_ext_discount_amt" > ( + SELECT (DECIMAL '1.3' * "avg"("ws_ext_discount_amt")) + FROM + web_sales + , date_dim + WHERE ("ws_item_sk" = "i_item_sk") + AND ("d_date" BETWEEN CAST('2000-01-27' AS DATE) AND (CAST('2000-01-27' AS DATE) + INTERVAL '90' DAY)) + AND ("d_date_sk" = "ws_sold_date_sk") + )) +ORDER BY "sum"("ws_ext_discount_amt") ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00092.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00092.txt new file mode 100644 index 00000000000..3cc762b5501 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00092.txt @@ -0,0 +1 @@ +"" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00094.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00094.sql new file mode 100644 index 00000000000..a212e9d3d8a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00094.sql @@ -0,0 +1,31 @@ +SELECT + "count"(DISTINCT "ws_order_number") "order count" +, "sum"("ws_ext_ship_cost") "total shipping cost" +, "sum"("ws_net_profit") "total net profit" +FROM + web_sales ws1 +, date_dim +, customer_address +, web_site +WHERE ("d_date" BETWEEN CAST('1999-2-01' AS DATE) AND (CAST('1999-2-01' AS DATE) + INTERVAL '60' DAY)) + AND ("ws1"."ws_ship_date_sk" = "d_date_sk") + AND ("ws1"."ws_ship_addr_sk" = "ca_address_sk") + AND ("ca_state" = 'IL') + AND ("ws1"."ws_web_site_sk" = "web_site_sk") + AND ("web_company_name" = 'pri') + AND (EXISTS ( + SELECT * + FROM + web_sales ws2 + WHERE ("ws1"."ws_order_number" = "ws2"."ws_order_number") + AND ("ws1"."ws_warehouse_sk" <> "ws2"."ws_warehouse_sk") +)) + AND (NOT (EXISTS ( + SELECT * + FROM + web_returns wr1 + WHERE ("ws1"."ws_order_number" = "wr1"."wr_order_number") +))) +ORDER BY "count"(DISTINCT "ws_order_number") ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00094.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00094.txt new file mode 100644 index 00000000000..8afe38954de --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00094.txt @@ -0,0 +1 @@ +"0","","" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00095.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00095.sql new file mode 100644 index 00000000000..3e0b4943104 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00095.sql @@ -0,0 +1,42 @@ +WITH + ws_wh AS ( + SELECT + "ws1"."ws_order_number" + , "ws1"."ws_warehouse_sk" "wh1" + , "ws2"."ws_warehouse_sk" "wh2" + FROM + web_sales ws1 + , web_sales ws2 + WHERE ("ws1"."ws_order_number" = "ws2"."ws_order_number") + AND ("ws1"."ws_warehouse_sk" <> "ws2"."ws_warehouse_sk") +) +SELECT + "count"(DISTINCT "ws_order_number") "order count" +, "sum"("ws_ext_ship_cost") "total shipping cost" +, "sum"("ws_net_profit") "total net profit" +FROM + web_sales ws1 +, date_dim +, customer_address +, web_site +WHERE (CAST("d_date" AS DATE) BETWEEN CAST('1999-2-01' AS DATE) AND (CAST('1999-2-01' AS DATE) + INTERVAL '60' DAY)) + AND ("ws1"."ws_ship_date_sk" = "d_date_sk") + AND ("ws1"."ws_ship_addr_sk" = "ca_address_sk") + AND ("ca_state" = 'IL') + AND ("ws1"."ws_web_site_sk" = "web_site_sk") + AND ("web_company_name" = 'pri') + AND ("ws1"."ws_order_number" IN ( + SELECT "ws_order_number" + FROM + ws_wh +)) + AND ("ws1"."ws_order_number" IN ( + SELECT "wr_order_number" + FROM + web_returns + , ws_wh + WHERE ("wr_order_number" = "ws_wh"."ws_order_number") +)) +ORDER BY "count"(DISTINCT "ws_order_number") ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00095.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00095.txt new file mode 100644 index 00000000000..8afe38954de --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00095.txt @@ -0,0 +1 @@ +"0","","" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00096.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00096.sql new file mode 100644 index 00000000000..b5796bafe19 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00096.sql @@ -0,0 +1,16 @@ +SELECT "count"(*) +FROM + store_sales +, household_demographics +, time_dim +, store +WHERE ("ss_sold_time_sk" = "time_dim"."t_time_sk") + AND ("ss_hdemo_sk" = "household_demographics"."hd_demo_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("time_dim"."t_hour" = 20) + AND ("time_dim"."t_minute" >= 30) + AND ("household_demographics"."hd_dep_count" = 7) + AND ("store"."s_store_name" = 'ese') +ORDER BY "count"(*) ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00096.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00096.txt new file mode 100644 index 00000000000..1e4a3a34155 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00096.txt @@ -0,0 +1 @@ +"0" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00097.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00097.sql new file mode 100644 index 00000000000..752c8a22594 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00097.sql @@ -0,0 +1,36 @@ +WITH + ssci AS ( + SELECT + "ss_customer_sk" "customer_sk" + , "ss_item_sk" "item_sk" + FROM + store_sales + , date_dim + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + GROUP BY "ss_customer_sk", "ss_item_sk" +) +, csci AS ( + SELECT + "cs_bill_customer_sk" "customer_sk" + , "cs_item_sk" "item_sk" + FROM + catalog_sales + , date_dim + WHERE ("cs_sold_date_sk" = "d_date_sk") + AND ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + GROUP BY "cs_bill_customer_sk", "cs_item_sk" +) +SELECT + "sum"((CASE WHEN ("ssci"."customer_sk" IS NOT NULL) + AND ("csci"."customer_sk" IS NULL) THEN 1 ELSE 0 END)) "store_only" +, "sum"((CASE WHEN ("ssci"."customer_sk" IS NULL) + AND ("csci"."customer_sk" IS NOT NULL) THEN 1 ELSE 0 END)) "catalog_only" +, "sum"((CASE WHEN ("ssci"."customer_sk" IS NOT NULL) + AND ("csci"."customer_sk" IS NOT NULL) THEN 1 ELSE 0 END)) "store_and_catalog" +FROM + (ssci +FULL JOIN csci ON ("ssci"."customer_sk" = "csci"."customer_sk") + AND ("ssci"."item_sk" = "csci"."item_sk")) +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00097.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00097.txt new file mode 100644 index 00000000000..eca9d9a4aef --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00097.txt @@ -0,0 +1 @@ +"22255","16944","391" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00098.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00098.sql new file mode 100644 index 00000000000..72ddd155e9f --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00098.sql @@ -0,0 +1,19 @@ +SELECT + "i_item_id" +, "i_item_desc" +, "i_category" +, "i_class" +, "i_current_price" +, "sum"("ss_ext_sales_price") "itemrevenue" +, (("sum"("ss_ext_sales_price") * 100) / "sum"("sum"("ss_ext_sales_price")) OVER (PARTITION BY "i_class")) "revenueratio" +FROM + store_sales +, item +, date_dim +WHERE ("ss_item_sk" = "i_item_sk") + AND ("i_category" IN ('Sports', 'Books', 'Home')) + AND ("ss_sold_date_sk" = "d_date_sk") + AND (CAST("d_date" AS DATE) BETWEEN CAST('1999-02-22' AS DATE) AND (CAST('1999-02-22' AS DATE) + INTERVAL '30' DAY)) +GROUP BY "i_item_id", "i_item_desc", "i_category", "i_class", "i_current_price" +ORDER BY "i_category" ASC, "i_class" ASC, "i_item_id" ASC, "i_item_desc" ASC, "revenueratio" ASC +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00098.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00098.txt new file mode 100644 index 00000000000..353ce8a7f5e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00098.txt @@ -0,0 +1,190 @@ +"AAAAAAAACKEAAAAA","Legs appear eventually soci","Books ","arts ","35.27","3072.84","19.03" +"AAAAAAAAIJGAAAAA","Then western animals could teach somewhere. Today waiting servants confuse","Books ","arts ","4.10","6979.62","43.22" +"AAAAAAAAMFFAAAAA","Communities used to relocate clearly strange, new walls; european, rich championships make current depths. Sure studies may reflect only instinctively old forces. Foreign, diverse","Books ","arts ","8.22","496.91","3.08" +"AAAAAAAANIBAAAAA","Beneath decent wives write t","Books ","arts ","2.72","5600.40","34.68" +"AAAAAAAAADFAAAAA","Satisfactory, technical shadows get. Lexical structures would not blame. Only hard ","Books ","business ","78.25","1292.16","44.62" +"AAAAAAAALDFAAAAA","Hands may not allow only in a lands; linear, other pubs say; social, precise women identify for a patients. Preferences develop alone now rich motives. Ever good tas","Books ","business ","3.68","376.42","13.00" +"AAAAAAAAMKHAAAAA","Unions shall see enough over true attitudes; of course full variable","Books ","business ","8.90","1227.62","42.39" +"AAAAAAAAFEEAAAAA","Capital, united feelings paint only things. Greatly financial economies should not pay somewhere soviet necessary armies; educational concepts mus","Books ","computers ","3.83","4346.62","79.19" +"AAAAAAAAGMCAAAAA","More important names induce; now similar standards will train correctly times. Ex","Books ","computers ","9.23","32.24","0.59" +"AAAAAAAALCDAAAAA","Clearly actual places would supply apparently only rats.","Books ","computers ","4.34","911.40","16.61" +"AAAAAAAAMJEAAAAA","Local pro","Books ","computers ","1.04","13.42","0.24" +"AAAAAAAAOGFAAAAA","Real kids give rather lips. Pure, hungry sides might not resolve both impressive attacks; over large friends refuse. Guilty, sp","Books ","computers ","99.41","32.96","0.60" +"AAAAAAAAOMDAAAAA","Together hot rights ","Books ","computers ","4.99","151.92","2.77" +"AAAAAAAAGOCAAAAA","Historical, economic lights shall stand much big, odd proposals. Rather grateful branches ought to take. Northern, high miles must ask increasingly. Once chronic","Books ","cooking ","4.37","2218.58","40.51" +"AAAAAAAALIGAAAAA","There superb accidents may strike individual results. Quiet, only forests drop as little unlikely towns. Observations can discern with a points. Substantial banks dest","Books ","cooking ","0.88","3258.56","59.49" +"AAAAAAAAJKGAAAAA","Lights allow. Things go white, available ","Books ","entertainments ","4.92","4298.64","37.56" +"AAAAAAAAKDEAAAAA","Yet national bodies could answer on behalf of a hours. Features use later workers. Fortunes placa","Books ","entertainments ","6.46","4786.38","41.82" +"AAAAAAAAMKDAAAAA","Too big interests ought to go annually old real classes; little edges entail still electoral matters. Sure bonds make wonderful, central provisions. Internation","Books ","entertainments ","1.52","6.12","0.05" +"AAAAAAAAOOEAAAAA","Companies reveal national reforms; kinds initiate in a languages. Positive miles ought to hesitate thick priorities. Large, cons","Books ","entertainments ","1.45","2353.32","20.56" +"AAAAAAAABGAAAAAA","Quite different services promote all the same. Private, marginal colleagues play of course similar, different girls. French, local girls reap here. Bad movies shorten relatively. Terms","Books ","fiction ","57.09","1546.30","5.57" +"AAAAAAAACEFAAAAA","Important years participate indeed. Hands make so. Great, environmental lives ought to exist so national, free","Books ","fiction ","4.25","1490.76","5.37" +"AAAAAAAADEAAAAAA","So fair schools must go problems. Children should not paint in a photographs. Great, late senten","Books ","fiction ","1.47","563.68","2.03" +"AAAAAAAAHDDAAAAA","Remote, japanese things would not need at all","Books ","fiction ","45.99","4089.87","14.72" +"AAAAAAAAMLAAAAAA","Central, principal men a","Books ","fiction ","0.47","15303.53","55.08" +"AAAAAAAAOHHAAAAA","Private children used to stop really national, mate","Books ","fiction ","2.82","4486.44","16.15" +"AAAAAAAAPMBAAAAA","Exactly financial games may find effective, delight","Books ","fiction ","8.79","305.45","1.10" +"AAAAAAAAAMEAAAAA","Very, true women eat. Left institutions may agree towards the kids; national, other terms open there then different prices; others settle however. Apparently normal ","Books ","history ","9.64","1536.98","9.71" +"AAAAAAAAJGEAAAAA","Fully powerful qualities pinpoint thus movements. Domestic officers continue in a cases. Teachers shall introduce indeed other, good","Books ","history ","0.65","11159.55","70.48" +"AAAAAAAALAFAAAAA","New plants bring however on a years. Economic, british needs go of course. Children shall not benefit. Dangerous, whole patients ought to let. Camps shall not seek merely modest hearts. Hands like","Books ","history ","5.91","3097.22","19.56" +"AAAAAAAAOGGAAAAA","Temporary, beautiful negotiations carry holy, electric gentlemen. Else large fingers should sail museums. Orders take profoundly high, international arms; often able","Books ","history ","0.66","39.65","0.25" +"AAAAAAAAEIBAAAAA","Then human details","Books ","home repair ","0.82","5121.72","31.15" +"AAAAAAAAFDFAAAAA","All right used men must demand. Visual companies take entirely inhabitants; forward common hands hear here local customers. So traditional questions shal","Books ","home repair ","7.18","7854.80","47.78" +"AAAAAAAAGBEAAAAA","Later wonderful authorities must get famous terms. Articles shall vary to a shoulders. Exhibitions replace far good councillors. Feet can increase rarely later high sales. Open c","Books ","home repair ","2.10","2322.86","14.13" +"AAAAAAAAPNGAAAAA","Unusually small programmes would lift recently social, small workshops. Offices s","Books ","home repair ","1.73","1140.19","6.94" +"AAAAAAAAADCAAAAA","Nice knees help be","Books ","mystery ","1.55","7034.92","81.59" +"AAAAAAAAIGAAAAAA","Rapidly difficult films realize. Deep electronic parents calculate remaining affairs","Books ","mystery ","2.33","1586.86","18.41" +"AAAAAAAAEFEAAAAA","Considerations might make of course clear services. Political, beautiful germans can become in a contents; famous areas r","Books ","parenting ","2.15","3734.31","12.25" +"AAAAAAAAGFCAAAAA","Departmen","Books ","parenting ","2.09","143.84","0.47" +"AAAAAAAAIHFAAAAA","Significantly small suggestions will not come more new blue terms. Fundamentally previous soldiers understand alone huge contracts. Religious, professional miles must ap","Books ","parenting ","4.64","8119.86","26.64" +"AAAAAAAAJDHAAAAA","Continued ideas reflect only still other prices. Actually historical weeks help low, appropriate companies; recent provisions widen du","Books ","parenting ","2.16","2627.46","8.62" +"AAAAAAAAKHAAAAAA","Generally french beds will ask amounts. Difficult, difficult workers would come once again in a resources. So inc","Books ","parenting ","2.62","333.45","1.09" +"AAAAAAAANMAAAAAA","Over wide attacks agree i","Books ","parenting ","7.30","15520.51","50.92" +"AAAAAAAAAODAAAAA","Secondary, economic pupils loo","Books ","reference ","3.68","4509.25","25.99" +"AAAAAAAABLHAAAAA","Perhaps old sources disappear. Small, bright enterprises used to take by a systems. Local proteins could not try then. Blank, special colleges appear.","Books ","reference ","7.38","5187.60","29.90" +"AAAAAAAAEPBAAAAA","Potential materials form","Books ","reference ","6.28","2295.43","13.23" +"AAAAAAAAHFBAAAAA","Old places avoid certain, typical hands; here original arms see in a ideas. Good","Books ","reference ","38.26","139.06","0.80" +"AAAAAAAAHMGAAAAA","Words bear international, expected countries. Apparent, misleading years get ever rich grounds. Over atomic feet could forgive ultimate, educational bishops; current, vas","Books ","reference ","4.95","5181.05","29.86" +"AAAAAAAANJAAAAAA","Young, white workers may not wreck british, statistical explanations. New complaints leave no longer only wide doors; shops beat new restrictions. Horses must not test by now anonym","Books ","reference ","2.21","35.96","0.21" +"AAAAAAAABOBAAAAA","Old, revolutionary eyes may not serve fully by","Books ","romance ","2.38","4078.41","17.32" +"AAAAAAAALLDAAAAA","Personal days see large, important parents. Children ","Books ","romance ","90.72","5213.49","22.13" +"AAAAAAAAMOAAAAAA","Sympathetically scottish things should take regularly on a programmes. Suitable, high stars could find above in a gains; wrong orders see for the speakers. English, grand groups shall not m","Books ","romance ","0.75","3085.89","13.10" +"AAAAAAAAMPEAAAAA","Relations marry in a attacks. Prime books ma","Books ","romance ","2.81","1179.90","5.01" +"AAAAAAAANPDAAAAA","Years teach then at once right heads. Agencies will say by a suppliers. Most permanent blacks should not promote as other, legal eyes. Courses get so double, light flowers. Eastern, british times c","Books ","romance ","2.90","1208.79","5.13" +"AAAAAAAAOFHAAAAA","Simple, ideal images ought to stand accid","Books ","romance ","7.19","5120.18","21.74" +"AAAAAAAAOKCAAAAA","There welcome references must lower. Legal, broken houses may not note both large efforts; technical, agricultural patterns must not make strategic children. ","Books ","romance ","2.33","3667.30","15.57" +"AAAAAAAACDFAAAAA","Asleep, philos","Books ","science ","4.18","4210.68","16.12" +"AAAAAAAADAHAAAAA","Forces require more new examples. Also narrow students take files. Native, important objectives ought to release still legs. Difficulties might say mainly. Years","Books ","science ","2.33","6178.44","23.66" +"AAAAAAAADPEAAAAA","Catholic years st","Books ","science ","0.45","1941.03","7.43" +"AAAAAAAAIPFAAAAA","Extra, public branches shall list rather international police. Little v","Books ","science ","2.51","13787.91","52.79" +"AAAAAAAABJAAAAAA","Members begin together industrial, re","Books ","self-help ","59.77","6427.56","22.25" +"AAAAAAAAEMGAAAAA","Decent times will exist increasingly. Hospitals stand medical tears; families cover years. Foreign firms would","Books ","self-help ","27.81","10652.22","36.87" +"AAAAAAAAKGEAAAAA","There possible efforts might bring yet brief, kind days. Oddly white dangers could like maximum things. Hours might ","Books ","self-help ","9.23","10924.50","37.81" +"AAAAAAAAMPBAAAAA","Able, strong pictures understand especially. Similar years feed sometimes close, bri","Books ","self-help ","2.94","889.70","3.08" +"AAAAAAAADJEAAAAA","Specific, temporary goals take. Ideas might reduce economic authorities. Fundamentally external prayers matter really","Books ","travel ","84.79","68.46","5.07" +"AAAAAAAALCAAAAAA","Thus present women should hear for a shares; leaders must come early; immediate men will want exactly young groups. Insects may ask narrow variations. New leaders should deal ","Books ","travel ","6.08","23.66","1.75" +"AAAAAAAALFGAAAAA","Bc able groups shall vote ","Books ","travel ","3.95","1257.81","93.18" +"AAAAAAAAABDAAAAA","Goods mean so correct, legal systems. Just alternative banks tend then more concrete edges. Close, united chapters get only rus","Home ","accent ","1.06","13255.40","69.20" +"AAAAAAAACFHAAAAA","Asleep, regular month","Home ","accent ","0.91","36.72","0.19" +"AAAAAAAAEAGAAAAA","Dynamic, available memories may go abstract years; presumably high members stay faster industries. Offices give thus. Carers ought to pay well fields. Obvious","Home ","accent ","9.45","5864.04","30.61" +"AAAAAAAAADEAAAAA","Days stick fairly big, integrated women. Much other fortunes ought to work so to the losses. Subsidies take ","Home ","bathroom ","2.57","1322.75","80.29" +"AAAAAAAAHBFAAAAA","Dollars prove everywhere o","Home ","bathroom ","7.89","324.76","19.71" +"AAAAAAAAAOGAAAAA","Foreign, good things must get eyes. Low, thin members must rest. International looks allow. Senses should not touch. Limited, single backs would not walk opportunities; high","Home ","bedding ","3.51","323.62","3.73" +"AAAAAAAAEKDAAAAA","Now short views cannot include. Real, northern interests may build. Fresh","Home ","bedding ","1.78","3564.00","41.04" +"AAAAAAAAHHCAAAAA","Old, cultural workers ought to take both now everyday budgets. Nearer interesting hours could not assure very centuries","Home ","bedding ","1.65","567.29","6.53" +"AAAAAAAAMDFAAAAA","Black, old things prove. Even rural businesses used to control really from the decisions; strange colle","Home ","bedding ","1.79","3171.62","36.52" +"AAAAAAAAMPFAAAAA","Clear artists stay so that is limited causes; innocent, unusual claims make to a horses. Concerns will see almost in a centres. Seriously great maste","Home ","bedding ","79.19","1057.08","12.17" +"AAAAAAAACAFAAAAA","Catholic, favorite interests may decide agents. Extraordinary office","Home ","blinds/shades ","29.09","26.45","0.53" +"AAAAAAAAGHDAAAAA","In common academic pupils know highly joint sites. Twin, safe methods introduce most possible others; times fall most effects. Highest parliamentary performances used ","Home ","blinds/shades ","6.97","125.51","2.51" +"AAAAAAAAIJFAAAAA","Nice things would coincide still satisfactory students. Now oth","Home ","blinds/shades ","1.08","234.90","4.69" +"AAAAAAAAPOCAAAAA","Bishops could confirm; rates rot very pp.. Prisoners will want old countries. Too po","Home ","blinds/shades ","3.71","4621.50","92.28" +"AAAAAAAAAIAAAAAA","Wrong limits could not accompany now perhaps lonely customers. Anxious, neighbouring principles might arise molecules. Useful, short nerves think advantages. Angry, parental prices fly t","Home ","curtains/drapes ","4.06","452.08","3.31" +"AAAAAAAAGKDAAAAA","More expensive men used to become most current offices. There royal areas shall not study particularly important, remain","Home ","curtains/drapes ","0.46","7439.43","54.43" +"AAAAAAAAINFAAAAA","Much trying boys play really seconds. Clear cases cannot stop only so social types. Areas see ","Home ","curtains/drapes ","5.48","4826.08","35.31" +"AAAAAAAAMMBAAAAA","Boys might not work yet then fast clothes. Simply large elements think in a factors. Royal charges happen at least on a children. Holy prospects think individu","Home ","curtains/drapes ","8.88","950.80","6.96" +"AAAAAAAABJGAAAAA","Radical degrees may hear just. Christian terms disguise quickly rows. Bad, semantic companies want. Clear, perfect dogs please years. Cells sho","Home ","decor ","2.87","68.31","0.19" +"AAAAAAAADJHAAAAA","Immediate police face now on a cu","Home ","decor ","8.34","418.95","1.17" +"AAAAAAAAJNGAAAAA","Boys measure else towns. Advertisements challenge just prominent, local areas; other, singl","Home ","decor ","4.49","4660.74","13.00" +"AAAAAAAAKPGAAAAA","Just direct bills co-ordinate by a troops. Clothes belong old, essent","Home ","decor ","4.76","2639.28","7.36" +"AAAAAAAALLGAAAAA","Pp. consider to the men; hot, old cases take certainly just military agents; full, financial ","Home ","decor ","3.23","4139.74","11.54" +"AAAAAAAAMBEAAAAA","Clearly local bars put still. ","Home ","decor ","0.69","4565.24","12.73" +"AAAAAAAAMOFAAAAA","Political shares become then firmly english men. Hardly young police ","Home ","decor ","1.89","10348.40","28.86" +"AAAAAAAAPBDAAAAA","Clear, top associations can activate all national factors. Items could think sure skills. Fine, thin classes must not help simply only statutory","Home ","decor ","6.27","9018.37","25.15" +"AAAAAAAAANDAAAAA","Beautiful areas know ever actually chief patterns. International, simple feelings like in a russians. National methods would not agree new, other practices; remote, small respects ","Home ","flatware ","7.13","249.21","2.13" +"AAAAAAAABNCAAAAA","Criminal companies may emerge sometimes children. Urban, other efforts dominate policies. Very right fans drive briti","Home ","flatware ","9.67","1682.10","14.35" +"AAAAAAAAEBGAAAAA","Police should not expect material, acceptable shares. Houses should not hold alread","Home ","flatware ","6.97","142.00","1.21" +"AAAAAAAAEGBAAAAA","So clear layers mean by the losses. Rules will seem now with a companies. Successful, corporate reasons might knock then final resources. C","Home ","flatware ","7.82","6845.68","58.42" +"AAAAAAAAMCDAAAAA","Other, british benefits begin over about the participants. Legal, short contracts receive for a procedures. Openly unlikely countries need both planes. Lines should not get very ago historical ","Home ","flatware ","9.51","790.86","6.75" +"AAAAAAAANMDAAAAA","Major, spanish limits cover too in the group","Home ","flatware ","2.03","956.35","8.16" +"AAAAAAAAODFAAAAA","Illegal, beautiful points know forward in a banks. Here good details should last today key doctors. Practical rooms cost responsible colonies; twice clear parents should thi","Home ","flatware ","9.22","1051.78","8.98" +"AAAAAAAAABBAAAAA","Ways share electronic benefits. Just effective groups repeat social relations. Always coming deaths would treat so ideas. Effective, grand patterns would hold more. Capable feet","Home ","furniture ","1.71","8680.00","31.06" +"AAAAAAAAABEAAAAA","Now good legs find from the ideas. Available courts must risk eventually more complex strangers. Sections","Home ","furniture ","8.76","3222.78","11.53" +"AAAAAAAAABGAAAAA","Otherwise suitable products consider too technical techniques; common women spend quickly assessments; chemical habits develop more. Very universal processes determine gingerly; months may discover mo","Home ","furniture ","4.64","1357.89","4.86" +"AAAAAAAAAFDAAAAA","New relations should get ideal shapes. Revolutionary settings forget however soviet institutions. Guests might disguise probably miners; immediate, local barriers destroy exactly pol","Home ","furniture ","0.85","1545.83","5.53" +"AAAAAAAACBBAAAAA","Guns provide changes. Ago new references used to accompany on the eyes. Forward supreme patients cannot ask real, spiritual channels. Interest","Home ","furniture ","4.69","1085.70","3.89" +"AAAAAAAAFNBAAAAA","Happy laws sit on the powers. Quickly convenient newspapers ","Home ","furniture ","0.16","942.30","3.37" +"AAAAAAAAKHFAAAAA","Subsequent, serious gene","Home ","furniture ","4.93","686.85","2.46" +"AAAAAAAAMDHAAAAA","Asleep rights continue over papers. Yesterday poor combinations ought to like votes. Hardly similar manufacturers used to see groups. Rel","Home ","furniture ","65.51","9141.00","32.71" +"AAAAAAAAONEAAAAA","Social, young days guide presumably. Somehow old servants return so","Home ","furniture ","2.18","1279.08","4.58" +"AAAAAAAAEAEAAAAA","Here able guns would not win main, independent vessels. Pleasant, white pounds know recordings. At least possible characters see also for a races. British, clear ","Home ","glassware ","9.50","9274.69","58.98" +"AAAAAAAAGLFAAAAA","Extremely level sources hear; months make less above common materials. Main, unpleasant parts allow workers. Foreign, yellow interests go teeth. Academic yards would not ","Home ","glassware ","2.84","6201.36","39.44" +"AAAAAAAAOOAAAAAA","High, japanese terms recapture far from tightly similar sections; widespread, romantic teeth shall sort so elabo","Home ","glassware ","2.39","249.40","1.59" +"AAAAAAAAEHFAAAAA","Actively fair matches will like even; brit","Home ","kids ","3.14","2787.70","80.72" +"AAAAAAAALPCAAAAA","Sorts might think full birds. New packages shall exceed sad arrangements. Problems cannot come together other employees.","Home ","kids ","1.54","555.17","16.08" +"AAAAAAAAPHAAAAAA","Private islands will complete large homes. Parts illustrate most in a operations; labour games could not use. Leaders feel. New groups shall not devote too pale characteristics. Mad thanks may not ","Home ","kids ","3.66","110.70","3.21" +"AAAAAAAAGKBAAAAA","As other folk can remain quickly methods. Easy, othe","Home ","lighting ","1.87","5860.72","85.04" +"AAAAAAAALBBAAAAA","New, labour players must start subsequently magnetic values. Dark problems laugh; accountants","Home ","lighting ","9.13","647.36","9.39" +"AAAAAAAALBEAAAAA","Proposed facilities might prefer. Pages can go appropriate, friendly titles. Doctors m","Home ","lighting ","48.57","220.56","3.20" +"AAAAAAAAOJAAAAAA","General personnel should take by the pictures; personal, ol","Home ","lighting ","9.17","162.86","2.36" +"AAAAAAAAALGAAAAA","Native, old flowers focus as temporary, remarkable levels. Daily, new men hold please mysterious groups; controls see already. Enough similar figures ach","Home ","mattresses ","4.48","559.04","90.43" +"AAAAAAAAMJHAAAAA","Officials calculate in the images. Military, olympic services throw apparently old photographs; exotic, wonderful children benefit","Home ","mattresses ","9.36","59.15","9.57" +"AAAAAAAAGCDAAAAA","Subsequently full views add still considerable changes. Extra names suffer conservatives. So odd hours work just real standard","Home ","paint ","2.01","9656.49","42.83" +"AAAAAAAAKDGAAAAA","Issues work to a solutions. Other, environmental heroes shall not develop still strong problems; very, male proportions should become. Good habits ought to gain simply on a pl","Home ","paint ","36.48","741.65","3.29" +"AAAAAAAAKOBAAAAA","Modern men would not ask girls. Often p","Home ","paint ","6.55","266.44","1.18" +"AAAAAAAAMGFAAAAA","Straight, immediate parents help more than reso","Home ","paint ","7.56","416.13","1.85" +"AAAAAAAANAGAAAAA","Managers may not come slightly possible occasions; naked, organisational goods could pull. Things put much little, experimental mistakes. Healthy, cruel hours acknowledge red doubts. Citie","Home ","paint ","7.24","1819.68","8.07" +"AAAAAAAANIHAAAAA","Social shows appeal largely once more african clothes. Single, current groups feel somewhat courses. National aspects find minutes. Now real farmers would talk in a assu","Home ","paint ","4.89","9643.56","42.78" +"AAAAAAAAHKFAAAAA","Friends tell. Living times should no","Home ","rugs ","4.43","1850.58","20.52" +"AAAAAAAAJMHAAAAA","Eye","Home ","rugs ","2.18","7142.10","79.18" +"AAAAAAAAKECAAAAA","High publishers can exclude certain stars. Too i","Home ","rugs ","87.61","27.15","0.30" +"AAAAAAAAAEDAAAAA","Today previous months address. Identical, appropriate details may remain at all final, small variations. So middle","Home ","tables ","7.16","5259.24","70.13" +"AAAAAAAAIKHAAAAA","Pictures cannot get advantages. Roman, difficult issues shift easy. Guidelines rouse just all actual hours. Coherent, main days acknowledge forward previous ","Home ","tables ","0.48","2240.42","29.87" +"AAAAAAAAAICAAAAA","Urgent, simple cases may not help. Industrial, other pp. reverse as a schools. Asleep, free systems make then more available discussions. Soci","Home ","wallpaper ","4.82","2609.43","39.77" +"AAAAAAAAGCFAAAAA","Hard british units see so different communities.","Home ","wallpaper ","8.17","1978.86","30.16" +"AAAAAAAAKABAAAAA","Groups may not find only for a ","Home ","wallpaper ","8.59","632.96","9.65" +"AAAAAAAAMNDAAAAA","Successful, warm employers can show easily true, handsome brothers. Bad, great men return great, linguistic gardens. Both political tra","Home ","wallpaper ","4.16","1340.30","20.43" +"AAAAAAAADCFAAAAA","Quick, sad situations might leave ","Sports ","archery ","6.79","3855.72","40.92" +"AAAAAAAAEFCAAAAA","Eligible, stupid attitudes used to protect so. Alone, good sciences concentrate suddenly liable eyes. Revolutionary students should punch f","Sports ","archery ","0.35","550.16","5.84" +"AAAAAAAAMNGAAAAA","Nice organs exceed apart sure areas. Adult, islamic christians identify then with a countries. Happ","Sports ","archery ","4.80","4531.95","48.09" +"AAAAAAAAPIFAAAAA","Very short foundations would work as. Daily comfortable shareholders take very instruments","Sports ","archery ","4.72","485.66","5.15" +"AAAAAAAACPAAAAAA","Industrial, delighted sounds can kill further regional, personal vegetables; both real companies will experiment once minimum, overall leaders. Difficult, helpful supporters shoul","Sports ","athletic shoes ","1.76","46.02","0.65" +"AAAAAAAAGAEAAAAA","Rather able men set important, young hands. Never dangerous stages can see only here public fingers. Already unique police shall sleep certain styl","Sports ","athletic shoes ","6.16","6020.59","85.04" +"AAAAAAAAGEHAAAAA","Details design well with th","Sports ","athletic shoes ","3.01","1013.12","14.31" +"AAAAAAAAGBHAAAAA","Now political hills used to look channels. Memories keep much. Charges manage just ever holy criteri","Sports ","baseball ","3.07","3175.92","100.00" +"AAAAAAAAAAHAAAAA","Likely doctors give most. Awful problems att","Sports ","basketball ","2.16","11616.20","99.16" +"AAAAAAAACBFAAAAA","Following, true criteria used to look pretty net days. Other plans need clearly. Dee","Sports ","basketball ","1.19","98.67","0.84" +"AAAAAAAAAIDAAAAA","Systems would not send more faithfully easy ministers. Conditions penetrate vulnerable questions. Most regular parts create well german commentators. Odd difficulties mus","Sports ","camping ","3.26","7205.44","52.24" +"AAAAAAAAFLGAAAAA","Super bodies enable in the interests. Dull years understand so diffe","Sports ","camping ","5.38","990.76","7.18" +"AAAAAAAAKKAAAAAA","Broad members see accurately guilty, public thanks; others meet close slowly sophisticated difficulties. Trees can search more large chains. ","Sports ","camping ","1.65","1987.04","14.41" +"AAAAAAAAKLCAAAAA","Disastrous, other concessions surprise heavy cars; now economic homes place; sudden, social results may get raw, just publications. Only awful condition","Sports ","camping ","2.43","3342.11","24.23" +"AAAAAAAAOKEAAAAA","Roman lines talk children. Parties account exactly toward","Sports ","camping ","4.28","268.62","1.95" +"AAAAAAAACNCAAAAA","Already other elements will not matter statistically others. Guns ex","Sports ","fishing ","3.38","328.09","3.85" +"AAAAAAAAEDGAAAAA","Only expected governments used to describe; institutions can make bad, industrial years. Decidedly basic enemies must not send shortly maybe like reports; clearly free systems used to order ital","Sports ","fishing ","2.45","4925.72","57.76" +"AAAAAAAAOBBAAAAA","Boundaries make however foreign days. Eventually new centres would not see well. Personally giant dreams represent services. Much perfect steps vis","Sports ","fishing ","1.21","766.08","8.98" +"AAAAAAAAPBAAAAAA","So new campaigns teach more straight early indians. International offices shake actual ministers. New, liable theories can see expenses. Nice, imperial teams wo","Sports ","fishing ","8.48","2507.39","29.40" +"AAAAAAAAANEAAAAA","Temperatures reflect quite","Sports ","fitness ","0.90","0.00","0.00" +"AAAAAAAACNEAAAAA","Horses last results. There thorough parents sail everywhere into a gua","Sports ","fitness ","3.45","11512.30","96.08" +"AAAAAAAAICDAAAAA","Other votes should hear rather","Sports ","fitness ","7.42","469.25","3.92" +"AAAAAAAAMDEAAAAA","Today british hills include p","Sports ","football ","0.52","1412.00","38.78" +"AAAAAAAAOHEAAAAA","Absolutely front men turn spatial hours. Good, free sales used to marry outside appropriate ships. Noble men sa","Sports ","football ","1.83","2229.50","61.22" +"AAAAAAAABIHAAAAA","Profitable documents would apply now. Literary, nuclear magazines might run general, proposed details. C","Sports ","golf ","4.18","1774.24","9.36" +"AAAAAAAADICAAAAA","Members become so poor peri","Sports ","golf ","32.36","2615.00","13.80" +"AAAAAAAAJDEAAAAA","Economic, impressive thoughts will not neglect. Strong, serious records should capture o","Sports ","golf ","8.11","11450.35","60.42" +"AAAAAAAAKJEAAAAA","Clearly conservative children could not moderate with a decisions. As good as important track","Sports ","golf ","7.66","3112.83","16.42" +"AAAAAAAACJGAAAAA","Clear types buy years. Companies used to go already. Stable, general arrangements will accept purely light","Sports ","guns ","7.02","17.44","0.29" +"AAAAAAAAMEHAAAAA","So married arts must not land somewhat. Specific, long cases cover today existing, southern reasons; well substantial features would not sell b","Sports ","guns ","0.86","4584.58","76.95" +"AAAAAAAAOODAAAAA","Above ships can upset before public children; however sharp consumers may not see great pounds. Environme","Sports ","guns ","6.00","1356.12","22.76" +"AAAAAAAADLCAAAAA","Recent, french conservatives cannot get somehow; decisions save accordingly happy thousands. Seriously good years argue then golden attacks. Just wide eyes drink underground likely, fin","Sports ","hockey ","0.09","0.00","0.00" +"AAAAAAAAHLEAAAAA","Serious, social teams could not take also other, blind designers. Clear groups would find ot","Sports ","hockey ","7.00","40.68","20.06" +"AAAAAAAALEEAAAAA","Terms cannot enc","Sports ","hockey ","5.90","162.09","79.94" +"AAAAAAAAAEAAAAAA","Both new conditions ask acute, ashamed pupils. Short, poor fami","Sports ","optics ","2.02","6049.62","19.10" +"AAAAAAAABKCAAAAA","Of course heavy persons get now implications. Phases show even. So old women develop; big, other jeans drive frantically official shots. Facts might disturb too new, gentle children. G","Sports ","optics ","0.79","14965.85","47.26" +"AAAAAAAACBHAAAAA","Extra, lesser arms formulate as deaths. Important, ","Sports ","optics ","2.15","7465.32","23.57" +"AAAAAAAACCGAAAAA","Large assets trust even; individuals record formal, short t","Sports ","optics ","7.78","1063.54","3.36" +"AAAAAAAADFFAAAAA","Necessary, social bedrooms think so full poles; babies prove now. Profitable payments used to break there. Major, radical households ","Sports ","optics ","1.51","91.52","0.29" +"AAAAAAAAINEAAAAA","Perhaps busy institutions can appear now future, tall times. Secondary, warm problems would stimulate more ","Sports ","optics ","3.09","1311.80","4.14" +"AAAAAAAAMFAAAAAA","Employers w","Sports ","optics ","4.48","722.40","2.28" +"AAAAAAAAAKHAAAAA","Key names make somewhere. Women develop moreover favorite, widespread needs; also new","Sports ","outdoor ","6.76","2790.40","12.44" +"AAAAAAAACGAAAAAA","Opportunities clear there. Basic rules ask british locations. More financial visits construct other funds. Unk","Sports ","outdoor ","3.16","178.02","0.79" +"AAAAAAAAEMDAAAAA","Dry troops may say far legal branches. Women remember for a bacteria. Poles can pass away stages. Grounds might not ask now famous ambitions. Only public dates need soon.","Sports ","outdoor ","4.66","1224.72","5.46" +"AAAAAAAAGDFAAAAA","Longer usual findings afford yet. As willing other","Sports ","outdoor ","1.75","1680.85","7.49" +"AAAAAAAAILGAAAAA","Uncomfortable users should pursue already social conditions. Either national friends may not reject now per ","Sports ","outdoor ","5.25","3900.69","17.38" +"AAAAAAAALLAAAAAA","Patients could learn then fund","Sports ","outdoor ","0.79","12046.26","53.68" +"AAAAAAAAPNAAAAAA","Regular, bad memories might","Sports ","outdoor ","5.87","618.78","2.76" +"AAAAAAAACLDAAAAA","Desperate activities increase likely judges. Standards may not make national, fatal courses. Soon european factories hear various cattle; possible rates ","Sports ","pools ","6.33","11893.07","60.82" +"AAAAAAAAGLCAAAAA","Educational groups","Sports ","pools ","0.70","1431.60","7.32" +"AAAAAAAAGMFAAAAA","Fields generate. Universities get honest, fixed locations. Possible requirements might not see ideas. Communications visit continuous others. Stor","Sports ","pools ","1.76","5647.75","28.88" +"AAAAAAAAOFEAAAAA","Financial, unknown features could regard really. Desirable, hard glasses go fast friends. Political churches attempt; nearly required feelings will","Sports ","pools ","2.34","581.75","2.98" +"AAAAAAAAEIFAAAAA","New girls reach exactly; only additional students wil","Sports ","sailing ","3.94","2224.89","100.00" +"AAAAAAAAALCAAAAA","Now new goods get outstanding, surprising changes; almost new advertisements pay successful, concerned member","Sports ","tennis ","2.87","234.36","67.43" +"AAAAAAAAOKHAAAAA","So british cases could not know hard. Grateful, single drugs should not get secondly international levels. Considerations used to connect governments. Exact men get at a patients. Yesterday good men s","Sports ","tennis ","19.51","113.20","32.57" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00099.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00099.sql new file mode 100644 index 00000000000..87eae676e33 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00099.sql @@ -0,0 +1,27 @@ +SELECT + "substr"("w_warehouse_name", 1, 20) +, "sm_type" +, "cc_name" +, "sum"((CASE WHEN (("cs_ship_date_sk" - "cs_sold_date_sk") <= 30) THEN 1 ELSE 0 END)) "30 days" +, "sum"((CASE WHEN (("cs_ship_date_sk" - "cs_sold_date_sk") > 30) + AND (("cs_ship_date_sk" - "cs_sold_date_sk") <= 60) THEN 1 ELSE 0 END)) "31-60 days" +, "sum"((CASE WHEN (("cs_ship_date_sk" - "cs_sold_date_sk") > 60) + AND (("cs_ship_date_sk" - "cs_sold_date_sk") <= 90) THEN 1 ELSE 0 END)) "61-90 days" +, "sum"((CASE WHEN (("cs_ship_date_sk" - "cs_sold_date_sk") > 90) + AND (("cs_ship_date_sk" - "cs_sold_date_sk") <= 120) THEN 1 ELSE 0 END)) "91-120 days" +, "sum"((CASE WHEN (("cs_ship_date_sk" - "cs_sold_date_sk") > 120) THEN 1 ELSE 0 END)) ">120 days" +FROM + catalog_sales +, warehouse +, ship_mode +, call_center +, date_dim +WHERE ("d_month_seq" BETWEEN 1200 AND (1200 + 11)) + AND ("cs_ship_date_sk" = "d_date_sk") + AND ("cs_warehouse_sk" = "w_warehouse_sk") + AND ("cs_ship_mode_sk" = "sm_ship_mode_sk") + AND ("cs_call_center_sk" = "cc_call_center_sk") +GROUP BY "substr"("w_warehouse_name", 1, 20), "sm_type", "cc_name" +ORDER BY "substr"("w_warehouse_name", 1, 20) ASC, "sm_type" ASC, "cc_name" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00099.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00099.txt new file mode 100644 index 00000000000..15e79aa6522 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/00099.txt @@ -0,0 +1,12 @@ +"Conventional childr","EXPRESS ","Mid Atlantic","520","567","562","0","0" +"Conventional childr","EXPRESS ","NY Metro","590","679","571","0","0" +"Conventional childr","LIBRARY ","Mid Atlantic","378","420","457","0","0" +"Conventional childr","LIBRARY ","NY Metro","426","474","442","0","0" +"Conventional childr","NEXT DAY ","Mid Atlantic","544","570","581","0","0" +"Conventional childr","NEXT DAY ","NY Metro","596","656","597","0","0" +"Conventional childr","OVERNIGHT ","Mid Atlantic","393","431","446","0","0" +"Conventional childr","OVERNIGHT ","NY Metro","497","456","424","0","0" +"Conventional childr","REGULAR ","Mid Atlantic","396","432","418","0","0" +"Conventional childr","REGULAR ","NY Metro","462","463","454","0","0" +"Conventional childr","TWO DAY ","Mid Atlantic","386","453","439","0","0" +"Conventional childr","TWO DAY ","NY Metro","467","476","450","0","0" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/catalog_mysql_cleanup.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/catalog_mysql_cleanup.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/catalog_mysql_prepare.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/catalog_mysql_prepare.sql new file mode 100644 index 00000000000..7942ef6a49e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/catalog_mysql_prepare.sql @@ -0,0 +1,547 @@ +call gravitino.system.create_catalog( + 'gt_mysql', + 'jdbc-mysql', + map( + array['jdbc-url', 'jdbc-user', 'jdbc-password', 'jdbc-driver', 'cloud.region-code', 'cloud.trino.connection-url', 'cloud.trino.connection-user'], + array['${mysql_uri}/?useSSL=false', 'trino', 'ds123', 'com.mysql.cj.jdbc.Driver', 'c2', '${trino_remote_jdbc_uri}', 'admin'] + ) +); + +call gravitino.system.create_catalog( + 'gt_mysql_1', + 'jdbc-mysql', + map( + array['jdbc-url', 'jdbc-user', 'jdbc-password', 'jdbc-driver'], + array['${mysql_uri}/?useSSL=false', 'trino', 'ds123', 'com.mysql.cj.jdbc.Driver'] + ) +); + +show catalogs; + +create schema gt_mysql_1.gt_tpcds; +use gt_mysql_1.gt_tpcds; + +CREATE TABLE call_center ( + cc_call_center_sk bigint, + cc_call_center_id char(16), + cc_rec_start_date date, + cc_rec_end_date date, + cc_closed_date_sk integer, + cc_open_date_sk integer, + cc_name varchar(50), + cc_class varchar(50), + cc_employees integer, + cc_sq_ft integer, + cc_hours char(20), + cc_manager varchar(40), + cc_mkt_id integer, + cc_mkt_class char(50), + cc_mkt_desc varchar(100), + cc_market_manager varchar(40), + cc_division integer, + cc_division_name varchar(50), + cc_company integer, + cc_company_name char(50), + cc_street_number char(10), + cc_street_name varchar(60), + cc_street_type char(15), + cc_suite_number char(10), + cc_city varchar(60), + cc_county varchar(30), + cc_state char(2), + cc_zip char(10), + cc_country varchar(20), + cc_gmt_offset decimal(5, 2), + cc_tax_percentage decimal(5, 2) +); + +CREATE TABLE catalog_page ( + cp_catalog_page_sk bigint, + cp_catalog_page_id char(16), + cp_start_date_sk integer, + cp_end_date_sk integer, + cp_department varchar(50), + cp_catalog_number integer, + cp_catalog_page_number integer, + cp_description varchar(100), + cp_type varchar(100) +); + +CREATE TABLE catalog_returns ( + cr_returned_date_sk bigint, + cr_returned_time_sk bigint, + cr_item_sk bigint, + cr_refunded_customer_sk bigint, + cr_refunded_cdemo_sk bigint, + cr_refunded_hdemo_sk bigint, + cr_refunded_addr_sk bigint, + cr_returning_customer_sk bigint, + cr_returning_cdemo_sk bigint, + cr_returning_hdemo_sk bigint, + cr_returning_addr_sk bigint, + cr_call_center_sk bigint, + cr_catalog_page_sk bigint, + cr_ship_mode_sk bigint, + cr_warehouse_sk bigint, + cr_reason_sk bigint, + cr_order_number bigint, + cr_return_quantity integer, + cr_return_amount decimal(7, 2), + cr_return_tax decimal(7, 2), + cr_return_amt_inc_tax decimal(7, 2), + cr_fee decimal(7, 2), + cr_return_ship_cost decimal(7, 2), + cr_refunded_cash decimal(7, 2), + cr_reversed_charge decimal(7, 2), + cr_store_credit decimal(7, 2), + cr_net_loss decimal(7, 2) +); + +CREATE TABLE catalog_sales ( + cs_sold_date_sk bigint, + cs_sold_time_sk bigint, + cs_ship_date_sk bigint, + cs_bill_customer_sk bigint, + cs_bill_cdemo_sk bigint, + cs_bill_hdemo_sk bigint, + cs_bill_addr_sk bigint, + cs_ship_customer_sk bigint, + cs_ship_cdemo_sk bigint, + cs_ship_hdemo_sk bigint, + cs_ship_addr_sk bigint, + cs_call_center_sk bigint, + cs_catalog_page_sk bigint, + cs_ship_mode_sk bigint, + cs_warehouse_sk bigint, + cs_item_sk bigint, + cs_promo_sk bigint, + cs_order_number bigint, + cs_quantity integer, + cs_wholesale_cost decimal(7, 2), + cs_list_price decimal(7, 2), + cs_sales_price decimal(7, 2), + cs_ext_discount_amt decimal(7, 2), + cs_ext_sales_price decimal(7, 2), + cs_ext_wholesale_cost decimal(7, 2), + cs_ext_list_price decimal(7, 2), + cs_ext_tax decimal(7, 2), + cs_coupon_amt decimal(7, 2), + cs_ext_ship_cost decimal(7, 2), + cs_net_paid decimal(7, 2), + cs_net_paid_inc_tax decimal(7, 2), + cs_net_paid_inc_ship decimal(7, 2), + cs_net_paid_inc_ship_tax decimal(7, 2), + cs_net_profit decimal(7, 2) +); + +CREATE TABLE customer ( + c_customer_sk bigint, + c_customer_id char(16), + c_current_cdemo_sk bigint, + c_current_hdemo_sk bigint, + c_current_addr_sk bigint, + c_first_shipto_date_sk bigint, + c_first_sales_date_sk bigint, + c_salutation char(10), + c_first_name char(20), + c_last_name char(30), + c_preferred_cust_flag char(1), + c_birth_day integer, + c_birth_month integer, + c_birth_year integer, + c_birth_country varchar(20), + c_login char(13), + c_email_address char(50), + c_last_review_date_sk bigint +); + +CREATE TABLE customer_address ( + ca_address_sk bigint, + ca_address_id char(16), + ca_street_number char(10), + ca_street_name varchar(60), + ca_street_type char(15), + ca_suite_number char(10), + ca_city varchar(60), + ca_county varchar(30), + ca_state char(2), + ca_zip char(10), + ca_country varchar(20), + ca_gmt_offset decimal(5, 2), + ca_location_type char(20) +); + +CREATE TABLE customer_demographics ( + cd_demo_sk bigint, + cd_gender char(1), + cd_marital_status char(1), + cd_education_status char(20), + cd_purchase_estimate integer, + cd_credit_rating char(10), + cd_dep_count integer, + cd_dep_employed_count integer, + cd_dep_college_count integer +); + + CREATE TABLE date_dim ( + d_date_sk bigint, + d_date_id char(16), + d_date date, + d_month_seq integer, + d_week_seq integer, + d_quarter_seq integer, + d_year integer, + d_dow integer, + d_moy integer, + d_dom integer, + d_qoy integer, + d_fy_year integer, + d_fy_quarter_seq integer, + d_fy_week_seq integer, + d_day_name char(9), + d_quarter_name char(6), + d_holiday char(1), + d_weekend char(1), + d_following_holiday char(1), + d_first_dom integer, + d_last_dom integer, + d_same_day_ly integer, + d_same_day_lq integer, + d_current_day char(1), + d_current_week char(1), + d_current_month char(1), + d_current_quarter char(1), + d_current_year char(1) + ); + +CREATE TABLE household_demographics ( + hd_demo_sk bigint, + hd_income_band_sk bigint, + hd_buy_potential char(15), + hd_dep_count integer, + hd_vehicle_count integer +); + +CREATE TABLE income_band ( + ib_income_band_sk bigint, + ib_lower_bound integer, + ib_upper_bound integer +); + +CREATE TABLE inventory ( + inv_date_sk bigint, + inv_item_sk bigint, + inv_warehouse_sk bigint, + inv_quantity_on_hand integer +); + +CREATE TABLE item ( + i_item_sk bigint, + i_item_id char(16), + i_rec_start_date date, + i_rec_end_date date, + i_item_desc varchar(200), + i_current_price decimal(7, 2), + i_wholesale_cost decimal(7, 2), + i_brand_id integer, + i_brand char(50), + i_class_id integer, + i_class char(50), + i_category_id integer, + i_category char(50), + i_manufact_id integer, + i_manufact char(50), + i_size char(20), + i_formulation char(20), + i_color char(20), + i_units char(10), + i_container char(10), + i_manager_id integer, + i_product_name char(50) +); + +CREATE TABLE promotion ( + p_promo_sk bigint, + p_promo_id char(16), + p_start_date_sk bigint, + p_end_date_sk bigint, + p_item_sk bigint, + p_cost decimal(15, 2), + p_response_targe integer, + p_promo_name char(50), + p_channel_dmail char(1), + p_channel_email char(1), + p_channel_catalog char(1), + p_channel_tv char(1), + p_channel_radio char(1), + p_channel_press char(1), + p_channel_event char(1), + p_channel_demo char(1), + p_channel_details varchar(100), + p_purpose char(15), + p_discount_active char(1) +); + +CREATE TABLE reason ( + r_reason_sk bigint, + r_reason_id char(16), + r_reason_desc char(100) +); + +CREATE TABLE ship_mode ( + sm_ship_mode_sk bigint, + sm_ship_mode_id char(16), + sm_type char(30), + sm_code char(10), + sm_carrier char(20), + sm_contract char(20) +); + +CREATE TABLE store ( + s_store_sk bigint, + s_store_id char(16), + s_rec_start_date date, + s_rec_end_date date, + s_closed_date_sk bigint, + s_store_name varchar(50), + s_number_employees integer, + s_floor_space integer, + s_hours char(20), + s_manager varchar(40), + s_market_id integer, + s_geography_class varchar(100), + s_market_desc varchar(100), + s_market_manager varchar(40), + s_division_id integer, + s_division_name varchar(50), + s_company_id integer, + s_company_name varchar(50), + s_street_number varchar(10), + s_street_name varchar(60), + s_street_type char(15), + s_suite_number char(10), + s_city varchar(60), + s_county varchar(30), + s_state char(2), + s_zip char(10), + s_country varchar(20), + s_gmt_offset decimal(5, 2), + s_tax_precentage decimal(5, 2) +); + +CREATE TABLE store_returns ( + sr_returned_date_sk bigint, + sr_return_time_sk bigint, + sr_item_sk bigint, + sr_customer_sk bigint, + sr_cdemo_sk bigint, + sr_hdemo_sk bigint, + sr_addr_sk bigint, + sr_store_sk bigint, + sr_reason_sk bigint, + sr_ticket_number bigint, + sr_return_quantity integer, + sr_return_amt decimal(7, 2), + sr_return_tax decimal(7, 2), + sr_return_amt_inc_tax decimal(7, 2), + sr_fee decimal(7, 2), + sr_return_ship_cost decimal(7, 2), + sr_refunded_cash decimal(7, 2), + sr_reversed_charge decimal(7, 2), + sr_store_credit decimal(7, 2), + sr_net_loss decimal(7, 2) +); + +CREATE TABLE store_sales ( + ss_sold_date_sk bigint, + ss_sold_time_sk bigint, + ss_item_sk bigint, + ss_customer_sk bigint, + ss_cdemo_sk bigint, + ss_hdemo_sk bigint, + ss_addr_sk bigint, + ss_store_sk bigint, + ss_promo_sk bigint, + ss_ticket_number bigint, + ss_quantity integer, + ss_wholesale_cost decimal(7, 2), + ss_list_price decimal(7, 2), + ss_sales_price decimal(7, 2), + ss_ext_discount_amt decimal(7, 2), + ss_ext_sales_price decimal(7, 2), + ss_ext_wholesale_cost decimal(7, 2), + ss_ext_list_price decimal(7, 2), + ss_ext_tax decimal(7, 2), + ss_coupon_amt decimal(7, 2), + ss_net_paid decimal(7, 2), + ss_net_paid_inc_tax decimal(7, 2), + ss_net_profit decimal(7, 2) +); + +CREATE TABLE time_dim ( + t_time_sk bigint, + t_time_id char(16), + t_time integer, + t_hour integer, + t_minute integer, + t_second integer, + t_am_pm char(2), + t_shift char(20), + t_sub_shift char(20), + t_meal_time char(20) +); + +CREATE TABLE warehouse ( + w_warehouse_sk bigint, + w_warehouse_id char(16), + w_warehouse_name varchar(20), + w_warehouse_sq_ft integer, + w_street_number char(10), + w_street_name varchar(60), + w_street_type char(15), + w_suite_number char(10), + w_city varchar(60), + w_county varchar(30), + w_state char(2), + w_zip char(10), + w_country varchar(20), + w_gmt_offset decimal(5, 2) +); + +CREATE TABLE web_page ( + wp_web_page_sk bigint, + wp_web_page_id char(16), + wp_rec_start_date date, + wp_rec_end_date date, + wp_creation_date_sk bigint, + wp_access_date_sk bigint, + wp_autogen_flag char(1), + wp_customer_sk bigint, + wp_url varchar(100), + wp_type char(50), + wp_char_count integer, + wp_link_count integer, + wp_image_count integer, + wp_max_ad_count integer +); + +CREATE TABLE web_returns ( + wr_returned_date_sk bigint, + wr_returned_time_sk bigint, + wr_item_sk bigint, + wr_refunded_customer_sk bigint, + wr_refunded_cdemo_sk bigint, + wr_refunded_hdemo_sk bigint, + wr_refunded_addr_sk bigint, + wr_returning_customer_sk bigint, + wr_returning_cdemo_sk bigint, + wr_returning_hdemo_sk bigint, + wr_returning_addr_sk bigint, + wr_web_page_sk bigint, + wr_reason_sk bigint, + wr_order_number bigint, + wr_return_quantity integer, + wr_return_amt decimal(7, 2), + wr_return_tax decimal(7, 2), + wr_return_amt_inc_tax decimal(7, 2), + wr_fee decimal(7, 2), + wr_return_ship_cost decimal(7, 2), + wr_refunded_cash decimal(7, 2), + wr_reversed_charge decimal(7, 2), + wr_account_credit decimal(7, 2), + wr_net_loss decimal(7, 2) +); + +CREATE TABLE web_sales ( + ws_sold_date_sk bigint, + ws_sold_time_sk bigint, + ws_ship_date_sk bigint, + ws_item_sk bigint, + ws_bill_customer_sk bigint, + ws_bill_cdemo_sk bigint, + ws_bill_hdemo_sk bigint, + ws_bill_addr_sk bigint, + ws_ship_customer_sk bigint, + ws_ship_cdemo_sk bigint, + ws_ship_hdemo_sk bigint, + ws_ship_addr_sk bigint, + ws_web_page_sk bigint, + ws_web_site_sk bigint, + ws_ship_mode_sk bigint, + ws_warehouse_sk bigint, + ws_promo_sk bigint, + ws_order_number bigint, + ws_quantity integer, + ws_wholesale_cost decimal(7, 2), + ws_list_price decimal(7, 2), + ws_sales_price decimal(7, 2), + ws_ext_discount_amt decimal(7, 2), + ws_ext_sales_price decimal(7, 2), + ws_ext_wholesale_cost decimal(7, 2), + ws_ext_list_price decimal(7, 2), + ws_ext_tax decimal(7, 2), + ws_coupon_amt decimal(7, 2), + ws_ext_ship_cost decimal(7, 2), + ws_net_paid decimal(7, 2), + ws_net_paid_inc_tax decimal(7, 2), + ws_net_paid_inc_ship decimal(7, 2), + ws_net_paid_inc_ship_tax decimal(7, 2), + ws_net_profit decimal(7, 2) +); + +CREATE TABLE web_site ( + web_site_sk bigint, + web_site_id char(16), + web_rec_start_date date, + web_rec_end_date date, + web_name varchar(50), + web_open_date_sk bigint, + web_close_date_sk bigint, + web_class varchar(50), + web_manager varchar(40), + web_mkt_id integer, + web_mkt_class varchar(50), + web_mkt_desc varchar(100), + web_market_manager varchar(40), + web_company_id integer, + web_company_name char(50), + web_street_number char(10), + web_street_name varchar(60), + web_street_type char(15), + web_suite_number char(10), + web_city varchar(60), + web_county varchar(30), + web_state char(2), + web_zip char(10), + web_country varchar(20), + web_gmt_offset decimal(5, 2), + web_tax_percentage decimal(5, 2) +); + +insert into call_center select * from tpcds.tiny.call_center; +insert into catalog_page select * from tpcds.tiny.catalog_page; +insert into catalog_returns select * from tpcds.tiny.catalog_returns; +insert into catalog_sales select * from tpcds.tiny.catalog_sales; +insert into customer select * from tpcds.tiny.customer; +insert into customer_address select * from tpcds.tiny.customer_address; +insert into customer_demographics select * from tpcds.tiny.customer_demographics; +insert into date_dim select * from tpcds.tiny.date_dim; +insert into household_demographics select * from tpcds.tiny.household_demographics; +insert into income_band select * from tpcds.tiny.income_band; +insert into inventory select * from tpcds.tiny.inventory; +insert into item select * from tpcds.tiny.item; +insert into promotion select * from tpcds.tiny.promotion; +insert into reason select * from tpcds.tiny.reason; +insert into ship_mode select * from tpcds.tiny.ship_mode; +insert into store select * from tpcds.tiny.store; +insert into store_returns select * from tpcds.tiny.store_returns; +insert into store_sales select * from tpcds.tiny.store_sales; +insert into time_dim select * from tpcds.tiny.time_dim; +insert into warehouse select * from tpcds.tiny.warehouse; +insert into web_page select * from tpcds.tiny.web_page; +insert into web_returns select * from tpcds.tiny.web_returns; +insert into web_sales select * from tpcds.tiny.web_sales; +insert into web_site select * from tpcds.tiny.web_site; + + +use gt_mysql.gt_tpcds; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00008.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00008.sql new file mode 100644 index 00000000000..2e6abc88a32 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00008.sql @@ -0,0 +1,442 @@ +SELECT + "s_store_name" +, "sum"("ss_net_profit") +FROM + store_sales +, date_dim +, store +, ( + SELECT "ca_zip" + FROM + ( +( + SELECT "substr"("ca_zip", 1, 5) "ca_zip" + FROM + customer_address + WHERE ("substr"("ca_zip", 1, 5) IN ( + '24128' + , '57834' + , '13354' + , '15734' + , '78668' + , '76232' + , '62878' + , '45375' + , '63435' + , '22245' + , '65084' + , '49130' + , '40558' + , '25733' + , '15798' + , '87816' + , '81096' + , '56458' + , '35474' + , '27156' + , '83926' + , '18840' + , '28286' + , '24676' + , '37930' + , '77556' + , '27700' + , '45266' + , '94627' + , '62971' + , '20548' + , '23470' + , '47305' + , '53535' + , '21337' + , '26231' + , '50412' + , '69399' + , '17879' + , '51622' + , '43848' + , '21195' + , '83921' + , '15559' + , '67853' + , '15126' + , '16021' + , '26233' + , '53268' + , '10567' + , '91137' + , '76107' + , '11101' + , '59166' + , '38415' + , '61265' + , '71954' + , '15371' + , '11928' + , '15455' + , '98294' + , '68309' + , '69913' + , '59402' + , '58263' + , '25782' + , '18119' + , '35942' + , '33282' + , '42029' + , '17920' + , '98359' + , '15882' + , '45721' + , '60279' + , '18426' + , '64544' + , '25631' + , '43933' + , '37125' + , '98235' + , '10336' + , '24610' + , '68101' + , '56240' + , '40081' + , '86379' + , '44165' + , '33515' + , '88190' + , '84093' + , '27068' + , '99076' + , '36634' + , '50308' + , '28577' + , '39736' + , '33786' + , '71286' + , '26859' + , '55565' + , '98569' + , '70738' + , '19736' + , '64457' + , '17183' + , '28915' + , '26653' + , '58058' + , '89091' + , '54601' + , '24206' + , '14328' + , '55253' + , '82136' + , '67897' + , '56529' + , '72305' + , '67473' + , '62377' + , '22752' + , '57647' + , '62496' + , '41918' + , '36233' + , '86284' + , '54917' + , '22152' + , '19515' + , '63837' + , '18376' + , '42961' + , '10144' + , '36495' + , '58078' + , '38607' + , '91110' + , '64147' + , '19430' + , '17043' + , '45200' + , '63981' + , '48425' + , '22351' + , '30010' + , '21756' + , '14922' + , '14663' + , '77191' + , '60099' + , '29741' + , '36420' + , '21076' + , '91393' + , '28810' + , '96765' + , '23006' + , '18799' + , '49156' + , '98025' + , '23932' + , '67467' + , '30450' + , '50298' + , '29178' + , '89360' + , '32754' + , '63089' + , '87501' + , '87343' + , '29839' + , '30903' + , '81019' + , '18652' + , '73273' + , '25989' + , '20260' + , '68893' + , '53179' + , '30469' + , '28898' + , '31671' + , '24996' + , '18767' + , '64034' + , '91068' + , '51798' + , '51200' + , '63193' + , '39516' + , '72550' + , '72325' + , '51211' + , '23968' + , '86057' + , '10390' + , '85816' + , '45692' + , '65164' + , '21309' + , '18845' + , '68621' + , '92712' + , '68880' + , '90257' + , '47770' + , '13955' + , '70466' + , '21286' + , '67875' + , '82636' + , '36446' + , '79994' + , '72823' + , '40162' + , '41367' + , '41766' + , '22437' + , '58470' + , '11356' + , '76638' + , '68806' + , '25280' + , '67301' + , '73650' + , '86198' + , '16725' + , '38935' + , '13394' + , '61810' + , '81312' + , '15146' + , '71791' + , '31016' + , '72013' + , '37126' + , '22744' + , '73134' + , '70372' + , '30431' + , '39192' + , '35850' + , '56571' + , '67030' + , '22461' + , '88424' + , '88086' + , '14060' + , '40604' + , '19512' + , '72175' + , '51649' + , '19505' + , '24317' + , '13375' + , '81426' + , '18270' + , '72425' + , '45748' + , '55307' + , '53672' + , '52867' + , '56575' + , '39127' + , '30625' + , '10445' + , '39972' + , '74351' + , '26065' + , '83849' + , '42666' + , '96976' + , '68786' + , '77721' + , '68908' + , '66864' + , '63792' + , '51650' + , '31029' + , '26689' + , '66708' + , '11376' + , '20004' + , '31880' + , '96451' + , '41248' + , '94898' + , '18383' + , '60576' + , '38193' + , '48583' + , '13595' + , '76614' + , '24671' + , '46820' + , '82276' + , '10516' + , '11634' + , '45549' + , '88885' + , '18842' + , '90225' + , '18906' + , '13376' + , '84935' + , '78890' + , '58943' + , '15765' + , '50016' + , '69035' + , '49448' + , '39371' + , '41368' + , '33123' + , '83144' + , '14089' + , '94945' + , '73241' + , '19769' + , '47537' + , '38122' + , '28587' + , '76698' + , '22927' + , '56616' + , '34425' + , '96576' + , '78567' + , '97789' + , '94983' + , '79077' + , '57855' + , '97189' + , '46081' + , '48033' + , '19849' + , '28488' + , '28545' + , '72151' + , '69952' + , '43285' + , '26105' + , '76231' + , '15723' + , '25486' + , '39861' + , '83933' + , '75691' + , '46136' + , '61547' + , '66162' + , '25858' + , '22246' + , '51949' + , '27385' + , '77610' + , '34322' + , '51061' + , '68100' + , '61860' + , '13695' + , '44438' + , '90578' + , '96888' + , '58048' + , '99543' + , '73171' + , '56691' + , '64528' + , '56910' + , '83444' + , '30122' + , '68014' + , '14171' + , '16807' + , '83041' + , '34102' + , '51103' + , '79777' + , '17871' + , '12305' + , '22685' + , '94167' + , '28709' + , '35258' + , '57665' + , '71256' + , '57047' + , '11489' + , '31387' + , '68341' + , '78451' + , '14867' + , '25103' + , '35458' + , '25003' + , '54364' + , '73520' + , '32213' + , '35576')) + ) INTERSECT ( + SELECT "ca_zip" + FROM + ( + SELECT + "substr"("ca_zip", 1, 5) "ca_zip" + , "count"(*) "cnt" + FROM + customer_address + , customer + WHERE ("ca_address_sk" = "c_current_addr_sk") + AND ("c_preferred_cust_flag" = 'Y') + GROUP BY "ca_zip" + HAVING ("count"(*) > 10) + ) a1 + ) ) a2 +) v1 +WHERE ("ss_store_sk" = "s_store_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_qoy" = 2) + AND ("d_year" = 1998) + AND ("substr"("s_zip", 1, 2) = "substr"("v1"."ca_zip", 1, 2)) +GROUP BY "s_store_name" +ORDER BY "s_store_name" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00008.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00008.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00010.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00010.sql new file mode 100644 index 00000000000..ccad4e31545 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00010.sql @@ -0,0 +1,56 @@ +SELECT + "cd_gender" +, "cd_marital_status" +, "cd_education_status" +, "count"(*) "cnt1" +, "cd_purchase_estimate" +, "count"(*) "cnt2" +, "cd_credit_rating" +, "count"(*) "cnt3" +, "cd_dep_count" +, "count"(*) "cnt4" +, "cd_dep_employed_count" +, "count"(*) "cnt5" +, "cd_dep_college_count" +, "count"(*) "cnt6" +FROM + customer c +, customer_address ca +, customer_demographics +WHERE ("c"."c_current_addr_sk" = "ca"."ca_address_sk") + AND ("ca_county" IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')) + AND ("cd_demo_sk" = "c"."c_current_cdemo_sk") + AND (EXISTS ( + SELECT * + FROM + store_sales + , date_dim + WHERE ("c"."c_customer_sk" = "ss_customer_sk") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2002) + AND ("d_moy" BETWEEN 1 AND (1 + 3)) +)) + AND ((EXISTS ( + SELECT * + FROM + web_sales + , date_dim + WHERE ("c"."c_customer_sk" = "ws_bill_customer_sk") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2002) + AND ("d_moy" BETWEEN 1 AND (1 + 3)) + )) + OR (EXISTS ( + SELECT * + FROM + catalog_sales + , date_dim + WHERE ("c"."c_customer_sk" = "cs_ship_customer_sk") + AND ("cs_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2002) + AND ("d_moy" BETWEEN 1 AND (1 + 3)) + ))) +GROUP BY "cd_gender", "cd_marital_status", "cd_education_status", "cd_purchase_estimate", "cd_credit_rating", "cd_dep_count", "cd_dep_employed_count", "cd_dep_college_count" +ORDER BY "cd_gender" ASC, "cd_marital_status" ASC, "cd_education_status" ASC, "cd_purchase_estimate" ASC, "cd_credit_rating" ASC, "cd_dep_count" ASC, "cd_dep_employed_count" ASC, "cd_dep_college_count" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00010.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00010.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00024.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00024.sql new file mode 100644 index 00000000000..e0265e304e9 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00024.sql @@ -0,0 +1,47 @@ +WITH + ssales AS ( + SELECT + "c_last_name" + , "c_first_name" + , "s_store_name" + , "ca_state" + , "s_state" + , "i_color" + , "i_current_price" + , "i_manager_id" + , "i_units" + , "i_size" + , "sum"("ss_net_paid") "netpaid" + FROM + store_sales + , store_returns + , store + , item + , customer + , customer_address + WHERE ("ss_ticket_number" = "sr_ticket_number") + AND ("ss_item_sk" = "sr_item_sk") + AND ("ss_customer_sk" = "c_customer_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("ss_store_sk" = "s_store_sk") + AND ("c_birth_country" = "upper"("ca_country")) + AND ("s_zip" = "ca_zip") + AND ("s_market_id" = 8) + GROUP BY "c_last_name", "c_first_name", "s_store_name", "ca_state", "s_state", "i_color", "i_current_price", "i_manager_id", "i_units", "i_size" +) +SELECT + "c_last_name" +, "c_first_name" +, "s_store_name" +, "sum"("netpaid") "paid" +FROM + ssales +WHERE ("i_color" = 'pale') +GROUP BY "c_last_name", "c_first_name", "s_store_name" +HAVING ("sum"("netpaid") > ( + SELECT (DECIMAL '0.05' * "avg"("netpaid")) + FROM + ssales + )) +ORDER BY "c_last_name", "c_first_name", "s_store_name" +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00024.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00024.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00031.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00031.sql new file mode 100644 index 00000000000..c41deddefcd --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00031.sql @@ -0,0 +1,64 @@ +WITH + ss AS ( + SELECT + "ca_county" + , "d_qoy" + , "d_year" + , "sum"("ss_ext_sales_price") "store_sales" + FROM + store_sales + , date_dim + , customer_address + WHERE ("ss_sold_date_sk" = "d_date_sk") + AND ("ss_addr_sk" = "ca_address_sk") + GROUP BY "ca_county", "d_qoy", "d_year" +) +, ws AS ( + SELECT + "ca_county" + , "d_qoy" + , "d_year" + , "sum"("ws_ext_sales_price") "web_sales" + FROM + web_sales + , date_dim + , customer_address + WHERE ("ws_sold_date_sk" = "d_date_sk") + AND ("ws_bill_addr_sk" = "ca_address_sk") + GROUP BY "ca_county", "d_qoy", "d_year" +) +SELECT + "ss1"."ca_county" +, "ss1"."d_year" +, ("ws2"."web_sales" / "ws1"."web_sales") "web_q1_q2_increase" +, ("ss2"."store_sales" / "ss1"."store_sales") "store_q1_q2_increase" +, ("ws3"."web_sales" / "ws2"."web_sales") "web_q2_q3_increase" +, ("ss3"."store_sales" / "ss2"."store_sales") "store_q2_q3_increase" +FROM + ss ss1 +, ss ss2 +, ss ss3 +, ws ws1 +, ws ws2 +, ws ws3 +WHERE ("ss1"."d_qoy" = 1) + AND ("ss1"."d_year" = 2000) + AND ("ss1"."ca_county" = "ss2"."ca_county") + AND ("ss2"."d_qoy" = 2) + AND ("ss2"."d_year" = 2000) + AND ("ss2"."ca_county" = "ss3"."ca_county") + AND ("ss3"."d_qoy" = 3) + AND ("ss3"."d_year" = 2000) + AND ("ss1"."ca_county" = "ws1"."ca_county") + AND ("ws1"."d_qoy" = 1) + AND ("ws1"."d_year" = 2000) + AND ("ws1"."ca_county" = "ws2"."ca_county") + AND ("ws2"."d_qoy" = 2) + AND ("ws2"."d_year" = 2000) + AND ("ws1"."ca_county" = "ws3"."ca_county") + AND ("ws3"."d_qoy" = 3) + AND ("ws3"."d_year" = 2000) + AND ((CASE WHEN ("ws1"."web_sales" > 0) THEN (CAST("ws2"."web_sales" AS DECIMAL(38,3)) / "ws1"."web_sales") ELSE null END) > (CASE WHEN ("ss1"."store_sales" > 0) THEN (CAST("ss2"."store_sales" AS DECIMAL(38,3)) / "ss1"."store_sales") ELSE null END)) + AND ((CASE WHEN ("ws2"."web_sales" > 0) THEN (CAST("ws3"."web_sales" AS DECIMAL(38,3)) / "ws2"."web_sales") ELSE null END) > (CASE WHEN ("ss2"."store_sales" > 0) THEN (CAST("ss3"."store_sales" AS DECIMAL(38,3)) / "ss2"."store_sales") ELSE null END)) +ORDER BY "ss1"."ca_county" ASC +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00031.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00031.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00037.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00037.sql new file mode 100644 index 00000000000..ca2fce12fc2 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00037.sql @@ -0,0 +1,20 @@ +SELECT + "i_item_id" +, "i_item_desc" +, "i_current_price" +FROM + item +, inventory +, date_dim +, catalog_sales +WHERE ("i_current_price" BETWEEN 68 AND (68 + 30)) + AND ("inv_item_sk" = "i_item_sk") + AND ("d_date_sk" = "inv_date_sk") + AND (CAST("d_date" AS DATE) BETWEEN CAST('2000-02-01' AS DATE) AND (CAST('2000-02-01' AS DATE) + INTERVAL '60' DAY)) + AND ("i_manufact_id" IN (677, 940, 694, 808)) + AND ("inv_quantity_on_hand" BETWEEN 100 AND 500) + AND ("cs_item_sk" = "i_item_sk") +GROUP BY "i_item_id", "i_item_desc", "i_current_price" +ORDER BY "i_item_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00037.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00037.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00039.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00039.sql new file mode 100644 index 00000000000..44f3655f007 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00039.sql @@ -0,0 +1,53 @@ +WITH + inv AS ( + SELECT + "w_warehouse_name" + , "w_warehouse_sk" + , "i_item_sk" + , "d_moy" + , "stdev" + , "mean" + , (CASE "mean" WHEN 0 THEN null ELSE ("stdev" / "mean") END) "cov" + FROM + ( + SELECT + "w_warehouse_name" + , "w_warehouse_sk" + , "i_item_sk" + , "d_moy" + , "stddev_samp"("inv_quantity_on_hand") "stdev" + , "avg"("inv_quantity_on_hand") "mean" + FROM + inventory + , item + , warehouse + , date_dim + WHERE ("inv_item_sk" = "i_item_sk") + AND ("inv_warehouse_sk" = "w_warehouse_sk") + AND ("inv_date_sk" = "d_date_sk") + AND ("d_year" = 2001) + GROUP BY "w_warehouse_name", "w_warehouse_sk", "i_item_sk", "d_moy" + ) foo + WHERE ((CASE "mean" WHEN 0 THEN 0 ELSE ("stdev" / "mean") END) > 1) +) +SELECT + "inv1"."w_warehouse_sk" +, "inv1"."i_item_sk" +, "inv1"."d_moy" +, "inv1"."mean" +, CAST("inv1"."cov" AS DECIMAL(30, 10)) -- decrease precision to avoid unstable results due to roundings +, "inv2"."w_warehouse_sk" +, "inv2"."i_item_sk" +, "inv2"."d_moy" +, "inv2"."mean" +, CAST("inv2"."cov" AS DECIMAL(30, 10)) -- decrease precision to avoid unstable results due to roundings +FROM + inv inv1 +, inv inv2 +WHERE ("inv1"."i_item_sk" = "inv2"."i_item_sk") + AND ("inv1"."w_warehouse_sk" = "inv2"."w_warehouse_sk") + AND ("inv1"."d_moy" = 1) + AND ("inv2"."d_moy" = (1 + 1)) + AND ("inv1"."cov" > DECIMAL '1.5') +ORDER BY "inv1"."w_warehouse_sk" ASC, "inv1"."i_item_sk" ASC, "inv1"."d_moy" ASC, "inv1"."mean" ASC, "inv1"."cov" ASC, "inv2"."d_moy" ASC, "inv2"."mean" ASC, "inv2"."cov" ASC +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00039.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00039.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00041.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00041.sql new file mode 100644 index 00000000000..b582ff11ce3 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00041.sql @@ -0,0 +1,70 @@ +SELECT DISTINCT "i_product_name" +FROM + item i1 +WHERE ("i_manufact_id" BETWEEN 738 AND (738 + 40)) + AND (( + SELECT "count"(*) "item_cnt" + FROM + item + WHERE (("i_manufact" = "i1"."i_manufact") + AND ((("i_category" = 'Women') + AND (("i_color" = 'powder') + OR ("i_color" = 'khaki')) + AND (("i_units" = 'Ounce') + OR ("i_units" = 'Oz')) + AND (("i_size" = 'medium') + OR ("i_size" = 'extra large'))) + OR (("i_category" = 'Women') + AND (("i_color" = 'brown') + OR ("i_color" = 'honeydew')) + AND (("i_units" = 'Bunch') + OR ("i_units" = 'Ton')) + AND (("i_size" = 'N/A') + OR ("i_size" = 'small'))) + OR (("i_category" = 'Men') + AND (("i_color" = 'floral') + OR ("i_color" = 'deep')) + AND (("i_units" = 'N/A') + OR ("i_units" = 'Dozen')) + AND (("i_size" = 'petite') + OR ("i_size" = 'large'))) + OR (("i_category" = 'Men') + AND (("i_color" = 'light') + OR ("i_color" = 'cornflower')) + AND (("i_units" = 'Box') + OR ("i_units" = 'Pound')) + AND (("i_size" = 'medium') + OR ("i_size" = 'extra large'))))) + OR (("i_manufact" = "i1"."i_manufact") + AND ((("i_category" = 'Women') + AND (("i_color" = 'midnight') + OR ("i_color" = 'snow')) + AND (("i_units" = 'Pallet') + OR ("i_units" = 'Gross')) + AND (("i_size" = 'medium') + OR ("i_size" = 'extra large'))) + OR (("i_category" = 'Women') + AND (("i_color" = 'cyan') + OR ("i_color" = 'papaya')) + AND (("i_units" = 'Cup') + OR ("i_units" = 'Dram')) + AND (("i_size" = 'N/A') + OR ("i_size" = 'small'))) + OR (("i_category" = 'Men') + AND (("i_color" = 'orange') + OR ("i_color" = 'frosted')) + AND (("i_units" = 'Each') + OR ("i_units" = 'Tbl')) + AND (("i_size" = 'petite') + OR ("i_size" = 'large'))) + OR (("i_category" = 'Men') + AND (("i_color" = 'forest') + OR ("i_color" = 'ghost')) + AND (("i_units" = 'Lb') + OR ("i_units" = 'Bundle')) + AND (("i_size" = 'medium') + OR ("i_size" = 'extra large'))))) + ) > 0) +ORDER BY "i_product_name" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00041.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00041.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00044.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00044.sql new file mode 100644 index 00000000000..c7b24b47e38 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00044.sql @@ -0,0 +1,71 @@ +SELECT + "asceding"."rnk" +, "i1"."i_product_name" "best_performing" +, "i2"."i_product_name" "worst_performing" +FROM + ( + SELECT * + FROM + ( + SELECT + "item_sk" + , "rank"() OVER (ORDER BY "rank_col" ASC) "rnk" + FROM + ( + SELECT + "ss_item_sk" "item_sk" + , "avg"("ss_net_profit") "rank_col" + FROM + store_sales ss1 + WHERE ("ss_store_sk" = 4) + GROUP BY "ss_item_sk" + HAVING ("avg"("ss_net_profit") > (DECIMAL '0.9' * ( + SELECT "avg"("ss_net_profit") "rank_col" + FROM + store_sales + WHERE ("ss_store_sk" = 4) + AND ("ss_addr_sk" IS NULL) + GROUP BY "ss_store_sk" + ))) + ) v1 + ) v11 + WHERE ("rnk" < 11) +) asceding +, ( + SELECT * + FROM + ( + SELECT + "item_sk" + , "rank"() OVER (ORDER BY "rank_col" DESC) "rnk" + FROM + ( + SELECT + "ss_item_sk" "item_sk" + , "avg"("ss_net_profit") "rank_col" + FROM + store_sales ss1 + WHERE ("ss_store_sk" = 4) + GROUP BY "ss_item_sk" + HAVING ("avg"("ss_net_profit") > (DECIMAL '0.9' * ( + SELECT "avg"("ss_net_profit") "rank_col" + FROM + store_sales + WHERE ("ss_store_sk" = 4) + AND ("ss_addr_sk" IS NULL) + GROUP BY "ss_store_sk" + ))) + ) v2 + ) v21 + WHERE ("rnk" < 11) +) descending +, item i1 +, item i2 +WHERE ("asceding"."rnk" = "descending"."rnk") + AND ("i1"."i_item_sk" = "asceding"."item_sk") + AND ("i2"."i_item_sk" = "descending"."item_sk") +ORDER BY "asceding"."rnk" ASC, + -- additional columns to assure results stability for larger scale factors. this is a deviation from TPC-DS specification + "i1"."i_product_name" ASC, "i2"."i_product_name" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00044.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00044.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00054.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00054.sql new file mode 100644 index 00000000000..a3e2910e53a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00054.sql @@ -0,0 +1,76 @@ +WITH + my_customers AS ( + SELECT DISTINCT + "c_customer_sk" + , "c_current_addr_sk" + FROM + ( + SELECT + "cs_sold_date_sk" "sold_date_sk" + , "cs_bill_customer_sk" "customer_sk" + , "cs_item_sk" "item_sk" + FROM + catalog_sales +UNION ALL SELECT + "ws_sold_date_sk" "sold_date_sk" + , "ws_bill_customer_sk" "customer_sk" + , "ws_item_sk" "item_sk" + FROM + web_sales + ) cs_or_ws_sales + , item + , date_dim + , customer + WHERE ("sold_date_sk" = "d_date_sk") + AND ("item_sk" = "i_item_sk") + AND ("i_category" = 'Women') + AND ("i_class" = 'maternity') + AND ("c_customer_sk" = "cs_or_ws_sales"."customer_sk") + AND ("d_moy" = 12) + AND ("d_year" = 1998) +) +, my_revenue AS ( + SELECT + "c_customer_sk" + , "sum"("ss_ext_sales_price") "revenue" + FROM + my_customers + , store_sales + , customer_address + , store + , date_dim + WHERE ("c_current_addr_sk" = "ca_address_sk") + AND ("ca_county" = "s_county") + AND ("ca_state" = "s_state") + AND ("ss_sold_date_sk" = "d_date_sk") + AND ("c_customer_sk" = "ss_customer_sk") + AND ("d_month_seq" BETWEEN ( + SELECT DISTINCT ("d_month_seq" + 1) + FROM + date_dim + WHERE ("d_year" = 1998) + AND ("d_moy" = 12) + ) AND ( + SELECT DISTINCT ("d_month_seq" + 3) + FROM + date_dim + WHERE ("d_year" = 1998) + AND ("d_moy" = 12) + )) + GROUP BY "c_customer_sk" +) +, segments AS ( + SELECT CAST(("revenue" / 50) AS INTEGER) "segment" + FROM + my_revenue +) +SELECT + "segment" +, "count"(*) "num_customers" +, ("segment" * 50) "segment_base" +FROM + segments +GROUP BY "segment" +ORDER BY "segment" ASC, "num_customers" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00054.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00054.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00058.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00058.sql new file mode 100644 index 00000000000..ce14b80f195 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00058.sql @@ -0,0 +1,94 @@ +WITH + ss_items AS ( + SELECT + "i_item_id" "item_id" + , "sum"("ss_ext_sales_price") "ss_item_rev" + FROM + store_sales + , item + , date_dim + WHERE ("ss_item_sk" = "i_item_sk") + AND ("d_date" IN ( + SELECT "d_date" + FROM + date_dim + WHERE ("d_week_seq" = ( + SELECT "d_week_seq" + FROM + date_dim + WHERE ("d_date" = CAST('2000-01-03' AS DATE)) + )) + )) + AND ("ss_sold_date_sk" = "d_date_sk") + GROUP BY "i_item_id" +) +, cs_items AS ( + SELECT + "i_item_id" "item_id" + , "sum"("cs_ext_sales_price") "cs_item_rev" + FROM + catalog_sales + , item + , date_dim + WHERE ("cs_item_sk" = "i_item_sk") + AND ("d_date" IN ( + SELECT "d_date" + FROM + date_dim + WHERE ("d_week_seq" = ( + SELECT "d_week_seq" + FROM + date_dim + WHERE ("d_date" = CAST('2000-01-03' AS DATE)) + )) + )) + AND ("cs_sold_date_sk" = "d_date_sk") + GROUP BY "i_item_id" +) +, ws_items AS ( + SELECT + "i_item_id" "item_id" + , "sum"("ws_ext_sales_price") "ws_item_rev" + FROM + web_sales + , item + , date_dim + WHERE ("ws_item_sk" = "i_item_sk") + AND ("d_date" IN ( + SELECT "d_date" + FROM + date_dim + WHERE ("d_week_seq" = ( + SELECT "d_week_seq" + FROM + date_dim + WHERE ("d_date" = CAST('2000-01-03' AS DATE)) + )) + )) + AND ("ws_sold_date_sk" = "d_date_sk") + GROUP BY "i_item_id" +) +SELECT + "ss_items"."item_id" +, "ss_item_rev" +, CAST(((("ss_item_rev" / ((CAST("ss_item_rev" AS DECIMAL(16,7)) + "cs_item_rev") + "ws_item_rev")) / 3) * 100) AS DECIMAL(7,2)) "ss_dev" +, "cs_item_rev" +, CAST(((("cs_item_rev" / ((CAST("ss_item_rev" AS DECIMAL(16,7)) + "cs_item_rev") + "ws_item_rev")) / 3) * 100) AS DECIMAL(7,2)) "cs_dev" +, "ws_item_rev" +, CAST(((("ws_item_rev" / ((CAST("ss_item_rev" AS DECIMAL(16,7)) + "cs_item_rev") + "ws_item_rev")) / 3) * 100) AS DECIMAL(7,2)) "ws_dev" +, ((("ss_item_rev" + "cs_item_rev") + "ws_item_rev") / 3) "average" +FROM + ss_items +, cs_items +, ws_items +WHERE ("ss_items"."item_id" = "cs_items"."item_id") + AND ("ss_items"."item_id" = "ws_items"."item_id") + AND ("ss_item_rev" BETWEEN (DECIMAL '0.9' * "cs_item_rev") AND (DECIMAL '1.1' * "cs_item_rev")) + AND ("ss_item_rev" BETWEEN (DECIMAL '0.9' * "ws_item_rev") AND (DECIMAL '1.1' * "ws_item_rev")) + AND ("cs_item_rev" BETWEEN (DECIMAL '0.9' * "ss_item_rev") AND (DECIMAL '1.1' * "ss_item_rev")) + AND ("cs_item_rev" BETWEEN (DECIMAL '0.9' * "ws_item_rev") AND (DECIMAL '1.1' * "ws_item_rev")) + AND ("ws_item_rev" BETWEEN (DECIMAL '0.9' * "ss_item_rev") AND (DECIMAL '1.1' * "ss_item_rev")) + AND ("ws_item_rev" BETWEEN (DECIMAL '0.9' * "cs_item_rev") AND (DECIMAL '1.1' * "cs_item_rev")) +ORDER BY "ss_items"."item_id" ASC, "ss_item_rev" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00058.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00058.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00064.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00064.sql new file mode 100644 index 00000000000..3c751acf65a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00064.sql @@ -0,0 +1,111 @@ +WITH + cs_ui AS ( + SELECT + "cs_item_sk" + , "sum"("cs_ext_list_price") "sale" + , "sum"((("cr_refunded_cash" + "cr_reversed_charge") + "cr_store_credit")) "refund" + FROM + catalog_sales + , catalog_returns + WHERE ("cs_item_sk" = "cr_item_sk") + AND ("cs_order_number" = "cr_order_number") + GROUP BY "cs_item_sk" + HAVING ("sum"("cs_ext_list_price") > (2 * "sum"((("cr_refunded_cash" + "cr_reversed_charge") + "cr_store_credit")))) +) +, cross_sales AS ( + SELECT + "i_product_name" "product_name" + , "i_item_sk" "item_sk" + , "s_store_name" "store_name" + , "s_zip" "store_zip" + , "ad1"."ca_street_number" "b_street_number" + , "ad1"."ca_street_name" "b_street_name" + , "ad1"."ca_city" "b_city" + , "ad1"."ca_zip" "b_zip" + , "ad2"."ca_street_number" "c_street_number" + , "ad2"."ca_street_name" "c_street_name" + , "ad2"."ca_city" "c_city" + , "ad2"."ca_zip" "c_zip" + , "d1"."d_year" "syear" + , "d2"."d_year" "fsyear" + , "d3"."d_year" "s2year" + , "count"(*) "cnt" + , "sum"("ss_wholesale_cost") "s1" + , "sum"("ss_list_price") "s2" + , "sum"("ss_coupon_amt") "s3" + FROM + store_sales + , store_returns + , cs_ui + , date_dim d1 + , date_dim d2 + , date_dim d3 + , store + , customer + , customer_demographics cd1 + , customer_demographics cd2 + , promotion + , household_demographics hd1 + , household_demographics hd2 + , customer_address ad1 + , customer_address ad2 + , income_band ib1 + , income_band ib2 + , item + WHERE ("ss_store_sk" = "s_store_sk") + AND ("ss_sold_date_sk" = "d1"."d_date_sk") + AND ("ss_customer_sk" = "c_customer_sk") + AND ("ss_cdemo_sk" = "cd1"."cd_demo_sk") + AND ("ss_hdemo_sk" = "hd1"."hd_demo_sk") + AND ("ss_addr_sk" = "ad1"."ca_address_sk") + AND ("ss_item_sk" = "i_item_sk") + AND ("ss_item_sk" = "sr_item_sk") + AND ("ss_ticket_number" = "sr_ticket_number") + AND ("ss_item_sk" = "cs_ui"."cs_item_sk") + AND ("c_current_cdemo_sk" = "cd2"."cd_demo_sk") + AND ("c_current_hdemo_sk" = "hd2"."hd_demo_sk") + AND ("c_current_addr_sk" = "ad2"."ca_address_sk") + AND ("c_first_sales_date_sk" = "d2"."d_date_sk") + AND ("c_first_shipto_date_sk" = "d3"."d_date_sk") + AND ("ss_promo_sk" = "p_promo_sk") + AND ("hd1"."hd_income_band_sk" = "ib1"."ib_income_band_sk") + AND ("hd2"."hd_income_band_sk" = "ib2"."ib_income_band_sk") + AND ("cd1"."cd_marital_status" <> "cd2"."cd_marital_status") + AND ("i_color" IN ('purple' , 'burlywood' , 'indian' , 'spring' , 'floral' , 'medium')) + AND ("i_current_price" BETWEEN 64 AND (64 + 10)) + AND ("i_current_price" BETWEEN (64 + 1) AND (64 + 15)) + GROUP BY "i_product_name", "i_item_sk", "s_store_name", "s_zip", "ad1"."ca_street_number", "ad1"."ca_street_name", "ad1"."ca_city", "ad1"."ca_zip", "ad2"."ca_street_number", "ad2"."ca_street_name", "ad2"."ca_city", "ad2"."ca_zip", "d1"."d_year", "d2"."d_year", "d3"."d_year" +) +SELECT + "cs1"."product_name" +, "cs1"."store_name" +, "cs1"."store_zip" +, "cs1"."b_street_number" +, "cs1"."b_street_name" +, "cs1"."b_city" +, "cs1"."b_zip" +, "cs1"."c_street_number" +, "cs1"."c_street_name" +, "cs1"."c_city" +, "cs1"."c_zip" +, "cs1"."syear" +, "cs1"."cnt" +, "cs1"."s1" "s11" +, "cs1"."s2" "s21" +, "cs1"."s3" "s31" +, "cs2"."s1" "s12" +, "cs2"."s2" "s22" +, "cs2"."s3" "s32" +, "cs2"."syear" +, "cs2"."cnt" +FROM + cross_sales cs1 +, cross_sales cs2 +WHERE ("cs1"."item_sk" = "cs2"."item_sk") + AND ("cs1"."syear" = 1999) + AND ("cs2"."syear" = (1999 + 1)) + AND ("cs2"."cnt" <= "cs1"."cnt") + AND ("cs1"."store_name" = "cs2"."store_name") + AND ("cs1"."store_zip" = "cs2"."store_zip") +ORDER BY "cs1"."product_name" ASC, "cs1"."store_name" ASC, "cs2"."cnt" ASC, 14, 15, 16, 17, 18 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00064.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00064.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00082.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00082.sql new file mode 100644 index 00000000000..a5ac86262d4 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00082.sql @@ -0,0 +1,20 @@ +SELECT + "i_item_id" +, "i_item_desc" +, "i_current_price" +FROM + item +, inventory +, date_dim +, store_sales +WHERE ("i_current_price" BETWEEN 62 AND (62 + 30)) + AND ("inv_item_sk" = "i_item_sk") + AND ("d_date_sk" = "inv_date_sk") + AND (CAST("d_date" AS DATE) BETWEEN CAST('2000-05-25' AS DATE) AND (CAST('2000-05-25' AS DATE) + INTERVAL '60' DAY)) + AND ("i_manufact_id" IN (129, 270, 821, 423)) + AND ("inv_quantity_on_hand" BETWEEN 100 AND 500) + AND ("ss_item_sk" = "i_item_sk") +GROUP BY "i_item_id", "i_item_desc", "i_current_price" +ORDER BY "i_item_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00082.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00082.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00083.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00083.sql new file mode 100644 index 00000000000..fd25e4a46df --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00083.sql @@ -0,0 +1,88 @@ +WITH + sr_items AS ( + SELECT + "i_item_id" "item_id" + , "sum"("sr_return_quantity") "sr_item_qty" + FROM + store_returns + , item + , date_dim + WHERE ("sr_item_sk" = "i_item_sk") + AND ("d_date" IN ( + SELECT "d_date" + FROM + date_dim + WHERE ("d_week_seq" IN ( + SELECT "d_week_seq" + FROM + date_dim + WHERE ("d_date" IN (CAST('2000-06-30' AS DATE) , CAST('2000-09-27' AS DATE) , CAST('2000-11-17' AS DATE))) + )) + )) + AND ("sr_returned_date_sk" = "d_date_sk") + GROUP BY "i_item_id" +) +, cr_items AS ( + SELECT + "i_item_id" "item_id" + , "sum"("cr_return_quantity") "cr_item_qty" + FROM + catalog_returns + , item + , date_dim + WHERE ("cr_item_sk" = "i_item_sk") + AND ("d_date" IN ( + SELECT "d_date" + FROM + date_dim + WHERE ("d_week_seq" IN ( + SELECT "d_week_seq" + FROM + date_dim + WHERE ("d_date" IN (CAST('2000-06-30' AS DATE) , CAST('2000-09-27' AS DATE) , CAST('2000-11-17' AS DATE))) + )) + )) + AND ("cr_returned_date_sk" = "d_date_sk") + GROUP BY "i_item_id" +) +, wr_items AS ( + SELECT + "i_item_id" "item_id" + , "sum"("wr_return_quantity") "wr_item_qty" + FROM + web_returns + , item + , date_dim + WHERE ("wr_item_sk" = "i_item_sk") + AND ("d_date" IN ( + SELECT "d_date" + FROM + date_dim + WHERE ("d_week_seq" IN ( + SELECT "d_week_seq" + FROM + date_dim + WHERE ("d_date" IN (CAST('2000-06-30' AS DATE) , CAST('2000-09-27' AS DATE) , CAST('2000-11-17' AS DATE))) + )) + )) + AND ("wr_returned_date_sk" = "d_date_sk") + GROUP BY "i_item_id" +) +SELECT + "sr_items"."item_id" +, "sr_item_qty" +, CAST(((("sr_item_qty" / ((CAST("sr_item_qty" AS DECIMAL(9,4)) + "cr_item_qty") + "wr_item_qty")) / DECIMAL '3.0') * 100) AS DECIMAL(7,2)) "sr_dev" +, "cr_item_qty" +, CAST(((("cr_item_qty" / ((CAST("sr_item_qty" AS DECIMAL(9,4)) + "cr_item_qty") + "wr_item_qty")) / DECIMAL '3.0') * 100) AS DECIMAL(7,2)) "cr_dev" +, "wr_item_qty" +, CAST(((("wr_item_qty" / ((CAST("sr_item_qty" AS DECIMAL(9,4)) + "cr_item_qty") + "wr_item_qty")) / DECIMAL '3.0') * 100) AS DECIMAL(7,2)) "wr_dev" +, ((("sr_item_qty" + "cr_item_qty") + "wr_item_qty") / DECIMAL '3.00') "average" +FROM + sr_items +, cr_items +, wr_items +WHERE ("sr_items"."item_id" = "cr_items"."item_id") + AND ("sr_items"."item_id" = "wr_items"."item_id") +ORDER BY "sr_items"."item_id" ASC, "sr_item_qty" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00083.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00083.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00084.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00084.sql new file mode 100644 index 00000000000..369bf4317eb --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00084.sql @@ -0,0 +1,21 @@ +SELECT + "c_customer_id" "customer_id" +, "concat"("concat"("c_last_name", ', '), "c_first_name") "customername" +FROM + customer +, customer_address +, customer_demographics +, household_demographics +, income_band +, store_returns +WHERE ("ca_city" = 'Edgewood') + AND ("c_current_addr_sk" = "ca_address_sk") + AND ("ib_lower_bound" >= 38128) + AND ("ib_upper_bound" <= (38128 + 50000)) + AND ("ib_income_band_sk" = "hd_income_band_sk") + AND ("cd_demo_sk" = "c_current_cdemo_sk") + AND ("hd_demo_sk" = "c_current_hdemo_sk") + AND ("sr_cdemo_sk" = "cd_demo_sk") +ORDER BY "c_customer_id" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00084.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00084.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00085.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00085.sql new file mode 100644 index 00000000000..158727229f9 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00085.sql @@ -0,0 +1,51 @@ +SELECT + "substr"("r_reason_desc", 1, 20) +, "avg"("ws_quantity") +, "avg"("wr_refunded_cash") +, "avg"("wr_fee") +FROM + web_sales +, web_returns +, web_page +, customer_demographics cd1 +, customer_demographics cd2 +, customer_address +, date_dim +, reason +WHERE ("ws_web_page_sk" = "wp_web_page_sk") + AND ("ws_item_sk" = "wr_item_sk") + AND ("ws_order_number" = "wr_order_number") + AND ("ws_sold_date_sk" = "d_date_sk") + AND ("d_year" = 2000) + AND ("cd1"."cd_demo_sk" = "wr_refunded_cdemo_sk") + AND ("cd2"."cd_demo_sk" = "wr_returning_cdemo_sk") + AND ("ca_address_sk" = "wr_refunded_addr_sk") + AND ("r_reason_sk" = "wr_reason_sk") + AND ((("cd1"."cd_marital_status" = 'M') + AND ("cd1"."cd_marital_status" = "cd2"."cd_marital_status") + AND ("cd1"."cd_education_status" = 'Advanced Degree') + AND ("cd1"."cd_education_status" = "cd2"."cd_education_status") + AND ("ws_sales_price" BETWEEN DECIMAL '100.00' AND DECIMAL '150.00')) + OR (("cd1"."cd_marital_status" = 'S') + AND ("cd1"."cd_marital_status" = "cd2"."cd_marital_status") + AND ("cd1"."cd_education_status" = 'College') + AND ("cd1"."cd_education_status" = "cd2"."cd_education_status") + AND ("ws_sales_price" BETWEEN DECIMAL '50.00' AND DECIMAL '100.00')) + OR (("cd1"."cd_marital_status" = 'W') + AND ("cd1"."cd_marital_status" = "cd2"."cd_marital_status") + AND ("cd1"."cd_education_status" = '2 yr Degree') + AND ("cd1"."cd_education_status" = "cd2"."cd_education_status") + AND ("ws_sales_price" BETWEEN DECIMAL '150.00' AND DECIMAL '200.00'))) + AND ((("ca_country" = 'United States') + AND ("ca_state" IN ('IN' , 'OH' , 'NJ')) + AND ("ws_net_profit" BETWEEN 100 AND 200)) + OR (("ca_country" = 'United States') + AND ("ca_state" IN ('WI' , 'CT' , 'KY')) + AND ("ws_net_profit" BETWEEN 150 AND 300)) + OR (("ca_country" = 'United States') + AND ("ca_state" IN ('LA' , 'IA' , 'AR')) + AND ("ws_net_profit" BETWEEN 50 AND 250))) +GROUP BY "r_reason_desc" +ORDER BY "substr"("r_reason_desc", 1, 20) ASC, "avg"("ws_quantity") ASC, "avg"("wr_refunded_cash") ASC, "avg"("wr_fee") ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00085.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00085.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00091.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00091.sql new file mode 100644 index 00000000000..554d9c4476f --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00091.sql @@ -0,0 +1,30 @@ +SELECT + "cc_call_center_id" "Call_Center" +, "cc_name" "Call_Center_Name" +, "cc_manager" "Manager" +, "sum"("cr_net_loss") "Returns_Loss" +FROM + call_center +, catalog_returns +, date_dim +, customer +, customer_address +, customer_demographics +, household_demographics +WHERE ("cr_call_center_sk" = "cc_call_center_sk") + AND ("cr_returned_date_sk" = "d_date_sk") + AND ("cr_returning_customer_sk" = "c_customer_sk") + AND ("cd_demo_sk" = "c_current_cdemo_sk") + AND ("hd_demo_sk" = "c_current_hdemo_sk") + AND ("ca_address_sk" = "c_current_addr_sk") + AND ("d_year" = 1998) + AND ("d_moy" = 11) + AND ((("cd_marital_status" = 'M') + AND ("cd_education_status" = 'Unknown')) + OR (("cd_marital_status" = 'W') + AND ("cd_education_status" = 'Advanced Degree'))) + AND ("hd_buy_potential" LIKE 'Unknown%') + AND ("ca_gmt_offset" = -7) +GROUP BY "cc_call_center_id", "cc_name", "cc_manager", "cd_marital_status", "cd_education_status" +ORDER BY "sum"("cr_net_loss") DESC +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00091.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00091.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00093.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00093.sql new file mode 100644 index 00000000000..3882c58fe5d --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00093.sql @@ -0,0 +1,22 @@ +SELECT + "ss_customer_sk" +, "sum"("act_sales") "sumsales" +FROM + ( + SELECT + "ss_item_sk" + , "ss_ticket_number" + , "ss_customer_sk" + , (CASE WHEN ("sr_return_quantity" IS NOT NULL) THEN (("ss_quantity" - "sr_return_quantity") * "ss_sales_price") ELSE ("ss_quantity" * "ss_sales_price") END) "act_sales" + FROM + (store_sales + LEFT JOIN store_returns ON ("sr_item_sk" = "ss_item_sk") + AND ("sr_ticket_number" = "ss_ticket_number")) + , reason + WHERE ("sr_reason_sk" = "r_reason_sk") + AND ("r_reason_desc" = 'reason 28') +) t +GROUP BY "ss_customer_sk" +ORDER BY "sumsales" ASC, "ss_customer_sk" ASC +LIMIT 100 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00093.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpcds/ignored/00093.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00000.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00000.sql new file mode 100644 index 00000000000..e44e665f628 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00000.sql @@ -0,0 +1,17 @@ +select count(*) from customer; +select count(*) from lineitem; +select count(*) from nation; +select count(*) from orders; +select count(*) from part; +select count(*) from partsupp; +select count(*) from region; +select count(*) from supplier; + +SELECT * FROM customer ORDER BY custkey, name, address LIMIT 10; +SELECT * FROM lineitem ORDER BY orderkey, partkey, suppkey LIMIT 10; +SELECT * FROM nation ORDER BY nationkey, name, regionkey LIMIT 10; +SELECT * FROM orders ORDER BY orderkey, custkey, orderstatus LIMIT 10; +SELECT * FROM part ORDER BY partkey, name, mfgr LIMIT 10; +SELECT * FROM partsupp ORDER BY partkey, suppkey, availqty LIMIT 10; +SELECT * FROM region ORDER BY regionkey, name, comment LIMIT 10; +SELECT * FROM supplier ORDER BY suppkey, name, address LIMIT 10; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00000.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00000.txt new file mode 100644 index 00000000000..d9c51bb78b5 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00000.txt @@ -0,0 +1,98 @@ +"1500" + +"60175" + +"25" + +"15000" + +"2000" + +"8000" + +"5" + +"100" + +"1","Customer#000000001","IVhzIApeRb ot,c,E","15","25-989-741-2988","711.56","BUILDING","to the even, regular platelets. regular, ironic epitaphs nag e" +"2","Customer#000000002","XSTf4,NCwDVaWNe6tEgvwfmRchLXak","13","23-768-687-3665","121.65","AUTOMOBILE","l accounts. blithely ironic theodolites integrate boldly: caref" +"3","Customer#000000003","MG9kdTD2WBHm","1","11-719-748-3364","7498.12","AUTOMOBILE"," deposits eat slyly ironic, even instructions. express foxes detect slyly. blithely even accounts abov" +"4","Customer#000000004","XxVSJsLAGtn","4","14-128-190-5944","2866.83","MACHINERY"," requests. final, regular ideas sleep final accou" +"5","Customer#000000005","KvpyuHCplrB84WgAiGV6sYpZq7Tj","3","13-750-942-6364","794.47","HOUSEHOLD","n accounts will have to unwind. foxes cajole accor" +"6","Customer#000000006","sKZz0CsnMD7mp4Xd0YrBvx,LREYKUWAh yVn","20","30-114-968-4951","7638.57","AUTOMOBILE","tions. even deposits boost according to the slyly bold packages. final accounts cajole requests. furious" +"7","Customer#000000007","TcGe5gaZNgVePxU5kRrvXBfkasDTea","18","28-190-982-9759","9561.95","AUTOMOBILE","ainst the ironic, express theodolites. express, even pinto beans among the exp" +"8","Customer#000000008","I0B10bB0AymmC, 0PrRYBCP1yGJ8xcBPmWhl5","17","27-147-574-9335","6819.74","BUILDING","among the slyly regular theodolites kindle blithely courts. carefully even theodolites haggle slyly along the ide" +"9","Customer#000000009","xKiAFTjUsCuxfeleNqefumTrjS","8","18-338-906-3675","8324.07","FURNITURE","r theodolites according to the requests wake thinly excuses: pending requests haggle furiousl" +"10","Customer#000000010","6LrEaV6KR6PLVcgl2ArL Q3rqzLzcT1 v2","5","15-741-346-9870","2753.54","HOUSEHOLD","es regular deposits haggle. fur" + +"1","22","48","4","28.00","25816.56","0.09","0.06","N","O","1996-04-21","1996-03-30","1996-05-16","NONE","AIR","lites. fluffily even de" +"1","157","10","6","32.00","33828.80","0.07","0.02","N","O","1996-01-30","1996-02-07","1996-02-03","DELIVER IN PERSON","MAIL","arefully slyly ex" +"1","241","23","5","24.00","27389.76","0.10","0.04","N","O","1996-03-30","1996-03-14","1996-04-01","NONE","FOB"," pending foxes. slyly re" +"1","637","38","3","8.00","12301.04","0.10","0.02","N","O","1996-01-29","1996-03-05","1996-01-31","TAKE BACK RETURN","REG AIR","riously. regular, express dep" +"1","674","75","2","36.00","56688.12","0.09","0.06","N","O","1996-04-12","1996-02-28","1996-04-20","TAKE BACK RETURN","MAIL","ly final dependencies: slyly bold " +"1","1552","93","1","17.00","24710.35","0.04","0.02","N","O","1996-03-13","1996-02-12","1996-03-22","DELIVER IN PERSON","TRUCK","egular courts above the" +"2","1062","33","1","38.00","36596.28","0.00","0.05","N","O","1997-01-28","1997-01-14","1997-02-02","TAKE BACK RETURN","RAIL","ven requests. deposits breach a" +"3","43","19","1","45.00","42436.80","0.06","0.00","R","F","1994-02-02","1994-01-04","1994-02-23","NONE","AIR","ongside of the furiously brave acco" +"3","191","70","2","49.00","53468.31","0.10","0.00","R","F","1993-11-09","1993-12-20","1993-11-24","TAKE BACK RETURN","RAIL"," unusual accounts. eve" +"3","294","22","4","2.00","2388.58","0.01","0.06","A","F","1993-12-04","1994-01-07","1994-01-01","NONE","TRUCK","y. fluffily pending d" + +"0","ALGERIA","0"," haggle. carefully final deposits detect slyly agai" +"1","ARGENTINA","1","al foxes promise slyly according to the regular accounts. bold requests alon" +"2","BRAZIL","1","y alongside of the pending deposits. carefully special packages are about the ironic forges. slyly special " +"3","CANADA","1","eas hang ironic, silent packages. slyly regular packages are furiously over the tithes. fluffily bold" +"4","EGYPT","4","y above the carefully unusual theodolites. final dugouts are quickly across the furiously regular d" +"5","ETHIOPIA","0","ven packages wake quickly. regu" +"6","FRANCE","3","refully final requests. regular, ironi" +"7","GERMANY","3","l platelets. regular accounts x-ray: unusual, regular acco" +"8","INDIA","2","ss excuses cajole slyly across the packages. deposits print aroun" +"9","INDONESIA","2"," slyly express asymptotes. regular deposits haggle slyly. carefully ironic hockey players sleep blithely. carefull" + +"1","370","O","172799.49","1996-01-02","5-LOW","Clerk#000000951","0","nstructions sleep furiously among " +"2","781","O","38426.09","1996-12-01","1-URGENT","Clerk#000000880","0"," foxes. pending accounts at the pending, silent asymptot" +"3","1234","F","205654.30","1993-10-14","5-LOW","Clerk#000000955","0","sly final accounts boost. carefully regular ideas cajole carefully. depos" +"4","1369","O","56000.91","1995-10-11","5-LOW","Clerk#000000124","0","sits. slyly regular warthogs cajole. regular, regular theodolites acro" +"5","445","F","105367.67","1994-07-30","5-LOW","Clerk#000000925","0","quickly. bold deposits sleep slyly. packages use slyly" +"6","557","F","45523.10","1992-02-21","4-NOT SPECIFIED","Clerk#000000058","0","ggle. special, final requests are against the furiously specia" +"7","392","O","271885.66","1996-01-10","2-HIGH","Clerk#000000470","0","ly special requests " +"32","1301","O","198665.57","1995-07-16","2-HIGH","Clerk#000000616","0","ise blithely bold, regular requests. quickly unusual dep" +"33","670","F","146567.24","1993-10-27","3-MEDIUM","Clerk#000000409","0","uriously. furiously final request" +"34","611","O","73315.48","1998-07-21","3-MEDIUM","Clerk#000000223","0","ly final packages. fluffily final deposits wake blithely ideas. spe" + +"1","goldenrod lavender spring chocolate lace","Manufacturer#1","Brand#13","PROMO BURNISHED COPPER","7","JUMBO PKG","901.00","ly. slyly ironi" +"2","blush thistle blue yellow saddle","Manufacturer#1","Brand#13","LARGE BRUSHED BRASS","1","LG CASE","902.00","lar accounts amo" +"3","spring green yellow purple cornsilk","Manufacturer#4","Brand#42","STANDARD POLISHED BRASS","21","WRAP CASE","903.00","egular deposits hag" +"4","cornflower chocolate smoke green pink","Manufacturer#3","Brand#34","SMALL PLATED BRASS","14","MED DRUM","904.00","p furiously r" +"5","forest brown coral puff cream","Manufacturer#3","Brand#32","STANDARD POLISHED TIN","15","SM PKG","905.00"," wake carefully " +"6","bisque cornflower lawn forest magenta","Manufacturer#2","Brand#24","PROMO PLATED STEEL","4","MED BAG","906.00","sual a" +"7","moccasin green thistle khaki floral","Manufacturer#1","Brand#11","SMALL PLATED COPPER","45","SM BAG","907.00","lyly. ex" +"8","misty lace thistle snow royal","Manufacturer#4","Brand#44","PROMO BURNISHED TIN","41","LG DRUM","908.00","eposi" +"9","thistle dim navajo dark gainsboro","Manufacturer#4","Brand#43","SMALL BURNISHED STEEL","12","WRAP CASE","909.00","ironic foxe" +"10","linen pink saddle puff powder","Manufacturer#5","Brand#54","LARGE BURNISHED STEEL","44","LG CAN","910.01","ithely final deposit" + +"1","2","3325","771.64",", even theodolites. regular, final theodolites eat after the carefully pending foxes. furiously regular deposits sleep slyly. carefully bold realms above the ironic dependencies haggle careful" +"1","27","8076","993.49","ven ideas. quickly even packages print. pending multipliers must have to are fluff" +"1","52","3956","337.09","after the fluffily ironic deposits? blithely special dependencies integrate furiously even excuses. blithely silent theodolites could have to haggle pending, express requests; fu" +"1","77","4069","357.84","al, regular dependencies serve carefully after the quickly final pinto beans. furiously even deposits sleep quickly final, silent pinto beans. fluffily reg" +"2","3","8895","378.49","nic accounts. final accounts sleep furiously about the ironic, bold packages. regular, regular accounts" +"2","28","4969","915.27","ptotes. quickly pending dependencies integrate furiously. fluffily ironic ideas impress blithely above the express accounts. furiously even epitaphs need to wak" +"2","53","8539","438.37","blithely bold ideas. furiously stealthy packages sleep fluffily. slyly special deposits snooze furiously carefully regular accounts. regular deposits according to the accounts nag carefully slyl" +"2","78","3025","306.39","olites. deposits wake carefully. even, express requests cajole. carefully regular ex" +"3","4","4651","920.92","ilent foxes affix furiously quickly unusual requests. even packages across the carefully even theodolites nag above the sp" +"3","29","4093","498.13","ending dependencies haggle fluffily. regular deposits boost quickly carefully regular requests. deposits affix furiously around the pinto beans. ironic, unusual platelets across the p" + +"0","AFRICA","lar deposits. blithely final packages cajole. regular waters are final requests. regular accounts are according to " +"1","AMERICA","hs use ironic, even requests. s" +"2","ASIA","ges. thinly even pinto beans ca" +"3","EUROPE","ly final courts cajole furiously final excuse" +"4","MIDDLE EAST","uickly special accounts cajole carefully blithely close requests. carefully final asymptotes haggle furiousl" + +"1","Supplier#000000001"," N kD4on9OM Ipw3,gf0JBoQDd7tgrzrddZ","17","27-918-335-1736","5755.94","each slyly above the careful" +"2","Supplier#000000002","89eJ5ksX3ImxJQBvxObC,","5","15-679-861-2259","4032.68"," slyly bold instructions. idle dependen" +"3","Supplier#000000003","q1,G3Pj6OjIuUYfUoH18BFTKP5aU9bEV3","1","11-383-516-1199","4192.40","blithely silent requests after the express dependencies are sl" +"4","Supplier#000000004","Bk7ah4CK8SYQTepEmvMkkgMwg","15","25-843-787-7479","4641.08","riously even requests above the exp" +"5","Supplier#000000005","Gcdm2rJRzl5qlTVzc","11","21-151-690-3663","-283.84",". slyly regular pinto bea" +"6","Supplier#000000006","tQxuVm7s7CnK","14","24-696-997-4969","1365.79","final accounts. regular dolphins use against the furiously ironic decoys. " +"7","Supplier#000000007","s,4TicNGB4uO6PaSqNBUq","23","33-990-965-2201","6820.35","s unwind silently furiously regular courts. final requests are deposits. requests wake quietly blit" +"8","Supplier#000000008","9Sq4bBH2FQEmaFOocY45sRTxo6yuoG","17","27-498-742-3860","7627.85","al pinto beans. asymptotes haggl" +"9","Supplier#000000009","1KhUgZegwM3ua7dsYmekYBsK","10","20-403-398-8662","5302.37","s. unusual, even requests along the furiously regular pac" +"10","Supplier#000000010","Saygah3gYWMp72i PY","24","34-852-489-8585","3891.91","ing waters. regular requests ar" diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00001.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00001.sql new file mode 100644 index 00000000000..614546f64bc --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00001.sql @@ -0,0 +1,23 @@ +SELECT + l.returnflag, + l.linestatus, + sum(l.quantity) AS sum_qty, + sum(l.extendedprice) AS sum_base_price, + sum(l.extendedprice * (1 - l.discount)) AS sum_disc_price, + sum(l.extendedprice * (1 - l.discount) * (1 + l.tax)) AS sum_charge, + avg(l.quantity) AS avg_qty, + avg(l.extendedprice) AS avg_price, + avg(l.discount) AS avg_disc, + count(*) AS count_order +FROM + lineitem AS l +WHERE + l.shipdate <= DATE '1998-12-01' - INTERVAL '90' DAY +GROUP BY + l.returnflag, + l.linestatus +ORDER BY + l.returnflag, + l.linestatus +LIMIT 20; +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00001.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00001.txt new file mode 100644 index 00000000000..8a734141f3a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00001.txt @@ -0,0 +1,4 @@ +"A","F","380456.00","532348211.65","505822441.4861","526165934.000839","25.58","35785.71","0.05","14876" +"N","F","8971.00","12384801.37","11798257.2080","12282485.056933","25.78","35588.51","0.05","348" +"N","O","742802.00","1041502841.45","989737518.6346","1029418531.523350","25.45","35691.13","0.05","29181" +"R","F","381449.00","534594445.35","507996454.4067","528524219.358903","25.60","35874.01","0.05","14902" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00002.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00002.sql new file mode 100644 index 00000000000..a5e9e61dc7a --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00002.sql @@ -0,0 +1,45 @@ +SELECT + s.acctbal, + s.name, + n.name, + p.partkey, + p.mfgr, + s.address, + s.phone, + s.comment +FROM + part p, + supplier s, + partsupp ps, + nation n, + region r +WHERE + p.partkey = ps.partkey + AND s.suppkey = ps.suppkey + AND p.size = 15 + AND p.type like '%BRASS' + AND s.nationkey = n.nationkey + AND n.regionkey = r.regionkey + AND r.name = 'EUROPE' + AND ps.supplycost = ( + SELECT + min(ps.supplycost) + FROM + partsupp ps, + supplier s, + nation n, + region r + WHERE + p.partkey = ps.partkey + AND s.suppkey = ps.suppkey + AND s.nationkey = n.nationkey + AND n.regionkey = r.regionkey + AND r.name = 'EUROPE' + ) +ORDER BY + s.acctbal desc, + n.name, + s.name, + p.partkey +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00002.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00002.txt new file mode 100644 index 00000000000..f92424d6a2c --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00002.txt @@ -0,0 +1,4 @@ +"4186.95","Supplier#000000077","GERMANY","249","Manufacturer#4","wVtcr0uH3CyrSiWMLsqnB09Syo,UuZxPMeBghlY","17-281-345-4863","the slyly final asymptotes. blithely pending theodoli" +"1883.37","Supplier#000000086","ROMANIA","1015","Manufacturer#4","J1fgg5QaqnN","29-903-665-7065","cajole furiously special, final requests: furiously spec" +"1687.81","Supplier#000000017","ROMANIA","1634","Manufacturer#2","c2d,ESHRSkK3WYnxpgw6aOqN0q","29-601-884-9219","eep against the furiously bold ideas. fluffily bold packa" +"287.16","Supplier#000000052","ROMANIA","323","Manufacturer#4","WCk XCHYzBA1dvJDSol4ZJQQcQN,","29-974-934-4713","dolites are slyly against the furiously regular packages. ironic, final deposits cajole quickly" diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00003.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00003.sql new file mode 100644 index 00000000000..6f713d66bda --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00003.sql @@ -0,0 +1,24 @@ +SELECT + l.orderkey, + sum(l.extendedprice * (1 - l.discount)) AS revenue, + o.orderdate, + o.shippriority +FROM + customer AS c, + orders AS o, + lineitem AS l +WHERE + c.mktsegment = 'BUILDING' + AND c.custkey = o.custkey + AND l.orderkey = o.orderkey + AND o.orderdate < DATE '1995-03-15' + AND l.shipdate > DATE '1995-03-15' +GROUP BY + l.orderkey, + o.orderdate, + o.shippriority +ORDER BY + revenue DESC, + o.orderdate +LIMIT 20 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00003.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00003.txt new file mode 100644 index 00000000000..62a6a23cb49 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00003.txt @@ -0,0 +1,20 @@ +"47714","267010.5894","1995-03-11","0" +"22276","266351.5562","1995-01-29","0" +"32965","263768.3414","1995-02-25","0" +"21956","254541.1285","1995-02-02","0" +"1637","243512.7981","1995-02-08","0" +"10916","241320.0814","1995-03-11","0" +"30497","208566.6969","1995-02-07","0" +"450","205447.4232","1995-03-05","0" +"47204","204478.5213","1995-03-13","0" +"9696","201502.2188","1995-02-20","0" +"59843","195185.6655","1995-02-14","0" +"20641","189169.8966","1995-02-20","0" +"40612","177040.8647","1995-03-01","0" +"27719","173895.1907","1995-02-14","0" +"20453","169158.0061","1995-03-11","0" +"30725","167017.7105","1994-12-29","0" +"6022","166150.0127","1995-02-13","0" +"44102","164655.8193","1995-01-14","0" +"40962","163686.0684","1995-02-21","0" +"25669","161663.4805","1995-01-17","0" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00004.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00004.sql new file mode 100644 index 00000000000..24c07d9eca1 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00004.sql @@ -0,0 +1,23 @@ +SELECT + o.orderpriority, + count(*) AS order_count +FROM + orders o +WHERE + o.orderdate >= DATE '1993-07-01' + AND o.orderdate < DATE '1993-07-01' + INTERVAL '3' MONTH + AND EXISTS ( + SELECT + * + FROM + lineitem l + WHERE + l.orderkey = o.orderkey + AND l.commitdate < l.receiptdate + ) +GROUP BY + o.orderpriority +ORDER BY + o.orderpriority +LIMIT 20 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00004.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00004.txt new file mode 100644 index 00000000000..69fcf6dc8a7 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00004.txt @@ -0,0 +1,5 @@ +"1-URGENT","93" +"2-HIGH","103" +"3-MEDIUM","109" +"4-NOT SPECIFIED","102" +"5-LOW","128" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00005.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00005.sql new file mode 100644 index 00000000000..20698e982ca --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00005.sql @@ -0,0 +1,26 @@ +SELECT + n.name, + sum(l.extendedprice * (1 - l.discount)) AS revenue +FROM + customer AS c, + orders AS o, + lineitem AS l, + supplier AS s, + nation AS n, + region AS r +WHERE + c.custkey = o.custkey + AND l.orderkey = o.orderkey + AND l.suppkey = s.suppkey + AND c.nationkey = s.nationkey + AND s.nationkey = n.nationkey + AND n.regionkey = r.regionkey + AND r.name = 'ASIA' + AND o.orderdate >= DATE '1994-01-01' + AND o.orderdate < DATE '1994-01-01' + INTERVAL '1' YEAR +GROUP BY + n.name +ORDER BY + revenue DESC +LIMIT 20 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00005.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00005.txt new file mode 100644 index 00000000000..5961834f9d9 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00005.txt @@ -0,0 +1,5 @@ +"VIETNAM","1000926.6999" +"CHINA","740210.7570" +"JAPAN","660651.2425" +"INDONESIA","566379.5276" +"INDIA","422874.6844" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00006.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00006.sql new file mode 100644 index 00000000000..e2d64b81017 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00006.sql @@ -0,0 +1,13 @@ +SELECT + sum(l.extendedprice*l.discount) AS revenue +FROM + lineitem l +WHERE + l.shipdate >= DATE '1994-01-01' + AND l.shipdate < DATE '1994-01-01' + INTERVAL '1' YEAR + AND l.discount BETWEEN .06 - 0.01 AND .06 + 0.01 + AND l.quantity < 24 +ORDER BY + revenue DESC +LIMIT 20 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00006.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00006.txt new file mode 100644 index 00000000000..181a375df0b --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00006.txt @@ -0,0 +1 @@ +"1193053.2253" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00007.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00007.sql new file mode 100644 index 00000000000..80f470a4637 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00007.sql @@ -0,0 +1,40 @@ +SELECT + supp_nation, + cust_nation, + l_year, + sum(volume) AS revenue +FROM ( + SELECT + n1.name AS supp_nation, + n2.name AS cust_nation, + extract(YEAR FROM l.shipdate) AS l_year, + l.extendedprice * (1 - l.discount) AS volume + FROM + supplier AS s, + lineitem AS l, + orders AS o, + customer AS c, + nation AS n1, + nation AS n2 + WHERE + s.suppkey = l.suppkey + AND o.orderkey = l.orderkey + AND c.custkey = o.custkey + AND s.nationkey = n1.nationkey + AND c.nationkey = n2.nationkey + AND ( + (n1.name = 'FRANCE' AND n2.name = 'GERMANY') + OR (n1.name = 'GERMANY' AND n2.name = 'FRANCE') + ) + AND l.shipdate BETWEEN DATE '1995-01-01' AND DATE '1996-12-31' + ) AS shipping +GROUP BY + supp_nation, + cust_nation, + l_year +ORDER BY + supp_nation, + cust_nation, + l_year +LIMIT 20 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00007.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00007.txt new file mode 100644 index 00000000000..8cb8c58d3ac --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00007.txt @@ -0,0 +1,4 @@ +"FRANCE","GERMANY","1995","268068.5774" +"FRANCE","GERMANY","1996","303862.2980" +"GERMANY","FRANCE","1995","621159.4882" +"GERMANY","FRANCE","1996","379095.8854" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00008.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00008.sql new file mode 100644 index 00000000000..ea3b1fa7245 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00008.sql @@ -0,0 +1,39 @@ +SELECT + o_year, + sum(CASE + WHEN nation = 'BRAZIL' + THEN volume + ELSE 0 + END) / sum(volume) AS mkt_share +FROM ( + SELECT + extract(YEAR FROM o.orderdate) AS o_year, + l.extendedprice * (1 - l.discount) AS volume, + n2.name AS nation + FROM + part AS p, + supplier AS s, + lineitem AS l, + orders AS o, + customer AS c, + nation AS n1, + nation AS n2, + region AS r + WHERE + p.partkey = l.partkey + AND s.suppkey = l.suppkey + AND l.orderkey = o.orderkey + AND o.custkey = c.custkey + AND c.nationkey = n1.nationkey + AND n1.regionkey = r.regionkey + AND r.name = 'AMERICA' + AND s.nationkey = n2.nationkey + AND o.orderdate BETWEEN DATE '1995-01-01' AND DATE '1996-12-31' + AND p.type = 'ECONOMY ANODIZED STEEL' + ) AS all_nations +GROUP BY + o_year +ORDER BY + o_year +LIMIT 20 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00008.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00008.txt new file mode 100644 index 00000000000..8be6da1552e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00008.txt @@ -0,0 +1,2 @@ +"1995","0.0000" +"1996","0.0000" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00009.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00009.sql new file mode 100644 index 00000000000..e8698c76ef3 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00009.sql @@ -0,0 +1,33 @@ +SELECT + nation, + o_year, + sum(amount) AS sum_profit +FROM ( + SELECT + n.name AS nation, + extract(YEAR FROM o.orderdate) AS o_year, + l.extendedprice * (1 - l.discount) - ps.supplycost * l.quantity AS amount + FROM + part AS p, + supplier AS s, + lineitem AS l, + partsupp AS ps, + orders AS o, + nation AS n + WHERE + s.suppkey = l.suppkey + AND ps.suppkey = l.suppkey + AND ps.partkey = l.partkey + AND p.partkey = l.partkey + AND o.orderkey = l.orderkey + AND s.nationkey = n.nationkey + AND p.name LIKE '%green%' + ) AS profit +GROUP BY + nation, + o_year +ORDER BY + nation, + o_year DESC +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00009.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00009.txt new file mode 100644 index 00000000000..403846f817e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00009.txt @@ -0,0 +1,20 @@ +"ALGERIA","1998","97864.5682" +"ALGERIA","1997","368231.6695" +"ALGERIA","1996","196525.8046" +"ALGERIA","1995","341438.6885" +"ALGERIA","1994","677444.0160" +"ALGERIA","1993","458756.9157" +"ALGERIA","1992","549243.9511" +"ARGENTINA","1998","80448.7680" +"ARGENTINA","1997","186279.1618" +"ARGENTINA","1996","154041.8822" +"ARGENTINA","1995","113143.3119" +"ARGENTINA","1994","169680.4239" +"ARGENTINA","1993","116513.8141" +"ARGENTINA","1992","202404.7608" +"BRAZIL","1998","75952.5946" +"BRAZIL","1997","190548.1104" +"BRAZIL","1996","219059.0692" +"BRAZIL","1995","186435.2023" +"BRAZIL","1994","96835.1870" +"BRAZIL","1993","186365.4109" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00010.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00010.sql new file mode 100644 index 00000000000..58678efb2c2 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00010.sql @@ -0,0 +1,33 @@ +SELECT + c.custkey, + c.name, + sum(l.extendedprice * (1 - l.discount)) AS revenue, + c.acctbal, + n.name, + c.address, + c.phone, + c.comment +FROM + lineitem AS l, + orders AS o, + customer AS c, + nation AS n +WHERE + c.custkey = o.custkey + AND l.orderkey = o.orderkey + AND o.orderdate >= DATE '1993-10-01' + AND o.orderdate < DATE '1993-10-01' + INTERVAL '3' MONTH + AND l.returnflag = 'R' + AND c.nationkey = n.nationkey +GROUP BY + c.custkey, + c.name, + c.acctbal, + c.phone, + n.name, + c.address, + c.comment +ORDER BY + revenue DESC +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00010.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00010.txt new file mode 100644 index 00000000000..b6ac0e914b0 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00010.txt @@ -0,0 +1,20 @@ +"679","Customer#000000679","378211.3252","1394.44","IRAN","IJf1FlZL9I9m,rvofcoKy5pRUOjUQV","20-146-696-9508","ely pending frays boost carefully" +"1201","Customer#000001201","374331.5340","5165.39","IRAN","LfCSVKWozyWOGDW02g9UX,XgH5YU2o5ql1zBrN","20-825-400-1187","lyly pending packages. special requests sleep-- platelets use blithely after the instructions. sometimes even id" +"422","Customer#000000422","366451.0126","-272.14","INDONESIA","AyNzZBvmIDo42JtjP9xzaK3pnvkh Qc0o08ssnvq","19-299-247-2444","eposits; furiously ironic packages accordi" +"334","Customer#000000334","360370.7550","-405.91","EGYPT","OPN1N7t4aQ23TnCpc","14-947-291-5002","fully busily special ideas. carefully final excuses lose slyly carefully express accounts. even, ironic platelets ar" +"805","Customer#000000805","359448.9036","511.69","IRAN","wCKx5zcHvwpSffyc9qfi9dvqcm9LT,cLAG","20-732-989-5653","busy sentiments. pending packages haggle among the express requests-- slyly regular excuses above the slyl" +"932","Customer#000000932","341608.2753","6553.37","JORDAN","HN9Ap0NsJG7Mb8O","23-300-708-7927","packages boost slyly along the furiously express foxes. ev" +"853","Customer#000000853","341236.6246","-444.73","BRAZIL","U0 9PrwAgWK8AE0GHmnCGtH9BTexWWv87k","12-869-161-3468","yly special deposits wake alongside of" +"872","Customer#000000872","338328.7808","-858.61","PERU","vLP7iNZBK4B,HANFTKabVI3AO Y9O8H","27-357-139-7164"," detect. packages wake slyly express foxes. even deposits ru" +"737","Customer#000000737","338185.3365","2501.74","CHINA","NdjG1k243iCLSoy1lYqMIrpvuH1Uf75","28-658-938-1102","ding to the final platelets. regular packages against the carefully final ideas hag" +"1118","Customer#000001118","319875.7280","4130.18","IRAQ","QHg,DNvEVXaYoCdrywazjAJ","21-583-715-8627","y regular requests above the blithely ironic accounts use slyly bold packages: regular pinto beans eat carefully spe" +"223","Customer#000000223","319564.2750","7476.20","SAUDI ARABIA","ftau6Pk,brboMyEl,,kFm","30-193-643-1517","al, regular requests run furiously blithely silent packages. blithely ironic accounts across the furious" +"808","Customer#000000808","314774.6167","5561.93","ROMANIA","S2WkSKCGtnbhcFOp6MWcuB3rzFlFemVNrg ","29-531-319-7726"," unusual deposits. furiously even packages against the furiously even ac" +"478","Customer#000000478","299651.8026","-210.40","ARGENTINA","clyq458DIkXXt4qLyHlbe,n JueoniF","11-655-291-2694","o the foxes. ironic requests sleep. c" +"1441","Customer#000001441","294705.3935","9465.15","UNITED KINGDOM","u0YYZb46w,pwKo5H9vz d6B9zK4BOHhG jx","33-681-334-4499","nts haggle quietly quickly final accounts. slyly regular accounts among the sl" +"1478","Customer#000001478","294431.9178","9701.54","GERMANY","x7HDvJDDpR3MqZ5vg2CanfQ1hF0j4","17-420-484-5959","ng the furiously bold foxes. even notornis above the unusual " +"211","Customer#000000211","287905.6368","4198.72","JORDAN","URhlVPzz4FqXem","23-965-335-9471","furiously regular foxes boost fluffily special ideas. carefully regular dependencies are. slyly ironic " +"197","Customer#000000197","283190.4807","9860.22","ARGENTINA","UeVqssepNuXmtZ38D","11-107-312-6585","ickly final accounts cajole. furiously re" +"1030","Customer#000001030","282557.3566","6359.27","INDIA","Xpt1BiB5h9o","18-759-877-1870","ding to the slyly unusual accounts. even requests among the evenly" +"1049","Customer#000001049","281134.1117","8747.99","INDONESIA","bZ1OcFhHaIZ5gMiH","19-499-258-2851","uriously according to the furiously silent packages" +"1094","Customer#000001094","274877.4440","2544.49","BRAZIL","OFz0eedTmPmXk2 3XM9v9Mcp13NVC0PK","12-234-721-9871","tes serve blithely quickly pending foxes. express, quick accounts" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00011.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00011.sql new file mode 100644 index 00000000000..987847bdab3 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00011.sql @@ -0,0 +1,31 @@ +SELECT + ps.partkey, + sum(ps.supplycost*ps.availqty) AS value +FROM + partsupp ps, + supplier s, + nation n +WHERE + ps.suppkey = s.suppkey + AND s.nationkey = n.nationkey + AND n.name = 'GERMANY' +GROUP BY + ps.partkey +HAVING + sum(ps.supplycost*ps.availqty) > ( + SELECT + sum(ps.supplycost*ps.availqty) * 0.0001000000 / 1000 + FROM + partsupp ps, + supplier s, + nation n + WHERE + ps.suppkey = s.suppkey + AND s.nationkey = n.nationkey + AND n.name = 'GERMANY' + ) +ORDER BY + value DESC, + ps.partkey ASC +LIMIT 20; +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00011.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00011.txt new file mode 100644 index 00000000000..cc588241f02 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00011.txt @@ -0,0 +1,20 @@ +"1376","13271249.89" +"788","9498648.06" +"1071","9388264.40" +"1768","9207199.75" +"1168","8881908.96" +"1084","8709494.16" +"1415","8471489.56" +"1338","8293841.12" +"124","8203209.30" +"1232","8111663.34" +"1643","7975862.75" +"1952","7936947.61" +"1944","7880018.60" +"1884","7513422.84" +"942","7511018.76" +"670","7299956.80" +"1532","7222347.20" +"1052","7158586.00" +"455","7064285.84" +"1176","7060670.89" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00012.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00012.sql new file mode 100644 index 00000000000..aa61e7109a7 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00012.sql @@ -0,0 +1,30 @@ +SELECT + l.shipmode, + sum(CASE + WHEN o.orderpriority = '1-URGENT' + OR o.orderpriority = '2-HIGH' + THEN 1 + ELSE 0 + END) AS high_line_count, + sum(CASE + WHEN o.orderpriority <> '1-URGENT' + AND o.orderpriority <> '2-HIGH' + THEN 1 + ELSE 0 + END) AS low_line_count +FROM + orders AS o, + lineitem AS l +WHERE + o.orderkey = l.orderkey + AND l.shipmode IN ('MAIL', 'SHIP') + AND l.commitdate < l.receiptdate + AND l.shipdate < l.commitdate + AND l.receiptdate >= DATE '1994-01-01' + AND l.receiptdate < DATE '1994-01-01' + INTERVAL '1' YEAR +GROUP BY + l.shipmode +ORDER BY + l.shipmode +LIMIT 20 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00012.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00012.txt new file mode 100644 index 00000000000..305b6426e16 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00012.txt @@ -0,0 +1,2 @@ +"MAIL","64","86" +"SHIP","61","96" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00013.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00013.sql new file mode 100644 index 00000000000..53ed369f21e --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00013.sql @@ -0,0 +1,23 @@ +SELECT + c_count, + count(*) as custdist +FROM ( + SELECT + c.custkey, + count(o.orderkey) + FROM + customer c + LEFT OUTER JOIN + orders o + ON + c.custkey = o.custkey + AND o.comment NOT LIKE '%special%requests%' + GROUP BY c.custkey +) AS c_orders (c_custkey, c_count) +GROUP BY + c_count +ORDER BY + custdist DESC, + c_count DESC +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00013.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00013.txt new file mode 100644 index 00000000000..9671994c9d9 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00013.txt @@ -0,0 +1,20 @@ +"0","500" +"11","68" +"10","64" +"12","62" +"9","62" +"8","61" +"14","54" +"13","52" +"7","49" +"20","48" +"21","47" +"16","46" +"15","45" +"19","44" +"17","41" +"18","38" +"22","33" +"6","33" +"24","30" +"23","27" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00014.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00014.sql new file mode 100644 index 00000000000..7f13fb51d2d --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00014.sql @@ -0,0 +1,16 @@ +SELECT 100.00 * sum(CASE + WHEN p.type LIKE 'PROMO%' + THEN l.extendedprice * (1 - l.discount) + ELSE 0 + END) / sum(l.extendedprice * (1 - l.discount)) AS promo_revenue +FROM + lineitem AS l, + part AS p +WHERE + l.partkey = p.partkey + AND l.shipdate >= DATE '1995-09-01' + AND l.shipdate < DATE '1995-09-01' + INTERVAL '1' MONTH +ORDER BY + promo_revenue DESC +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00014.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00014.txt new file mode 100644 index 00000000000..6d18e1458e4 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00014.txt @@ -0,0 +1 @@ +"15.486546" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00015.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00015.sql new file mode 100644 index 00000000000..406b8bb32fa --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00015.sql @@ -0,0 +1,30 @@ +WITH revenue0 AS ( + SELECT + l.suppkey as supplier_no, + sum(l.extendedprice*(1-l.discount)) as total_revenue + FROM + lineitem l + WHERE + l.shipdate >= DATE '1996-01-01' + AND l.shipdate < DATE '1996-01-01' + INTERVAL '3' MONTH + GROUP BY + l.suppkey +) + +/* TPC_H Query 15 - Top Supplier */ +SELECT + s.suppkey, + s.name, + s.address, + s.phone, + total_revenue +FROM + supplier s, + revenue0 +WHERE + s.suppkey = supplier_no + AND total_revenue = (SELECT max(total_revenue) FROM revenue0) +ORDER BY + s.suppkey +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00015.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00015.txt new file mode 100644 index 00000000000..acb8b95024f --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00015.txt @@ -0,0 +1 @@ +"21","Supplier#000000021","81CavellcrJ0PQ3CPBID0Z0JwyJm0ka5igEs","12-253-590-5816","1161099.4636" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00016.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00016.sql new file mode 100644 index 00000000000..8ce357785af --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00016.sql @@ -0,0 +1,31 @@ +SELECT + p.brand, + p.type, + p.size, + count(DISTINCT ps.suppkey) AS supplier_cnt +FROM + partsupp AS ps, + part AS p +WHERE + p.partkey = ps.partkey + AND p.brand <> 'Brand#45' + AND p.type NOT LIKE 'MEDIUM POLISHED%' + AND p.size IN (49, 14, 23, 45, 19, 3, 36, 9) + AND ps.suppkey NOT IN ( + SELECT s.suppkey + FROM + supplier AS s + WHERE + s.comment LIKE '%Customer%Complaints%' + ) +GROUP BY + p.brand, + p.type, + p.size +ORDER BY + supplier_cnt DESC, + p.brand, + p.type, + p.size +LIMIT 20 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00016.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00016.txt new file mode 100644 index 00000000000..d6d2948a032 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00016.txt @@ -0,0 +1,20 @@ +"Brand#14","PROMO BRUSHED STEEL","9","8" +"Brand#35","SMALL POLISHED COPPER","14","8" +"Brand#22","LARGE BURNISHED TIN","36","6" +"Brand#11","ECONOMY BURNISHED NICKEL","49","4" +"Brand#11","LARGE PLATED TIN","23","4" +"Brand#11","MEDIUM ANODIZED BRASS","45","4" +"Brand#11","MEDIUM BRUSHED BRASS","45","4" +"Brand#11","PROMO ANODIZED BRASS","3","4" +"Brand#11","PROMO ANODIZED BRASS","49","4" +"Brand#11","PROMO ANODIZED TIN","45","4" +"Brand#11","PROMO BURNISHED BRASS","36","4" +"Brand#11","SMALL ANODIZED TIN","45","4" +"Brand#11","SMALL PLATED COPPER","45","4" +"Brand#11","STANDARD POLISHED NICKEL","45","4" +"Brand#11","STANDARD POLISHED TIN","45","4" +"Brand#12","ECONOMY BURNISHED COPPER","45","4" +"Brand#12","LARGE ANODIZED TIN","45","4" +"Brand#12","LARGE BURNISHED BRASS","19","4" +"Brand#12","LARGE PLATED STEEL","36","4" +"Brand#12","MEDIUM PLATED BRASS","23","4" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00017.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00017.sql new file mode 100644 index 00000000000..7150e90ec7c --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00017.sql @@ -0,0 +1,21 @@ +SELECT + sum(l.extendedprice)/7.0 as avg_yearly +FROM + lineitem l, + part p +WHERE + p.partkey = l.partkey + AND p.brand = 'Brand#23' + AND p.container = 'MED BOX' + AND l.quantity < ( + SELECT + 0.2*avg(l.quantity) + FROM + lineitem l + WHERE + l.partkey = p.partkey + ) +ORDER BY + avg_yearly DESC +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00017.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00017.txt new file mode 100644 index 00000000000..3cc762b5501 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00017.txt @@ -0,0 +1 @@ +"" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00018.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00018.sql new file mode 100644 index 00000000000..84eda3b981f --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00018.sql @@ -0,0 +1,34 @@ +SELECT + c.name, + c.custkey, + o.orderkey, + o.orderdate, + o.totalprice, + sum(l.quantity) +FROM + customer AS c, + orders AS o, + lineitem AS l +WHERE + o.orderkey IN ( + SELECT l.orderkey + FROM + lineitem AS l + GROUP BY + l.orderkey + HAVING + sum(l.quantity) > 300 + ) + AND c.custkey = o.custkey + AND o.orderkey = l.orderkey +GROUP BY + c.name, + c.custkey, + o.orderkey, + o.orderdate, + o.totalprice +ORDER BY + o.totalprice DESC, + o.orderdate +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00018.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00018.txt new file mode 100644 index 00000000000..076275a8410 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00018.txt @@ -0,0 +1,2 @@ +"Customer#000000667","667","29158","1995-10-21","439687.23","305.00" +"Customer#000000178","178","6882","1997-04-09","422359.65","303.00" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00019.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00019.sql new file mode 100644 index 00000000000..c6e7eb57723 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00019.sql @@ -0,0 +1,39 @@ +SELECT + sum(l.extendedprice* (1 - l.discount)) as revenue +FROM + lineitem l, + part p +WHERE + p.partkey = l.partkey + AND + (( + p.brand = 'Brand#12' + AND p.container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') + AND l.quantity >= 1 + AND l.quantity <= 1 + 10 + AND p.size BETWEEN 1 AND 5 + AND l.shipmode IN ('AIR', 'AIR REG') + AND l.shipinstruct = 'DELIVER IN PERSON' + ) + OR ( + p.brand ='Brand#23' + AND p.container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') + AND l.quantity >=10 + AND l.quantity <=10 + 10 + AND p.size BETWEEN 1 AND 10 + AND l.shipmode IN ('AIR', 'AIR REG') + AND l.shipinstruct = 'DELIVER IN PERSON' + ) + OR ( + p.brand = 'Brand#34' + AND p.container IN ( 'LG CASE', 'LG BOX', 'LG PACK', 'LG PKG') + AND l.quantity >=20 + AND l.quantity <= 20 + 10 + AND p.size BETWEEN 1 AND 15 + AND l.shipmode IN ('AIR', 'AIR REG') + AND l.shipinstruct = 'DELIVER IN PERSON' + )) +ORDER BY + revenue DESC +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00019.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00019.txt new file mode 100644 index 00000000000..69cbb857fba --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00019.txt @@ -0,0 +1 @@ +"22923.0280" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00020.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00020.sql new file mode 100644 index 00000000000..8ea9166a4d7 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00020.sql @@ -0,0 +1,39 @@ +SELECT + s.name, + s.address +FROM + supplier s, + nation n +WHERE + s.suppkey IN ( + SELECT + ps.suppkey + FROM + partsupp ps + WHERE + ps.partkey IN ( + SELECT + p.partkey + FROM + part p + WHERE + p.name like 'forest%' + ) + AND ps.availqty > ( + SELECT + 0.5*sum(l.quantity) + FROM + lineitem l + WHERE + l.partkey = ps.partkey + AND l.suppkey = ps.suppkey + AND l.shipdate >= date('1994-01-01') + AND l.shipdate < date('1994-01-01') + interval '1' YEAR + ) + ) + AND s.nationkey = n.nationkey + AND n.name = 'CANADA' +ORDER BY + s.name +LIMIT 20 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00020.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00020.txt new file mode 100644 index 00000000000..f7e25db96dd --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00020.txt @@ -0,0 +1 @@ +"Supplier#000000013","HK71HQyWoqRWOX8GI FpgAifW,2PoH" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00021.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00021.sql new file mode 100644 index 00000000000..c7e8081652d --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00021.sql @@ -0,0 +1,42 @@ +SELECT + s.name, + count(*) as numwait +FROM + supplier s, + lineitem l1, + orders o, + nation n +WHERE + s.suppkey = l1.suppkey + AND o.orderkey = l1.orderkey + AND o.orderstatus = 'F' + AND l1.receiptdate> l1.commitdate + AND EXISTS ( + SELECT + * + FROM + lineitem l2 + WHERE + l2.orderkey = l1.orderkey + AND l2.suppkey <> l1.suppkey + ) + AND NOT EXISTS ( + SELECT + * + FROM + lineitem l3 + WHERE + l3.orderkey = l1.orderkey + AND l3.suppkey <> l1.suppkey + AND l3.receiptdate > l3.commitdate + ) + AND s.nationkey = n.nationkey + AND n.name = 'SAUDI ARABIA' +GROUP BY + s.name +ORDER BY + numwait DESC, + s.name +LIMIT + 100 +; diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00021.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00021.txt new file mode 100644 index 00000000000..d392f8b1460 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00021.txt @@ -0,0 +1 @@ +"Supplier#000000074","9" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00022.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00022.sql new file mode 100644 index 00000000000..3ef4fd3b884 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00022.sql @@ -0,0 +1,37 @@ +SELECT + cntrycode, + count(*) AS numcust, + sum(acctbal) AS totacctbal +FROM + ( + SELECT + substr(c.phone,1,2) AS cntrycode, + c.acctbal + FROM + customer c + WHERE + substr(c.phone,1,2) IN ('13', '31', '23', '29', '30', '18', '17') + AND c.acctbal > ( + SELECT + avg(c.acctbal) + FROM + customer c + WHERE + c.acctbal > 0.00 + AND substr(c.phone,1,2) IN ('13', '31', '23', '29', '30', '18', '17') + ) + AND NOT EXISTS ( + SELECT + * + FROM + orders o + WHERE + o.custkey = c.custkey + ) + ) AS custsale +GROUP BY + cntrycode +ORDER BY + cntrycode +LIMIT 20 +; \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00022.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00022.txt new file mode 100644 index 00000000000..67238bff170 --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/00022.txt @@ -0,0 +1,7 @@ +"13","10","75359.29" +"17","8","62288.98" +"18","14","111072.45" +"23","5","40458.86" +"29","11","88722.85" +"30","17","122189.33" +"31","8","66313.16" \ No newline at end of file diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/catalog_mysql_cleanup.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/catalog_mysql_cleanup.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/catalog_mysql_prepare.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/catalog_mysql_prepare.sql new file mode 100644 index 00000000000..962734423fb --- /dev/null +++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets/tpch/catalog_mysql_prepare.sql @@ -0,0 +1,116 @@ +call gravitino.system.create_catalog( + 'gt_mysql2', + 'jdbc-mysql', + map( + array['jdbc-url', 'jdbc-user', 'jdbc-password', 'jdbc-driver', 'cloud.region-code', 'cloud.trino.connection-url', 'cloud.trino.connection-user'], + array['${mysql_uri}/?useSSL=false', 'trino', 'ds123', 'com.mysql.cj.jdbc.Driver', 'c2', '${trino_remote_jdbc_uri}', 'admin'] + ) +); + +call gravitino.system.create_catalog( + 'gt_mysql2_1', + 'jdbc-mysql', + map( + array['jdbc-url', 'jdbc-user', 'jdbc-password', 'jdbc-driver'], + array['${mysql_uri}/?useSSL=false', 'trino', 'ds123', 'com.mysql.cj.jdbc.Driver'] + ) +); + + + +create schema gt_mysql2_1.gt_tpch; +use gt_mysql2_1.gt_tpch; + +CREATE TABLE customer ( + custkey bigint NOT NULL, + name varchar(25) NOT NULL, + address varchar(40) NOT NULL, + nationkey bigint NOT NULL, + phone varchar(15) NOT NULL, + acctbal decimal(12, 2) NOT NULL, + mktsegment varchar(10) NOT NULL, + comment varchar(117) NOT NULL +); + +CREATE TABLE lineitem ( + orderkey bigint NOT NULL, + partkey bigint NOT NULL, + suppkey bigint NOT NULL, + linenumber integer NOT NULL, + quantity decimal(12, 2) NOT NULL, + extendedprice decimal(12, 2) NOT NULL, + discount decimal(12, 2) NOT NULL, + tax decimal(12, 2) NOT NULL, + returnflag varchar(1) NOT NULL, + linestatus varchar(1) NOT NULL, + shipdate date NOT NULL, + commitdate date NOT NULL, + receiptdate date NOT NULL, + shipinstruct varchar(25) NOT NULL, + shipmode varchar(10) NOT NULL, + comment varchar(44) NOT NULL +); + +CREATE TABLE nation ( + nationkey bigint NOT NULL, + name varchar(25) NOT NULL, + regionkey bigint NOT NULL, + comment varchar(152) NOT NULL +); + +CREATE TABLE orders ( + orderkey bigint NOT NULL, + custkey bigint NOT NULL, + orderstatus varchar(1) NOT NULL, + totalprice decimal(12, 2) NOT NULL, + orderdate date NOT NULL, + orderpriority varchar(15) NOT NULL, + clerk varchar(15) NOT NULL, + shippriority integer NOT NULL, + comment varchar(79) NOT NULL +); + +CREATE TABLE part ( + partkey bigint NOT NULL, + name varchar(55) NOT NULL, + mfgr varchar(25) NOT NULL, + brand varchar(10) NOT NULL, + type varchar(25) NOT NULL, + size integer NOT NULL, + container varchar(10) NOT NULL, + retailprice decimal(12, 2) NOT NULL, + comment varchar(23) NOT NULL +); + +CREATE TABLE partsupp ( + partkey bigint NOT NULL, + suppkey bigint NOT NULL, + availqty integer NOT NULL, + supplycost decimal(12, 2) NOT NULL, + comment varchar(199) NOT NULL +); + +CREATE TABLE region ( + regionkey bigint NOT NULL, + name varchar(25) NOT NULL, + comment varchar(152) NOT NULL +); + +CREATE TABLE supplier ( + suppkey bigint NOT NULL, + name varchar(25) NOT NULL, + address varchar(40) NOT NULL, + nationkey bigint NOT NULL, + phone varchar(15) NOT NULL, + acctbal decimal(12, 2) NOT NULL, + comment varchar(101) NOT NULL +); + +insert into customer select * from tpch.tiny.customer; +insert into lineitem select * from tpch.tiny.lineitem; +insert into nation select * from tpch.tiny.nation; +insert into orders select * from tpch.tiny.orders; +insert into part select * from tpch.tiny.part; +insert into partsupp select * from tpch.tiny.partsupp; +insert into region select * from tpch.tiny.region; +insert into supplier select * from tpch.tiny.supplier; diff --git a/trino-connector/integration-test/trino-test-tools/check_env.sh b/trino-connector/integration-test/trino-test-tools/check_env.sh new file mode 100755 index 00000000000..7fbaecc85a2 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/check_env.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -e + +gravitino_server_dir() { + local dir="" + if [ ! -z "${GRAVITINO_HOME_DIR}" ]; then + if [ -z "${GRAVITINO_SERVER_DIR}" ]; then + dir=$GRAVITINO_HOME_DIR/distribution/package + else + dir=$GRAVITINO_SERVER_DIR + fi + fi + + if [ ! -d "$dir" ]; then + echo "Error: Gravitino server directory '$dir' does not exist." >&2 + exit 1 + fi + echo $dir + +} + +gravitino_trino_connector_dir() { + local dir="" + if [ ! -z "${GRAVITINO_HOME_DIR}" ]; then + if [ -z "${GRAVITINO_TRINO_CONNECTOR_DIR}" ]; then + dir=$GRAVITINO_HOME_DIR/trino-connector/trino-connector/build/libs + else + dir=$GRAVITINO_TRINO_CONNECTOR_DIR + fi + fi + + if [ ! -d "$dir" ]; then + echo "Error: Gravitino Trino connector directory '$dir' does not exist." >&2 + exit 1 + fi + echo $dir +} + +gravitino_trino_cascading_connector_dir() { + local dir="" + if [ ! -z "${GRAVITINO_HOME_DIR}" ]; then + if [ -z "${GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR}" ]; then + dir=$GRAVITINO_HOME_DIR/trino-connector/integration-test/build/trino-trino + else + dir=$GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR + fi + fi + + echo $dir +} + +check_environment() { + if ! command -v docker &>/dev/null; then + echo "ERROR: No docker service environment found, please install Docker first." >&2 + exit 1 + fi +} diff --git a/trino-connector/integration-test/trino-test-tools/download_jar.sh b/trino-connector/integration-test/trino-test-tools/download_jar.sh new file mode 100755 index 00000000000..a080d332895 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/download_jar.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -e +#!/bin/bash + +# Function to download a JAR file if it does not already exist +download_jar() { + local jar_file_name=$1 + local download_url=$2 + local target_directory=$3 + + local full_path="$target_directory/$jar_file_name" + + if [ ! -f "$full_path" ]; then + echo "Downloading $jar_file_name..." + curl -L -o "$full_path" "$download_url" + if [ $? -ne 0 ]; then + echo "Download failed for $jar_file_name" + exit 1 + fi + echo "$jar_file_name downloaded successfully." + else + echo "$jar_file_name already exists." + fi +} + +# Specific functions for each driver or bundle +download_mysql_jar() { + download_jar "mysql-connector-java-8.0.26.jar" \ + "https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.26/mysql-connector-java-8.0.26.jar" \ + "$GRAVITINO_SERVER_DIR/catalogs/jdbc-mysql/libs" +} + +download_postgresql_jar() { + download_jar "postgresql-42.7.0.jar" \ + "https://jdbc.postgresql.org/download/postgresql-42.7.0.jar" \ + "$GRAVITINO_SERVER_DIR/catalogs/jdbc-postgresql/libs" +} + +download_iceberg_aws_bundle() { + download_jar "iceberg-aws-bundle--1.5.2.jar" \ + "https://jdbc.postgresql.org/download/iceberg-aws-bundle--1.5.2.jar" \ + "$GRAVITINO_SERVER_DIR/catalogs/lakehouse-iceberg/libs" +} + +download_trino-cascading-connector() { + if [ -d "$GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR" ]; then + return + fi + + path=$GRAVITINO_HOME_DIR/trino-connector/integration-test/build + download_jar "trino-trino-0.1-SNAPSHOT.zip" \ + "https://github.com/diqiu50/trino-cascading-connector/releases/download/0.1-SNAPSHOT/trino-trino-0.1-SNAPSHOT.zip" \ + "$path" + cd $path + rm -fr trino-trino + tar -zxvf trino-trino*.zip + + if [ ! -d "$GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR" ]; then + echo "Error: Gravitino Trino connector directory '$GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR' does not exist." >&2 + exit 1 + fi +} + diff --git a/trino-connector/integration-test/trino-test-tools/run_test.sh b/trino-connector/integration-test/trino-test-tools/run_test.sh new file mode 100755 index 00000000000..f2d6a7d7afe --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/run_test.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +cd "$(dirname "$0")" + +GRAVITINO_HOME_DIR=../../../ +GRAVITINO_SERVER_DIR= +GRAVITINO_TRINO_CONNECTOR_DIR= + +GRAVITINO_HOME_DIR=`realpath $GRAVITINO_HOME_DIR` + +TRINO_TEST_DOCKER_HOME=trino-cascading-env +TRINO_TEST_SETS_DIR=$GRAVITINO_HOME_DIR/trino-connector/integration-test/src/test/resources/trino-ci-testset/trino-cascading-testsets +TRINO_TEST_ARGS= +TRINO_TEST_PARAMS= + + +source check_env.sh +GRAVITINO_SERVER_DIR=$(gravitino_server_dir) +GRAVITINO_TRINO_CONNECTOR_DIR=$(gravitino_trino_connector_dir) +check_environment + + +if [ ! -d "$TRINO_TEST_DOCKER_HOME" ]; then + echo "Error: Trino test env setup directory '$TRINO_TEST_DOCKER_HOME' does not exist." + exit 1 +fi + +if [ ! -d "$TRINO_TEST_SETS_DIR" ]; then + echo "Error: Trino test sets directory '$TRINO_TEST_SETS_DIR' does not exist." + exit 1 +fi + + +TRINO_TEST_SETS_DIR=`realpath $TRINO_TEST_SETS_DIR` +GRAVITINO_SERVER_DIR=`realpath $GRAVITINO_SERVER_DIR` +GRAVITINO_TRINO_CONNECTOR_DIR=`realpath $GRAVITINO_TRINO_CONNECTOR_DIR` + +# start test dockers +$TRINO_TEST_DOCKER_HOME/launch.sh $GRAVITINO_SERVER_DIR $GRAVITINO_TRINO_CONNECTOR_DIR + +# resolve docker ip address +uris=$($TRINO_TEST_DOCKER_HOME/inspect_ip.sh) + +args="--auto=none --test_sets_dir=$TRINO_TEST_SETS_DIR $uris $TRINO_TEST_ARGS" + +if [[ -n $TRINO_TEST_PARAMS ]]; then + if [[ "$args" == *"--params="* ]]; then + args=$(echo "$args" | sed "s/--params=[^ ]*/--params=$TRINO_TEST_PARAMS,/") + else + args="$args --params=$TRINO_TEST_PARAMS" + fi +fi + + +# execute test +echo "The args: $args" + +sleep 5 +$GRAVITINO_HOME_DIR/trino-connector/integration-test/trino-test-tools/trino_test.sh $args + + if [ $? -ne 0 ]; then + echo "Test failed" + # clean up + $TRINO_TEST_DOCKER_HOME/shutdown.sh + exit 1 + fi + +echo "Test success" +# clean up +$TRINO_TEST_DOCKER_HOME/shutdown.sh diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/docker-compose.yaml b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/docker-compose.yaml new file mode 100644 index 00000000000..7a78411f8d4 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/docker-compose.yaml @@ -0,0 +1,107 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# +services: + + mysql: + image: mysql:8.0 + container_name: trino-ci-mysql + networks: + - trino-net + volumes: + - ./init/mysql:/docker-entrypoint-initdb.d/ + environment: + MYSQL_ROOT_PASSWORD: ds123 + MYSQL_USER: trino + MYSQL_PASSWORD: ds123 + MYSQL_DATABASE: gt_db + command: + --default-authentication-plugin=mysql_native_password + --character-set-server=utf8mb4 + --collation-server=utf8mb4_general_ci + --explicit_defaults_for_timestamp=true + --lower_case_table_names=1 + healthcheck: + test: ["CMD-SHELL", "mysqladmin ping"] + interval: 10s + timeout: 60s + retries: 5 + + trino-remote: + image: trinodb/trino:435 + networks: + - trino-net + container_name: trino-ci-trino-remote + environment: + - HADOOP_USER_NAME=root + - GRAVITINO_HOST_IP=trino-local + - GRAVITINO_HOST_PORT=${GRAVITINO_SERVER_PORT:-8090} + - GRAVITINO_METALAKE_NAME=test + - HIVE_HOST_IP=hive + entrypoint: /bin/bash /tmp/trino/init.sh + volumes: + - ./init/trino-remote:/tmp/trino + - ${GRAVITINO_TRINO_CONNECTOR_DIR:-/null}:/usr/lib/trino/plugin/gravitino + - ${GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR:-/null}:/usr/lib/trino/plugin/trino + extra_hosts: + - "host.docker.internal:host-gateway" + healthcheck: + test: ["CMD", "trino", "--execute", "SELECT 1"] + interval: 10s + timeout: 60s + retries: 5 + depends_on: + mysql: + condition: service_healthy + + trino-local: + image: trinodb/trino:435 + networks: + - trino-net + container_name: trino-ci-trino-local + environment: + - HADOOP_USER_NAME=root + - GRAVITINO_HOST_IP=trino-local + - GRAVITINO_HOST_PORT=${GRAVITINO_SERVER_PORT:-8090} + - GRAVITINO_METALAKE_NAME=test + - HIVE_HOST_IP=hive + entrypoint: /bin/bash /tmp/trino/init.sh + volumes: + - ./init/trino-local:/tmp/trino + - ${GRAVITINO_TRINO_CONNECTOR_DIR:-/null}:/usr/lib/trino/plugin/gravitino + - ${GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR:-/null}:/usr/lib/trino/plugin/trino + - ${GRAVITINO_SERVER_DIR:-/null}:/usr/local/gravitino-server + extra_hosts: + - "host.docker.internal:host-gateway" + healthcheck: + test: ["CMD", "trino", "--execute", "SELECT 1"] + interval: 10s + timeout: 60s + retries: 5 + depends_on: + mysql: + condition: service_healthy + +networks: + trino-net: + driver: bridge + name: trino-net + ipam: + config: + - subnet: 10.20.31.16/28 diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/mysql/init.sql b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/mysql/init.sql new file mode 100644 index 00000000000..f2b730b90f2 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/mysql/init.sql @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +GRANT ALL PRIVILEGES on *.* to 'trino'@'%'; +FLUSH PRIVILEGES; diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/catalog/gravitino.properties b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/catalog/gravitino.properties new file mode 100644 index 00000000000..93a0822776a --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/catalog/gravitino.properties @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# +connector.name = gravitino +gravitino.uri = http://GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT +gravitino.metalake = GRAVITINO_METALAKE_NAME +gravitino.cloud.region-code=c1 diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/catalog/trino.properties b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/catalog/trino.properties new file mode 100644 index 00000000000..c9f8e5a46fe --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/catalog/trino.properties @@ -0,0 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +connector.name=trino +connection-url=jdbc:trino://trino-remote:8080/tpcds +connection-user=admin diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/config.properties b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/config.properties new file mode 100644 index 00000000000..0f2011202f2 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/config.properties @@ -0,0 +1,25 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# + +coordinator=true +node-scheduler.include-coordinator=true +http-server.http.port=8080 +catalog.management=dynamic +discovery.uri=http://0.0.0.0:8080 diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/jvm.config b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/jvm.config new file mode 100644 index 00000000000..c4ee7db21c0 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/jvm.config @@ -0,0 +1,36 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +-XX:InitialRAMPercentage=30 +-XX:MaxRAMPercentage=60 +-XX:G1HeapRegionSize=32M +-XX:+ExplicitGCInvokesConcurrent +-XX:+HeapDumpOnOutOfMemoryError +-XX:+ExitOnOutOfMemoryError +-XX:-OmitStackTraceInFastThrow +-XX:ReservedCodeCacheSize=256M +-XX:PerMethodRecompilationCutoff=10000 +-XX:PerBytecodeRecompilationCutoff=10000 +-Djdk.attach.allowAttachSelf=true +-Djdk.nio.maxCachedBufferSize=2000000 +# Reduce starvation of threads by GClocker, recommend to set about the number of cpu cores (JDK-8192647) +-XX:+UnlockDiagnosticVMOptions +-XX:GCLockerRetryAllocationCount=32 +-DHADOOP_USER_NAME=hive +-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 +-Dlog4j.configurationFile=/etc/trino/log4j2.properties \ No newline at end of file diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/log4j2.properties b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/log4j2.properties new file mode 100644 index 00000000000..c6c18dde3ec --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/config/log4j2.properties @@ -0,0 +1,44 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# Set to debug or trace if log4j initialization is failing +status = info + +# Name of the configuration +name = ConsoleLogConfig + +# Console appender configuration +appender.console.type = Console +appender.console.name = consoleLogger +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n + +# File appender configuration +appender.file.type = File +appender.file.name = fileLogger +appender.file.fileName = gravitino-trino-connector.log +appender.file.layout.type = PatternLayout +appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n + +# Root logger level +rootLogger.level = info + +# Root logger referring to console and file appenders +rootLogger.appenderRef.stdout.ref = consoleLogger +rootLogger.appenderRef.file.ref = fileLogger diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/init.sh b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/init.sh new file mode 100644 index 00000000000..d96715f42b9 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/init.sh @@ -0,0 +1,67 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# + +set -ex +trino_conf_dir="$(dirname "${BASH_SOURCE-$0}")" +trino_conf_dir="$(cd "${trino_conf_dir}">/dev/null; pwd)" + +cp "$trino_conf_dir/config/config.properties" /etc/trino/config.properties +cp "$trino_conf_dir/config/jvm.config" /etc/trino/jvm.config +cp "$trino_conf_dir/config/log4j2.properties" /etc/trino/log4j2.properties +cp "$trino_conf_dir/config/catalog/gravitino.properties" /etc/trino/catalog/gravitino.properties +cp "$trino_conf_dir/config/catalog/trino.properties" /etc/trino/catalog/trino.properties + +#start the gravitino server +/usr/local/gravitino-server/bin/gravitino.sh start + +#create test metalake +sleep 3 +curl -X POST -H "Content-Type: application/json" -d '{"name":"test","comment":"comment","properties":{}}' http://localhost:8090/api/metalakes + +# +# Update `gravitino.uri = http://GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT` in the `conf/catalog/gravitino.properties` +sed -i "s/GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT/${GRAVITINO_HOST_IP}:${GRAVITINO_HOST_PORT}/g" /etc/trino/catalog/gravitino.properties +# Update `gravitino.metalake = GRAVITINO_METALAKE_NAME` in the `conf/catalog/gravitino.properties` +sed -i "s/GRAVITINO_METALAKE_NAME/${GRAVITINO_METALAKE_NAME}/g" /etc/trino/catalog/gravitino.properties + + +# Check the number of Gravitino connector plugins present in the Trino plugin directory +num_of_gravitino_connector=$(ls /usr/lib/trino/plugin/gravitino | grep gravitino-trino-connector-* | wc -l) +if [[ "${num_of_gravitino_connector}" -ne 1 ]]; then + echo "Multiple versions of the Gravitino connector plugin found or none present." + exit 1 +fi + +nohup /usr/lib/trino/bin/run-trino & + +counter=0 +while [ $counter -le 300 ]; do + counter=$((counter + 1)) + trino_ready=$(trino --execute "SHOW CATALOGS LIKE 'gravitino'" | wc -l) + if [ "$trino_ready" -eq 0 ]; + then + echo "Wait for the initialization of services" + sleep 1; + else + # persist the container + tail -f /dev/null + fi +done +exit 1 diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/init.sql b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/init.sql new file mode 100644 index 00000000000..25cacb85aa6 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-local/init.sql @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +select 1; diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/catalog/gravitino.properties b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/catalog/gravitino.properties new file mode 100644 index 00000000000..cabc15788c2 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/catalog/gravitino.properties @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# +connector.name = gravitino +gravitino.uri = http://GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT +gravitino.metalake = GRAVITINO_METALAKE_NAME +gravitino.cloud.region-code=c2 diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/config.properties b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/config.properties new file mode 100644 index 00000000000..0f2011202f2 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/config.properties @@ -0,0 +1,25 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# + +coordinator=true +node-scheduler.include-coordinator=true +http-server.http.port=8080 +catalog.management=dynamic +discovery.uri=http://0.0.0.0:8080 diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/jvm.config b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/jvm.config new file mode 100644 index 00000000000..c4ee7db21c0 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/jvm.config @@ -0,0 +1,36 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +-XX:InitialRAMPercentage=30 +-XX:MaxRAMPercentage=60 +-XX:G1HeapRegionSize=32M +-XX:+ExplicitGCInvokesConcurrent +-XX:+HeapDumpOnOutOfMemoryError +-XX:+ExitOnOutOfMemoryError +-XX:-OmitStackTraceInFastThrow +-XX:ReservedCodeCacheSize=256M +-XX:PerMethodRecompilationCutoff=10000 +-XX:PerBytecodeRecompilationCutoff=10000 +-Djdk.attach.allowAttachSelf=true +-Djdk.nio.maxCachedBufferSize=2000000 +# Reduce starvation of threads by GClocker, recommend to set about the number of cpu cores (JDK-8192647) +-XX:+UnlockDiagnosticVMOptions +-XX:GCLockerRetryAllocationCount=32 +-DHADOOP_USER_NAME=hive +-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 +-Dlog4j.configurationFile=/etc/trino/log4j2.properties \ No newline at end of file diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/log4j2.properties b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/log4j2.properties new file mode 100644 index 00000000000..c6c18dde3ec --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/config/log4j2.properties @@ -0,0 +1,44 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# Set to debug or trace if log4j initialization is failing +status = info + +# Name of the configuration +name = ConsoleLogConfig + +# Console appender configuration +appender.console.type = Console +appender.console.name = consoleLogger +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n + +# File appender configuration +appender.file.type = File +appender.file.name = fileLogger +appender.file.fileName = gravitino-trino-connector.log +appender.file.layout.type = PatternLayout +appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n + +# Root logger level +rootLogger.level = info + +# Root logger referring to console and file appenders +rootLogger.appenderRef.stdout.ref = consoleLogger +rootLogger.appenderRef.file.ref = fileLogger diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/init.sh b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/init.sh new file mode 100644 index 00000000000..d521b0fbb78 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/init.sh @@ -0,0 +1,58 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# + +set -ex +trino_conf_dir="$(dirname "${BASH_SOURCE-$0}")" +trino_conf_dir="$(cd "${trino_conf_dir}">/dev/null; pwd)" + +cp "$trino_conf_dir/config/config.properties" /etc/trino/config.properties +cp "$trino_conf_dir/config/jvm.config" /etc/trino/jvm.config +cp "$trino_conf_dir/config/log4j2.properties" /etc/trino/log4j2.properties +cp "$trino_conf_dir/config/catalog/gravitino.properties" /etc/trino/catalog/gravitino.properties +# +# Update `gravitino.uri = http://GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT` in the `conf/catalog/gravitino.properties` +sed -i "s/GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT/${GRAVITINO_HOST_IP}:${GRAVITINO_HOST_PORT}/g" /etc/trino/catalog/gravitino.properties +# Update `gravitino.metalake = GRAVITINO_METALAKE_NAME` in the `conf/catalog/gravitino.properties` +sed -i "s/GRAVITINO_METALAKE_NAME/${GRAVITINO_METALAKE_NAME}/g" /etc/trino/catalog/gravitino.properties + + +# Check the number of Gravitino connector plugins present in the Trino plugin directory +num_of_gravitino_connector=$(ls /usr/lib/trino/plugin/gravitino | grep gravitino-trino-connector-* | wc -l) +if [[ "${num_of_gravitino_connector}" -ne 1 ]]; then + echo "Multiple versions of the Gravitino connector plugin found or none present." + exit 1 +fi + +nohup /usr/lib/trino/bin/run-trino & + +counter=0 +while [ $counter -le 300 ]; do + counter=$((counter + 1)) + trino_ready=$(trino --execute "SHOW CATALOGS LIKE 'gravitino'" | wc -l) + if [ "$trino_ready" -eq 0 ]; + then + echo "Wait for the initialization of services" + sleep 1; + else + # persist the container + tail -f /dev/null + fi +done +exit 1 diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/init.sql b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/init.sql new file mode 100644 index 00000000000..25cacb85aa6 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/init/trino-remote/init.sql @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +select 1; diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/inspect_ip.sh b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/inspect_ip.sh new file mode 100755 index 00000000000..c3941a23ad7 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/inspect_ip.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# + +output=$(docker inspect --format='{{.Name}}:{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -q) |grep "/trino-ci-" | sed 's/\/trino-ci-//g') + +gravitino_uri="" +mysql_uri="" +trino_uri="" + +while IFS= read -r line; do + name=$(echo $line | cut -d':' -f1) + ip=$(echo $line | cut -d':' -f2) + + case $name in + trino-local) + gravitino_uri="--gravitino_uri=http://$ip:8090" + trino_uri="--trino_uri=http://$ip:8080" + ;; + mysql) + mysql_uri="--mysql_uri=jdbc:mysql://$ip" + ;; + esac +done <<< "$output" + +echo "$gravitino_uri $mysql_uri $trino_uri --params=trino_remote_jdbc_uri,jdbc:trino://$ip:8080" diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/launch.sh b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/launch.sh new file mode 100755 index 00000000000..59d24759b67 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/launch.sh @@ -0,0 +1,96 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# +#set -ex +cd "$(dirname "${BASH_SOURCE-$0}")" + +GRAVITINO_HOME_DIR=../../../../ +GRAVITINO_SERVER_DIR= +GRAVITINO_TRINO_CONNECTOR_DIR= +GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR= + +GRAVITINO_HOME_DIR=`realpath $GRAVITINO_HOME_DIR` + +source ../check_env.sh +GRAVITINO_SERVER_DIR=$(gravitino_server_dir) +GRAVITINO_TRINO_CONNECTOR_DIR=$(gravitino_trino_connector_dir) +GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR=$(gravitino_trino_cascading_connector_dir) + +if [ ! -z "$1" ]; then + GRAVITINO_SERVER_DIR=$1 +fi + +if [ ! -z "$2" ]; then + GRAVITINO_TRINO_CONNECTOR_DIR=$2 +fi + +if [ ! -z "$3" ]; then + GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR=$3 +fi + +check_environment + +echo "Check depend jars" +source ../download_jar.sh +download_mysql_jar +download_postgresql_jar +download_trino-cascading-connector + +export GRAVITINO_SERVER_DIR=`realpath $GRAVITINO_SERVER_DIR` +export GRAVITINO_TRINO_CONNECTOR_DIR=`realpath $GRAVITINO_TRINO_CONNECTOR_DIR` +export GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR=`realpath $GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR` +echo "GRAVITINO_SERVER_DIR is '$GRAVITINO_SERVER_DIR'" +echo "GRAVITINO_TRINO_CONNECTOR_DIR is '$GRAVITINO_TRINO_CONNECTOR_DIR'" +echo "GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR is '$GRAVITINO_TRINO_CASCADING_CONNECTOR_DIR'" + +echo "Clean gravitino server data" +rm -fr $GRAVITINO_SERVER_DIR/data/*.* + +# create log dir +LOG_DIR=../../build/trino-cascading-env +rm -fr $LOG_DIR +mkdir -p $LOG_DIR +LOG_FILE=$(realpath $LOG_DIR)/docker-compose.log +echo "The docker compose log is: $LOG_FILE" + +docker compose up -d +nohup docker compose logs -f -t > $LOG_FILE & + +max_attempts=300 +attempts=1 + +while true; do + docker compose exec -T trino-local trino --execute "SELECT 1" >/dev/null 2>&1 && { + break; + } + + echo "Check the Trino server startup with try $attempts" + + if [ "$attempts" -ge "$max_attempts" ]; then + echo "ERROR: Trino service did not start within the $max_attempts time." + exit 1 + fi + + ((attempts++)) + sleep 1 +done + +echo "All docker compose service is now available." + diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/run.sh b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/run.sh new file mode 100755 index 00000000000..307a6ebc1fc --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/run.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#args: --auto=none --test_sets_dir=/Users/ice/Documents/workspace/git/graviton/integration-test/trino-cascading-it/testsets --gravitino_uri=http://trino-local.trino-cascading-it.orb.local:8090 --mysql_uri=jdbc:mysql://mysql.trino-cascading-it.orb.local --trino_uri=http://trino-local.trino-cascading-it.orb.local:8080 --params=trino_remote_jdbc_uri,jdbc:trino://trino-remote.trino-cascading-it.orb.local:8080 + +docker compose up +docker compose down diff --git a/trino-connector/integration-test/trino-test-tools/trino-cascading-env/shutdown.sh b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/shutdown.sh new file mode 100755 index 00000000000..f4e009c81b6 --- /dev/null +++ b/trino-connector/integration-test/trino-test-tools/trino-cascading-env/shutdown.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +cd "$(dirname "$0")" + +docker compose down