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


##########
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:
   I originally wanted to put it in the setup method, but putting it there 
caused several old test cases to fail. We need to modify the old test cases, 
such as adding a where clause in the old test cases. Do you mind this 
implementation approach?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to