Skip to content

Commit

Permalink
[GLUTEN-7665] Remove duplicated tpch/tpcds queries resources (apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
marin-ma authored and yikf committed Oct 28, 2024
1 parent 431851f commit 4cdc2e3
Show file tree
Hide file tree
Showing 306 changed files with 29 additions and 10,391 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ object RunTPCHTest {
FileUtils.forceMkdir(new File(warehouse))
FileUtils.forceMkdir(new File(metaStorePathAbsolute))

val resourcePath = rootPath + "../../../../gluten-core/src/test/resources/"
val resourcePath = rootPath + "../../../../tools/gluten-it/common/src/main/resources/"
val queryPath = resourcePath + "/tpch-queries/"
// which sql to execute
val sqlFilePath = queryPath + "q01.sql"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class GlutenClickHouseDecimalSuite

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"
override protected val createNullableTables = true
override protected def createTPCHNotNullTables(): Unit = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GlutenClickHouseFileFormatSuite

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"

protected val orcDataPath: String = rootPath + "orc-data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GlutenClickHouseJoinSuite extends GlutenClickHouseWholeStageTransformerSui

protected val tablesPath: String = basePath + "/tpch-data"
protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
protected val queriesResults: String = rootPath + "queries-output"

private val joinAlgorithm = CHConf.runtimeSettings("join_algorithm")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GlutenClickHouseS3SourceSuite extends GlutenClickHouseTPCHAbstractSuite {

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"

override protected def sparkConf: SparkConf = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class GlutenClickHouseTPCDSAbstractSuite
protected val tablesPath: String = UTSystemParameters.tpcdsDecimalDataPath + "/"
protected val db_name: String = "tpcdsdb"
protected val tpcdsQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpcds-queries/tpcds.queries.original"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpcds-queries"
protected val queriesResults: String = rootPath + "tpcds-decimal-queries-output"

/** Return values: (sql num, is fall back) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ abstract class GlutenClickHouseTPCHAbstractSuite
noFallBack: Boolean = true)(customCheck: DataFrame => Unit): Unit = withDataFrame(sqlStr) {
df =>
if (compareResult) {
verifyTPCHResult(df, s"q${"%02d".format(queryNum)}", queriesResults)
verifyTPCHResult(df, s"q$queryNum", queriesResults)
} else {
df.collect()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GlutenFunctionValidateSuite extends GlutenClickHouseWholeStageTransformerS

protected val tablesPath: String = basePath + "/tpch-data"
protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
protected val queriesResults: String = rootPath + "queries-output"

private var parquetPath: String = _
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GlutenClickhouseFunctionSuite extends GlutenClickHouseTPCHAbstractSuite {

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"

override protected def createTPCHNotNullTables(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GlutenCustomAggExpressionSuite extends GlutenClickHouseTPCHAbstractSuite {

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"

override protected def sparkConf: SparkConf = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class GlutenClickHouseTPCHMetricsSuite extends GlutenClickHouseTPCHAbstractSuite
override protected val needCopyParquetToTablePath = true

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
override protected val tpchQueries: String = rootPath + "queries/tpch-queries-ch"
override protected val queriesResults: String = rootPath + "queries-output"

protected val metricsJsonFilePath: String = rootPath + "metrics-json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class GlutenParquetFilterSuite
with GlutenTPCHBase
with Logging {

private val tpchQueriesResourceFolder: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
private val tpchQueriesResourceFolder: String = rootPath + "queries/tpch-queries-ch"

override protected def sparkConf: SparkConf =
super.sparkConf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GlutenClickHouseDatetimeExpressionSuite

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"

/** Run Gluten + ClickHouse Backend with SortShuffleManager */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GlutenClickHouseHDFSSuite

override protected val tablesPath: String = HDFS_URL_ENDPOINT + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"

private val hdfsCachePath = "/tmp/gluten_hdfs_cache/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class GlutenClickHouseTPCHColumnarShuffleParquetAQESuite
override protected val needCopyParquetToTablePath = true

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
override protected val tpchQueries: String = rootPath + "queries/tpch-queries-ch"
override protected val queriesResults: String = rootPath + "queries-output"

/** Run Gluten + ClickHouse Backend with SortShuffleManager */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class GlutenClickHouseTPCHParquetAQEConcurrentSuite

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"

/** Run Gluten + ClickHouse Backend with SortShuffleManager */
Expand All @@ -54,14 +54,13 @@ class GlutenClickHouseTPCHParquetAQEConcurrentSuite
queriesResults: String,
compareResult: Boolean = true,
noFallBack: Boolean = true)(customCheck: DataFrame => Unit): Unit = {
val sqlNum = "q" + "%02d".format(queryNum)
withDataFrame(tpchSQL(queryNum, tpchQueries)) {
df =>
val result = df.collect()
if (compareResult) {
val schema = df.schema
if (schema.exists(_.dataType == DoubleType)) {} else {
compareResultStr(sqlNum, result, queriesResults)
compareResultStr(s"q$queryNum", result, queriesResults)
}
} else {
df.collect()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class GlutenClickHouseTPCHParquetAQESuite
override protected val needCopyParquetToTablePath = true

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
override protected val tpchQueries: String = rootPath + "queries/tpch-queries-ch"
override protected val queriesResults: String = rootPath + "queries-output"

/** Run Gluten + ClickHouse Backend with SortShuffleManager */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class GlutenClickHouseTPCHParquetBucketSuite

override protected val tablesPath: String = basePath + "/tpch-data-ch"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"

protected val bucketTableResourcePath: String = rootPath + "tpch-data-bucket/parquet_bucket"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class GlutenClickHouseTPCHSaltNullParquetSuite extends GlutenClickHouseTPCHAbstr

override protected val tablesPath: String = basePath + "/tpch-data"
override protected val tpchQueries: String =
rootPath + "../../../../gluten-core/src/test/resources/tpch-queries"
rootPath + "../../../../tools/gluten-it/common/src/main/resources/tpch-queries"
override protected val queriesResults: String = rootPath + "queries-output"

override protected def sparkConf: SparkConf = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class VeloxTPCDSSuite extends VeloxWholeStageTransformerSuite {
override protected val fileFormat: String = "parquet"

private val queryPath = System.getProperty("user.dir") +
"/gluten-core/src/test/resources/tpcds-queries/tpcds.queries.original/"
"/tools/gluten-it/common/src/main/resources/tpcds-queries"

protected var queryTables: Map[String, DataFrame] = _

Expand Down
4 changes: 2 additions & 2 deletions docs/get-started/Velox.md
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,8 @@ All TPC-H and TPC-DS queries are supported in Gluten Velox backend.
The data generation scripts are [TPC-H dategen script](../../tools/workload/tpch/gen_data/parquet_dataset/tpch_datagen_parquet.sh) and
[TPC-DS dategen script](../../tools/workload/tpcds/gen_data/parquet_dataset/tpcds_datagen_parquet.sh).

The used TPC-H and TPC-DS queries are the original ones, and can be accessed from [TPC-DS queries](../../gluten-core/src/test/resources/tpcds-queries/tpcds.queries.original)
and [TPC-H queries](../../gluten-core/src/test/resources/tpch-queries).
The used TPC-H and TPC-DS queries are the original ones, and can be accessed from [TPC-DS queries](../../tools/gluten-it/common/src/main/resources/tpcds-queries)
and [TPC-H queries](../../tools/gluten-it/common/src/main/resources/tpch-queries).

Some other versions of TPC-DS queries are also provided, but are **not** recommended for testing, including:

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4cdc2e3

Please sign in to comment.