-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-30416][SQL] Log a warning for deprecated SQL config in set() and unset()
#27092
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
Changes from 3 commits
a59c700
73a3790
722ddaa
f9a2dcd
e93f587
496ca8c
faf88e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,12 @@ | |
|
|
||
| package org.apache.spark.sql.internal | ||
|
|
||
| import scala.collection.mutable.ArrayBuffer | ||
| import scala.language.reflectiveCalls | ||
|
|
||
| import org.apache.hadoop.fs.Path | ||
| import org.apache.log4j.{AppenderSkeleton, Level} | ||
| import org.apache.log4j.spi.LoggingEvent | ||
|
|
||
| import org.apache.spark.sql._ | ||
| import org.apache.spark.sql.internal.StaticSQLConf._ | ||
|
|
@@ -330,4 +335,31 @@ class SQLConfSuite extends QueryTest with SharedSparkSession { | |
| } | ||
| assert(e.getMessage.contains(config)) | ||
| } | ||
|
|
||
| test("log deprecation warnings") { | ||
| val logAppender = new AppenderSkeleton { | ||
|
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. nit: The same class
Member
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. it is slightly orthogonal to the PR but if you think it makes sense I will do that here.
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. Yea, I think its ok in follow-up. |
||
| val loggingEvents = new ArrayBuffer[LoggingEvent]() | ||
|
|
||
| override def append(loggingEvent: LoggingEvent): Unit = loggingEvents.append(loggingEvent) | ||
| override def close(): Unit = {} | ||
| override def requiresLayout(): Boolean = false | ||
| } | ||
| def check(config: String): Unit = { | ||
| assert(logAppender.loggingEvents.exists( | ||
| e => e.getLevel == Level.WARN && | ||
| e.getRenderedMessage.contains(config))) | ||
| } | ||
|
|
||
| val config1 = "spark.sql.hive.verifyPartitionPath" | ||
| withLogAppender(logAppender) { | ||
| spark.conf.set(config1, true) | ||
| } | ||
| check(config1) | ||
|
|
||
| val config2 = "spark.sql.execution.pandas.respectSessionTimeZone" | ||
| withLogAppender(logAppender) { | ||
| spark.conf.unset(config2) | ||
| } | ||
| check(config2) | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.