You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/07/03 17:06:28 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #41811: [SPARK-44266][SQL] Move Util.truncatedString to sql/api

cloud-fan commented on code in PR #41811:
URL: https://github.com/apache/spark/pull/41811#discussion_r1251127479


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala:
##########
@@ -63,3 +66,39 @@ class StringConcat(val maxLength: Int = ByteArrayUtils.MAX_ROUNDED_ARRAY_LENGTH)
     result.toString
   }
 }
+
+object SparkStringUtils extends Logging {
+  /** Whether we have warned about plan string truncation yet. */
+  private val truncationWarningPrinted = new AtomicBoolean(false)
+
+  /**
+   * Format a sequence with semantics similar to calling .mkString(). Any elements beyond
+   * maxNumToStringFields will be dropped and replaced by a "... N more fields" placeholder.
+   *
+   * @return the trimmed and formatted string.
+   */
+  def truncatedString[T](
+    seq: Seq[T],

Review Comment:
   nit: 4 spaces indentation



-- 
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: reviews-unsubscribe@spark.apache.org

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


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