From 581494dea89809f950233afafa58f8f5774c88f3 Mon Sep 17 00:00:00 2001 From: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com> Date: Sun, 9 Oct 2022 20:30:00 +0800 Subject: [PATCH] [fix](test) resolve load in tpch_sf100_unique_p2 and tpch_sf10_unique_p2 (#13208) --- .../tpch_sf100_unique_p2/load_four_step/load.groovy | 10 +++++----- .../tpch_sf100_unique_p2/load_one_step/load.groovy | 6 +++--- .../tpch_sf100_unique_p2/load_three_step/load.groovy | 8 ++++---- .../tpch_sf100_unique_p2/load_two_step/load.groovy | 6 +++--- .../tpch_sf10_unique_p2/load_four_step/load.groovy | 10 +++++----- .../tpch_sf10_unique_p2/load_one_step/load.groovy | 6 +++--- .../tpch_sf10_unique_p2/load_three_step/load.groovy | 8 ++++---- .../tpch_sf10_unique_p2/load_two_step/load.groovy | 6 +++--- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/regression-test/suites/tpch_sf100_unique_p2/load_four_step/load.groovy b/regression-test/suites/tpch_sf100_unique_p2/load_four_step/load.groovy index d76a6afdd6..90a77e6c73 100644 --- a/regression-test/suites/tpch_sf100_unique_p2/load_four_step/load.groovy +++ b/regression-test/suites/tpch_sf100_unique_p2/load_four_step/load.groovy @@ -39,10 +39,10 @@ suite("load_four_step") { tables.each { table, rows -> sql """ DROP TABLE IF EXISTS $table """ // create table if not exists - sql new File("""${context.parentFile.parent}/ddl/${table}_sequence.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_sequence.sql""").text def loadLabel1 = table + "_" + uniqueID1 // load data from cos - def loadSql1 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql1 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql1 = loadSql1.replaceAll("\\\$\\{loadLabel\\}", loadLabel1) + s3WithProperties sql loadSql1 // check load state @@ -59,7 +59,7 @@ suite("load_four_step") { assertTrue(loadRowCount[0][0] == rows[0]) } def loadLabel2 = table + "_" + uniqueID2 - def loadSql2 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql2 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql2 = loadSql2.replaceAll("\\\$\\{loadLabel\\}", loadLabel2) + s3WithProperties sql loadSql2 @@ -80,7 +80,7 @@ suite("load_four_step") { sleep(5000) } - sql new File("""${context.parentFile.parent}/ddl/${table}_part_delete.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_part_delete.sql""").text sql 'sync' for (int i = 1; i <= 5; i++) { def loadRowCount = sql "select count(1) from ${table}" @@ -89,7 +89,7 @@ suite("load_four_step") { } def loadLabel3 = table + "_" + uniqueID3 - def loadSql3 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql3 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql3 = loadSql3.replaceAll("\\\$\\{loadLabel\\}", loadLabel3) + s3WithProperties sql loadSql3 diff --git a/regression-test/suites/tpch_sf100_unique_p2/load_one_step/load.groovy b/regression-test/suites/tpch_sf100_unique_p2/load_one_step/load.groovy index 79f4132bad..9804829dc0 100644 --- a/regression-test/suites/tpch_sf100_unique_p2/load_one_step/load.groovy +++ b/regression-test/suites/tpch_sf100_unique_p2/load_one_step/load.groovy @@ -36,10 +36,10 @@ suite("load_one_step") { tables.each { table, rows -> sql """ DROP TABLE IF EXISTS $table """ // create table if not exists - sql new File("""${context.parentFile.parent}/ddl/${table}.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}.sql""").text def loadLabel = table + "_" + uniqueID // load data from cos - def loadSql = new File("""${context.parentFile.parent}/ddl/${table}_load.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql = new File("""${context.file.parentFile.parent}/ddl/${table}_load.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql = loadSql.replaceAll("\\\$\\{loadLabel\\}", loadLabel) + s3WithProperties sql loadSql @@ -56,7 +56,7 @@ suite("load_one_step") { logger.info("select ${table} numbers: ${loadRowCount[0][0]}".toString()) assertTrue(loadRowCount[0][0] == rows) } - sql new File("""${context.parentFile.parent}/ddl/${table}_delete.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_delete.sql""").text for (int i = 1; i <= 5; i++) { def loadRowCount = sql "select count(1) from ${table}" logger.info("select ${table} numbers: ${loadRowCount[0][0]}".toString()) diff --git a/regression-test/suites/tpch_sf100_unique_p2/load_three_step/load.groovy b/regression-test/suites/tpch_sf100_unique_p2/load_three_step/load.groovy index 3b4a94858e..e59e017449 100644 --- a/regression-test/suites/tpch_sf100_unique_p2/load_three_step/load.groovy +++ b/regression-test/suites/tpch_sf100_unique_p2/load_three_step/load.groovy @@ -38,10 +38,10 @@ suite("load_three_step") { tables.each { table, rows -> sql """ DROP TABLE IF EXISTS $table """ // create table if not exists - sql new File("""${context.parentFile.parent}/ddl/${table}_sequence.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_sequence.sql""").text def loadLabel1 = table + "_" + uniqueID1 // load data from cos - def loadSql1 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql1 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql1 = loadSql1.replaceAll("\\\$\\{loadLabel\\}", loadLabel1) + s3WithProperties sql loadSql1 // check load state @@ -58,7 +58,7 @@ suite("load_three_step") { assertTrue(loadRowCount[0][0] == rows) } def loadLabel2 = table + "_" + uniqueID2 - def loadSql2 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql2 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql2 = loadSql2.replaceAll("\\\$\\{loadLabel\\}", loadLabel2) + s3WithProperties sql loadSql2 @@ -79,7 +79,7 @@ suite("load_three_step") { sleep(5000) } - sql new File("""${context.parentFile.parent}/ddl/${table}_delete.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_delete.sql""").text sql 'sync' for (int i = 1; i <= 5; i++) { def loadRowCount = sql "select count(1) from ${table}" diff --git a/regression-test/suites/tpch_sf100_unique_p2/load_two_step/load.groovy b/regression-test/suites/tpch_sf100_unique_p2/load_two_step/load.groovy index 9a2c4baa29..fcf80d8794 100644 --- a/regression-test/suites/tpch_sf100_unique_p2/load_two_step/load.groovy +++ b/regression-test/suites/tpch_sf100_unique_p2/load_two_step/load.groovy @@ -36,11 +36,11 @@ suite("load_two_step") { tables.each { table, rows -> sql """ DROP TABLE IF EXISTS $table """ // create table if not exists - sql new File("""${context.parentFile.parent}/ddl/${table}_sequence.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_sequence.sql""").text def loadLabel = table + "_" + uniqueID // load data from cos - def loadSql = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql = loadSql.replaceAll("\\\$\\{loadLabel\\}", loadLabel) + s3WithProperties sql loadSql @@ -57,7 +57,7 @@ suite("load_two_step") { logger.info("select ${table} numbers: ${loadRowCount[0][0]}".toString()) assertTrue(loadRowCount[0][0] == rows) } - sql new File("""${context.parentFile.parent}/ddl/${table}_delete.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_delete.sql""").text sql 'sync' for (int i = 1; i <= 5; i++) { def loadRowCount = sql "select count(1) from ${table}" diff --git a/regression-test/suites/tpch_sf10_unique_p2/load_four_step/load.groovy b/regression-test/suites/tpch_sf10_unique_p2/load_four_step/load.groovy index 57ac748d1a..716bdc6dbc 100644 --- a/regression-test/suites/tpch_sf10_unique_p2/load_four_step/load.groovy +++ b/regression-test/suites/tpch_sf10_unique_p2/load_four_step/load.groovy @@ -39,10 +39,10 @@ suite("load_four_step") { tables.each { table, rows -> // create table if not exists try{ - sql new File("""${context.parentFile.parent}/ddl/${table}_sequence.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_sequence.sql""").text def loadLabel1 = table + "_" + uniqueID1 // load data from cos - def loadSql1 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql1 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql1 = loadSql1.replaceAll("\\\$\\{loadLabel\\}", loadLabel1) + s3WithProperties sql loadSql1 // check load state @@ -59,7 +59,7 @@ suite("load_four_step") { assertTrue(loadRowCount[0][0] == rows[0]) } def loadLabel2 = table + "_" + uniqueID2 - def loadSql2 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql2 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql2 = loadSql2.replaceAll("\\\$\\{loadLabel\\}", loadLabel2) + s3WithProperties sql loadSql2 @@ -80,7 +80,7 @@ suite("load_four_step") { sleep(5000) } - sql new File("""${context.parentFile.parent}/ddl/${table}_part_delete.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_part_delete.sql""").text for (int i = 1; i <= 5; i++) { def loadRowCount = sql "select count(1) from ${table}" logger.info("select ${table} numbers: ${loadRowCount[0][0]}".toString()) @@ -88,7 +88,7 @@ suite("load_four_step") { } def loadLabel3 = table + "_" + uniqueID3 - def loadSql3 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql3 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql3 = loadSql3.replaceAll("\\\$\\{loadLabel\\}", loadLabel3) + s3WithProperties sql loadSql3 diff --git a/regression-test/suites/tpch_sf10_unique_p2/load_one_step/load.groovy b/regression-test/suites/tpch_sf10_unique_p2/load_one_step/load.groovy index ef175eea13..c7b4c94223 100644 --- a/regression-test/suites/tpch_sf10_unique_p2/load_one_step/load.groovy +++ b/regression-test/suites/tpch_sf10_unique_p2/load_one_step/load.groovy @@ -36,10 +36,10 @@ suite("load_one_step") { tables.each { table, rows -> // create table if not exists try{ - sql new File("""${context.parentFile.parent}/ddl/${table}.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}.sql""").text def loadLabel = table + "_" + uniqueID // load data from cos - def loadSql = new File("""${context.parentFile.parent}/ddl/${table}_load.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql = new File("""${context.file.parentFile.parent}/ddl/${table}_load.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql = loadSql.replaceAll("\\\$\\{loadLabel\\}", loadLabel) + s3WithProperties sql loadSql @@ -56,7 +56,7 @@ suite("load_one_step") { logger.info("select ${table} numbers: ${loadRowCount[0][0]}".toString()) assertTrue(loadRowCount[0][0] == rows) } - sql new File("""${context.parentFile.parent}/ddl/${table}_delete.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_delete.sql""").text for (int i = 1; i <= 5; i++) { def loadRowCount = sql "select count(1) from ${table}" logger.info("select ${table} numbers: ${loadRowCount[0][0]}".toString()) diff --git a/regression-test/suites/tpch_sf10_unique_p2/load_three_step/load.groovy b/regression-test/suites/tpch_sf10_unique_p2/load_three_step/load.groovy index b2bcf88209..2fa9cd2829 100644 --- a/regression-test/suites/tpch_sf10_unique_p2/load_three_step/load.groovy +++ b/regression-test/suites/tpch_sf10_unique_p2/load_three_step/load.groovy @@ -38,10 +38,10 @@ suite("load_three_step") { tables.each { table, rows -> // create table if not exists try{ - sql new File("""${context.parentFile.parent}/ddl/${table}_sequence.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_sequence.sql""").text def loadLabel1 = table + "_" + uniqueID1 // load data from cos - def loadSql1 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql1 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql1 = loadSql1.replaceAll("\\\$\\{loadLabel\\}", loadLabel1) + s3WithProperties sql loadSql1 // check load state @@ -58,7 +58,7 @@ suite("load_three_step") { assertTrue(loadRowCount[0][0] == rows) } def loadLabel2 = table + "_" + uniqueID2 - def loadSql2 = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql2 = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql2 = loadSql2.replaceAll("\\\$\\{loadLabel\\}", loadLabel2) + s3WithProperties sql loadSql2 @@ -79,7 +79,7 @@ suite("load_three_step") { sleep(5000) } - sql new File("""${context.parentFile.parent}/ddl/${table}_delete.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_delete.sql""").text for (int i = 1; i <= 5; i++) { sql 'sync' def loadRowCount = sql "select count(1) from ${table}" diff --git a/regression-test/suites/tpch_sf10_unique_p2/load_two_step/load.groovy b/regression-test/suites/tpch_sf10_unique_p2/load_two_step/load.groovy index 4fa71e5d9d..f0deb2c66d 100644 --- a/regression-test/suites/tpch_sf10_unique_p2/load_two_step/load.groovy +++ b/regression-test/suites/tpch_sf10_unique_p2/load_two_step/load.groovy @@ -36,11 +36,11 @@ suite("load_two_step") { tables.each { table, rows -> // create table if not exists try{ - sql new File("""${context.parentFile.parent}/ddl/${table}_sequence.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_sequence.sql""").text def loadLabel = table + "_" + uniqueID // load data from cos - def loadSql = new File("""${context.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) + def loadSql = new File("""${context.file.parentFile.parent}/ddl/${table}_load_sequence.sql""").text.replaceAll("\\\$\\{s3BucketName\\}", s3BucketName) loadSql = loadSql.replaceAll("\\\$\\{loadLabel\\}", loadLabel) + s3WithProperties sql loadSql @@ -57,7 +57,7 @@ suite("load_two_step") { logger.info("select ${table} numbers: ${loadRowCount[0][0]}".toString()) assertTrue(loadRowCount[0][0] == rows) } - sql new File("""${context.parentFile.parent}/ddl/${table}_delete.sql""").text + sql new File("""${context.file.parentFile.parent}/ddl/${table}_delete.sql""").text for (int i = 1; i <= 5; i++) { def loadRowCount = sql "select count(1) from ${table}" logger.info("select ${table} numbers: ${loadRowCount[0][0]}".toString())