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

Can't drop columns that contain dots

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 2.0.0
    • SQL
    • None

    Description

      Neither of theses works:

      val df = Seq((1, 1)).toDF("a_b", "a.c")
      df.drop("a.c").collect()
      
      df: org.apache.spark.sql.DataFrame = [a_b: int, a.c: int]
      
      val df = Seq((1, 1)).toDF("a_b", "a.c")
      df.drop("`a.c`").collect()
      
      df: org.apache.spark.sql.DataFrame = [a_b: int, a.c: int]
      

      Given that you can't use drop to drop subfields, it seems to me that we should treat the column name literally (i.e. as though it is wrapped in back ticks).

      Attachments

        Issue Links

          Activity

            People

              clockfly@gmail.com Xiang Zhong
              marmbrus Michael Armbrust
              Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: