You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "yaooqinn (via GitHub)" <gi...@apache.org> on 2023/04/06 04:09:04 UTC

[GitHub] [kyuubi] yaooqinn commented on a diff in pull request #4643: [KYUUBI #4530] [AUTHZ] Resolve the issue of MASK, MASK_SHOW_FIRST_4, and MASK_SHOW_FIRST_4 not supporting the data mask of non-English characters

yaooqinn commented on code in PR #4643:
URL: https://github.com/apache/kyuubi/pull/4643#discussion_r1159262072


##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/datamasking/DataMaskingTestBase.scala:
##########
@@ -260,4 +260,51 @@ trait DataMaskingTestBase extends AnyFunSuite with SparkSessionProvider with Bef
         Seq(Row(md5Hex("1"), "hello")))
     }
   }
+
+  // This test method must be executed as the last one,
+  //  otherwise it may cause errors in the above test methods.
+  test("test MASK,MASK_SHOW_FIRST_4,MASK_SHOW_LAST_4 rule  with non-English character set") {
+    /* Although not all language character sets have been tested,
+       it applies to all non-English character sets.
+       This test mainly includes the UCS-2 character set.
+     */
+    // scalastyle:off
+    // AßþΔЙקم๗ቐあア叶葉엽 reference https://zh.wikipedia.org/zh-cn/Unicode#XML.E5.92.8CUnicode
+    val value1 = "hello WORD 123 ~!@# AßþΔЙקم๗ቐあア叶葉엽"
+    val value2 = "AßþΔЙקم๗ቐあア叶葉엽 hello WORD 123 ~!@#"
+    // scalastyle:on
+    doAs(
+      "admin",
+      sql(s"INSERT INTO default.src " +
+        s"SELECT 10, 4, '$value1', '$value1', timestamp'2018-11-17 12:34:56', '$value1'"))

Review Comment:
   Can we move the data preparation to `setup`? Because it may become flaky when we add new tests in the future



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org