dongjoon-hyun commented on a change in pull request #24800: [SPARK-27947][SQL] 
ParsedStatement subclass toString may throw ClassCastException
URL: https://github.com/apache/spark/pull/24800#discussion_r291824015
 
 

 ##########
 File path: core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
 ##########
 @@ -1120,6 +1119,19 @@ class UtilsSuite extends SparkFunSuite with 
ResetSystemProperties with Logging {
     assert(redactedCmdArgMap("spark.sensitive.property") === 
Utils.REDACTION_REPLACEMENT_TEXT)
   }
 
+  test("redact sensitive information in sequence of key value pairs") {
+    val secretKeys = Some("my.password".r)
+    assert(Utils.redact(secretKeys, Seq(("spark.my.password", "12345"))) ===
+      Seq(("spark.my.password", Utils.REDACTION_REPLACEMENT_TEXT)))
+    assert(Utils.redact(secretKeys, Seq(("anything", 
"spark.my.password=12345"))) ===
+      Seq(("anything", Utils.REDACTION_REPLACEMENT_TEXT)))
+    assert(Utils.redact(secretKeys, Seq((999, "spark.my.password=12345"))) ===
+      Seq((999, Utils.REDACTION_REPLACEMENT_TEXT)))
+    // Impossible to redact when value type is not string
 
 Review comment:
   `Impossible` might be misleading. For non-human-readable types, it's simply 
`no-op` reasonably.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to