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

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.2, 2.1.2, 2.2.0
    • 2.2.1, 2.3.0
    • SQL
    • 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

            viirya L. C. Hsieh
            mikelsanvi Mikel San Vicente
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: