-
Notifications
You must be signed in to change notification settings - Fork 608
[CORE] Fix GlutenConfig runtime modifiability #12036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
2c62a35
eefc609
6f41355
4da9729
0703881
1a83774
f0c144a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,4 +18,37 @@ package org.apache.spark.sql.execution | |
|
|
||
| import org.apache.spark.sql.GlutenSQLTestsBaseTrait | ||
|
|
||
| class GlutenSparkSqlParserSuite extends SparkSqlParserSuite with GlutenSQLTestsBaseTrait {} | ||
| import org.scalactic.source.Position | ||
| import org.scalatest.Tag | ||
|
|
||
| class GlutenSparkSqlParserSuite extends SparkSqlParserSuite with GlutenSQLTestsBaseTrait { | ||
| private var registerQuotedConfigParserTest = false | ||
|
|
||
| override protected def test(testName: String, testTags: Tag*)(testFun: => Any)(implicit | ||
| pos: Position): Unit = { | ||
| if (isConfigParserCoverage(testName) && !registerQuotedConfigParserTest) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean the original Spark test is excluded and replaced by the variant test? If so, can we just exclude it in VeloxTestSettings.scala and let the variant be tested instead?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @philo-he, addressed. I removed the custom |
||
| () | ||
| } else { | ||
| super.test(testName, testTags: _*)(testFun)(pos) | ||
| } | ||
| } | ||
|
|
||
| registerQuotedConfigParserTest = true | ||
| test("Checks if SET/RESET can parse all the configurations") { | ||
| sqlConf.getAllDefinedConfs.map(_._1).foreach { | ||
| key: String => | ||
| val quotedKey = quoteConfigKey(key) | ||
| spark.sessionState.sqlParser.parsePlan(s"SET $quotedKey") | ||
| spark.sessionState.sqlParser.parsePlan(s"RESET $quotedKey") | ||
| } | ||
| } | ||
| registerQuotedConfigParserTest = false | ||
|
|
||
| private def isConfigParserCoverage(testName: String): Boolean = { | ||
| testName == "Checks if SET/RESET can parse all the configurations" | ||
| } | ||
|
|
||
| private def quoteConfigKey(key: String): String = { | ||
| s"`${key.replace("`", "``")}`" | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move these two tests to a new test suite under gluten-ut/test? Generally, the spark{VERSION} folders are used for Spark's original tests and their version-specific variants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @philo-he, moved these two Gluten-specific tests into a new shared suite under
gluten-ut/test:org.apache.gluten.config.GlutenRuntimeConfigSuite.I also restored the Spark 4.0 / 4.1
GlutenRuntimeConfigSuitefiles to only wrap Spark's originalRuntimeConfigSuite.