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

Schema generated by Product Encoder doesn't match case class field name when using non-standard characters

    XMLWordPrintableJSON

    Details

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

      Description

      Product encoder encodes special characters wrongly when field name contains certain nonstandard characters.

      For example for:

      case class MyType(`field.1`: String, `field 2`: String)

      we will get the following schema

      root

      – field$u002E1: string (nullable = true)
      – field$u00202: string (nullable = true)

      As a consequence of this issue a DataFrame with the correct schema can't be converted to a Dataset using .as[MyType]

        Attachments

          Activity

            People

            • Assignee:
              viirya Liang-Chi Hsieh
              Reporter:
              mikelsanvi Mikel San Vicente
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: