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

names() function allows creation of column name containing "-". filter() function subsequently fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: 1.6.1
    • Fix Version/s: 1.6.2
    • Component/s: SparkR
    • Labels:
      None
    • Environment:

      Databricks.com

      Description

      If I assign names to a DataFrame using the names() function, it allows the introduction of "-" characters that caused the filter() function to subsequently fail. I am unclear if other special characters cause similar problems.

      Example:
      sdfCar <- createDataFrame(sqlContext, mtcars)
      names(sdfCar) <- c("mpg", "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am", "gear", "carb-count") # note: carb renamed to carb-count
      sdfCar3 <- filter(sdfCar, carb-count==4)

      Above fails with error: failure: identifier expected carb-count==4. This logic appears to be assuming that the "-" in the column name is a minus sign.

      I am unsure if the problem here is that "" is illegal in a column name, or if the filter function should be able to handle "" in a column name, but one or the other must be wrong.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              neil@dewar-us.com Neil Dewar
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: