vanzin commented on a change in pull request #23169: [SPARK-26103][SQL] Limit
the length of debug strings for query plans
URL: https://github.com/apache/spark/pull/23169#discussion_r264385082
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/StringUtilsSuite.scala
##########
@@ -56,4 +56,32 @@ class StringUtilsSuite extends SparkFunSuite {
assert(concat("1", "2") == "12")
assert(concat("abc", "\n", "123") == "abc\n123")
}
+
+ test("string concatenation with limit") {
+ def concat(seq: String*): String = {
+ seq.foldLeft(new StringConcat(7))((acc, s) => {acc.append(s);
acc}).toString
+ }
+ assert(concat("under") == "under")
+ assert(concat("under", "over", "extra") == "underov")
+ assert(concat("underover") == "underov")
+ assert(concat("under", "ov") == "underov")
+ }
+
+ test("string concatenation return value") {
+ def checkLimit(s: String): Boolean = {
+ val sc = new StringConcat(7)
+ sc.append(s)
+ sc.atLimit
+ }
+ assert(checkLimit("under") == false)
Review comment:
yes
----------------------------------------------------------------
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]