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


##########
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:
   
   > Why is the filter condition `where key=1` added everywhere
   
    Based on @yaooqinn  suggestion, the data  preparation was moved to the 
setup method, which caused some changes in the data. The original test cases 
need to be modified by adding a where condition to keep searching for the 
original data.
   



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