Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/10452#discussion_r48405397
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala ---
@@ -108,6 +108,19 @@ abstract class JdbcDialect extends Serializable {
def beforeFetch(connection: Connection, properties: Map[String,
String]): Unit = {
}
+ /**
+ * Mask the credential information in the url string. Dialects should
overwrite
+ * this method to mask according to according to database the specific
url pattern.
+ * @param url the jdbc connection url.
+ * @return The url with credentials masked.
+ */
+ def maskCredentials(url: String): String = {
+ // Following regex attempts to captures the common pattern in the
urls, when
+ // pattern does not match only url prefix is returned.
+ ("""(.)password=""".r findFirstIn url) map { x =>
--- End diff --
Don't use the postfix syntax -- just write the normal "." and "()"
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]