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

Document no exception using DataFrame.withColumnRenamed when existing column doesn't exist

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.0
    • Fix Version/s: 2.0.1
    • Component/s: Documentation, PySpark
    • Labels:
      None

      Description

      The withColumnRenamed method does not raise an exception when the existing column does not exist in the dataframe.

      Example:

      In [4]: df.show()
      +---+-----+
      |age| name|
      +---+-----+
      |  1|Alice|
      +---+-----+
      
      
      In [5]: df = df.withColumnRenamed('dob', 'date_of_birth')
      
      In [6]: df.show()
      +---+-----+
      |age| name|
      +---+-----+
      |  1|Alice|
      +---+-----+
      

        Attachments

          Activity

            People

            • Assignee:
              dongjoon Dongjoon Hyun
              Reporter:
              tomwphillips Tom Phillips
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: