You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2022/01/02 00:49:00 UTC
[jira] [Commented] (SPARK-37800) TreeNode.argString incorrectly formats arguments of type Set[_]
[ https://issues.apache.org/jira/browse/SPARK-37800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467525#comment-17467525 ]
Hyukjin Kwon commented on SPARK-37800:
--------------------------------------
Yeah, from a cursory look, what you said here sounds sane. interested in creating a PR?
> TreeNode.argString incorrectly formats arguments of type Set[_]
> ---------------------------------------------------------------
>
> Key: SPARK-37800
> URL: https://issues.apache.org/jira/browse/SPARK-37800
> Project: Spark
> Issue Type: Bug
> Components: Spark Core
> Affects Versions: 3.2.0
> Reporter: Simeon Simeonov
> Priority: Minor
>
> The implementation of {{argString}} uses the following pattern for sets:
>
> {code:java}
> case set: Set[_] =>
> // Sort elements for deterministic behaviours
> val sortedSeq = set.toSeq.map(formatArg(_, maxFields).sorted)
> truncatedString(sortedSeq, "{", ", ", "}", maxFields) :: Nil {code}
> Instead of sorting the elements of the set, the implementation sorts the characters of the strings that {{formatArg}} returns.
> The fix is simply to move the closing parenthesis to the correct location:
> {code:java}
> val sortedSeq = set.toSeq.map(formatArg(_, maxFields)).sorted
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org