Uh oh!
There was an error while loading. Please reload this page.
[SPARK-22479][SQL] Exclude credentials from SaveintoDataSourceCommand.simpleString - #19708
[SPARK-22479][SQL] Exclude credentials from SaveintoDataSourceCommand.simpleString#19708onursatici wants to merge 7 commits into
Conversation
ash211
commented
Nov 9, 2017
Jenkins, this is ok to test |
SparkQA
commented
Nov 9, 2017
Test build #83652 has finished for PR 19708 at commit
|
| Seq.empty[Row] | ||
| } | ||
| override def simpleString: String = s"SaveIntoDataSourceCommand ${dataSource}, ${mode}" |
There was a problem hiding this comment.
Reuse spark.redaction.regex?
There was a problem hiding this comment.
I can use that, but I would need to expand the default for spark.redaction.regex as the user and url (some drivers allow credentials passed in the connection url) fields might also contain sensitive data. We should also change JDBCRelation::toString to include the redaction regex to be consistent.
I would argue not showing the jdbc properties at all because they provide little value and wrong redaction regex configuration could cause leaks to downstream log collection systems.
let me know if that makes sense, and I can modify this accordingly
There was a problem hiding this comment.
SaveIntoDataSourceCommand is not being used for JDBC only.
JDBCRelation::toString was already fixed in #15975 ?
SparkQA
commented
Nov 13, 2017
Test build #83799 has finished for PR 19708 at commit
|
SparkQA
commented
Nov 13, 2017
Test build #83810 has finished for PR 19708 at commit
|
ae091ec to
56f48f3Comparegatorsmile
commented
Nov 13, 2017
Just want to confirm whether the examples in the PR description are the ones based on the latest updates? |
gatorsmile
commented
Nov 13, 2017
Generally, this looks good to me. |
hvanhovell
commented
Nov 13, 2017
This looks good. I was wondering if we shouldn't also take a look at data source operations like Could you also add a test? |
SparkQA
commented
Nov 13, 2017
Test build #83811 has finished for PR 19708 at commit
|
Yeah PR description reflects the latest changes. |
SparkQA
commented
Nov 15, 2017
Test build #83864 has finished for PR 19708 at commit
|
| override protected def sparkConf: SparkConf = super.sparkConf | ||
| .set("spark.redaction.string.regex", "(?i)password|url") | ||
| test("treeString is redacted") { |
There was a problem hiding this comment.
old test name? we're not modifying the treeString anymore, it's just the SaveIntoDataSourceCommand
There was a problem hiding this comment.
I followed the naming convention here:
we are essentially redacting SaveIntoDataSourceCommand::simpleString which is called in SaceIntoDataSourceCommand::treeString
There was a problem hiding this comment.
That is not really a convention. Can you just call it simpleString is redacted?
| class SaveIntoDataSourceCommandSuite extends SharedSQLContext { | ||
| override protected def sparkConf: SparkConf = super.sparkConf | ||
| .set("spark.redaction.string.regex", "(?i)password|url") |
There was a problem hiding this comment.
Shoundn't this be spark.redaction.regex instead of spark.redaction.string.regex?
| class SaveIntoDataSourceCommandSuite extends SharedSQLContext { | ||
| override protected def sparkConf: SparkConf = super.sparkConf | ||
| .set("spark.redaction.regex", "(?i)password|url") |
SparkQA
commented
Nov 15, 2017
Test build #83895 has finished for PR 19708 at commit
|
gatorsmile
commented
Nov 15, 2017
LGTM |
SparkQA
commented
Nov 15, 2017
Test build #83896 has finished for PR 19708 at commit
|
SparkQA
commented
Nov 15, 2017
Test build #83901 has finished for PR 19708 at commit
|
gatorsmile
commented
Nov 15, 2017
Thanks! Merged to master. @onursatici Could you submit a separate PR for 2.2? |
What changes were proposed in this pull request?
Do not include jdbc properties which may contain credentials in logging a logical plan with
SaveIntoDataSourceCommandin it.How was this patch tested?
building locally and trying to reproduce (per the steps in https://issues.apache.org/jira/browse/SPARK-22479):