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

Pandas to DataFrame conversion should check field names for periods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.0
    • None
    • SQL
    • None

    Description

      Issue I ran into: I imported an R dataset in CSV format into a Pandas DataFrame and then use toDF() to convert that into a Spark DataFrame. The R dataset had a column with a period in it (column "GNP.deflator" in the "longley" dataset). When I tried to select it using the Spark DataFrame DSL, I could not because the DSL thought the period was selecting a field within GNP.

      Also, since "GNP" is another field's name, it gives an error which could be obscure to users, complaining:

      org.apache.spark.sql.AnalysisException: GetField is not valid on fields of type DoubleType;
      

      We should either handle periods in column names or check during loading and warn/fail gracefully.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              josephkb Joseph K. Bradley
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: