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

Incorrect results of printing Array/Map/Struct in showString

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.3.0
    • Component/s: SQL
    • Labels:
      None

      Description

      The current `Datset.showString` prints rows thru `RowEncoder` deserializers like;

      scala> Seq(Seq(Seq(1, 2), Seq(3), Seq(4, 5, 6))).toDF("a").show(false)
      +------------------------------------------------------------+
      |a                                                           |
      +------------------------------------------------------------+
      |[WrappedArray(1, 2), WrappedArray(3), WrappedArray(4, 5, 6)]|
      +------------------------------------------------------------+
      

      This result is incorrect because the correct one is;

      scala> Seq(Seq(Seq(1, 2), Seq(3), Seq(4, 5, 6))).toDF("a").show(false)
      +------------------------+
      |a                       |
      +------------------------+
      |[[1, 2], [3], [4, 5, 6]]|
      +------------------------+
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                maropu Takeshi Yamamuro
                Reporter:
                maropu Takeshi Yamamuro
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: