You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/08/30 06:24:29 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #25458: [SPARK-27931][SQL] Accept "true", "yes", "1", "false", "no", "0", and unique prefixes as input and trim input for the boolean data type.

cloud-fan commented on a change in pull request #25458: [SPARK-27931][SQL] Accept "true", "yes", "1", "false", "no", "0", and unique prefixes as input and trim input for the boolean data type.
URL: https://github.com/apache/spark/pull/25458#discussion_r319370632
 
 

 ##########
 File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
 ##########
 @@ -819,19 +819,32 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
   }
 
   test("cast string to boolean") {
-    checkCast("t", true)
+
     checkCast("true", true)
+    checkCast("tru", true)
+    checkCast("tr", true)
+    checkCast("t", true)
     checkCast("tRUe", true)
-    checkCast("y", true)
+    checkCast("    tRue   ", true)
+    checkCast("    tRu   ", true)
     checkCast("yes", true)
+    checkCast("ye", true)
+    checkCast("y", true)
     checkCast("1", true)
+    checkCast("on", true)
 
-    checkCast("f", false)
     checkCast("false", false)
-    checkCast("FAlsE", false)
-    checkCast("n", false)
+    checkCast("fals", false)
+    checkCast("fal", false)
+    checkCast("fa", false)
+    checkCast("f", false)
+    checkCast("    fAlse    ", false)
+    checkCast("    fAls    ", false)
     checkCast("no", false)
+    checkCast("n", false)
     checkCast("0", false)
+    checkCast("off", false)
+    checkCast("of", false)
 
 Review comment:
   SGTM

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org