Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-37800

TreeNode.argString incorrectly formats arguments of type Set[_]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.2.0
    • 3.2.1, 3.3.0
    • SQL
    • None

    Description

      The implementation of argString uses the following pattern for sets:

       

      case set: Set[_] =>
        // Sort elements for deterministic behaviours
        val sortedSeq = set.toSeq.map(formatArg(_, maxFields).sorted)                                                              
        truncatedString(sortedSeq, "{", ", ", "}", maxFields) :: Nil 

      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:

        val sortedSeq = set.toSeq.map(formatArg(_, maxFields)).sorted
      

       

      Attachments

        Activity

          People

            simeons Simeon Simeonov
            simeons Simeon Simeonov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: