-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17783] [SQL] Hide Credentials in CREATE and DESC FORMATTED/EXTENDED a PERSISTENT/TEMP Table for JDBC #15358
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 1 commit
d3cc470
aa1de2c
86e6b5c
bc9a508
08dd522
45e0ee3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -767,16 +767,4 @@ object DDLUtils { | |
| } | ||
| } | ||
|
|
||
|
||
| /** | ||
| * Masking credentials in the option lists. For example, in the sql plan explain output | ||
| * for JDBC data sources. | ||
| */ | ||
| def maskCredentials(options: Map[String, String]): Map[String, String] = { | ||
| options.map { | ||
| case (password, _) if password.toLowerCase == "password" => (password, "###") | ||
| case (url, value) if url.toLowerCase == "url" && value.toLowerCase.contains("password") => | ||
| (url, "###") | ||
| case o => o | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,10 +19,10 @@ package org.apache.spark.sql.execution.datasources | |
|
|
||
| import org.apache.spark.sql._ | ||
| import org.apache.spark.sql.catalyst.TableIdentifier | ||
| import org.apache.spark.sql.catalyst.catalog.CatalogTable | ||
| import org.apache.spark.sql.catalyst.catalog.{CatalogTable, CatalogUtils} | ||
| import org.apache.spark.sql.catalyst.plans.QueryPlan | ||
| import org.apache.spark.sql.catalyst.plans.logical.{Command, LogicalPlan} | ||
| import org.apache.spark.sql.execution.command.{DDLUtils, RunnableCommand} | ||
| import org.apache.spark.sql.execution.command.RunnableCommand | ||
| import org.apache.spark.sql.types._ | ||
|
|
||
| case class CreateTable( | ||
|
|
@@ -61,7 +61,7 @@ case class CreateTempViewUsing( | |
| userSpecifiedSchema.getOrElse("") + | ||
|
||
| s"replace:$replace " + | ||
| s"provider:$provider " + | ||
| DDLUtils.maskCredentials(options) | ||
| CatalogUtils.maskCredentials(options) | ||
| } | ||
|
|
||
| def run(sparkSession: SparkSession): Seq[Row] = { | ||
|
|
||
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.
NIT: string interpolation not needed.