Skip to content
  • Sheamus K. Parkes's avatar
    7b64f7aa
    [SPARK-18541][PYTHON] Add metadata parameter to pyspark.sql.Column.alias() · 7b64f7aa
    Sheamus K. Parkes authored
    ## What changes were proposed in this pull request?
    
    Add a `metadata` keyword parameter to `pyspark.sql.Column.alias()` to allow users to mix-in metadata while manipulating `DataFrame`s in `pyspark`.  Without this, I believe it was necessary to pass back through `SparkSession.createDataFrame` each time a user wanted to manipulate `StructField.metadata` in `pyspark`.
    
    This pull request also improves consistency between the Scala and Python APIs (i.e. I did not add any functionality that was not already in the Scala API).
    
    Discussed ahead of time on JIRA with marmbrus
    
    ## How was this patch tested?
    
    Added unit tests (and doc tests).  Ran the pertinent tests manually.
    
    Author: Sheamus K. Parkes <shea.parkes@milliman.com>
    
    Closes #16094 from shea-parkes/pyspark-column-alias-metadata.
    7b64f7aa
    [SPARK-18541][PYTHON] Add metadata parameter to pyspark.sql.Column.alias()
    Sheamus K. Parkes authored
    ## What changes were proposed in this pull request?
    
    Add a `metadata` keyword parameter to `pyspark.sql.Column.alias()` to allow users to mix-in metadata while manipulating `DataFrame`s in `pyspark`.  Without this, I believe it was necessary to pass back through `SparkSession.createDataFrame` each time a user wanted to manipulate `StructField.metadata` in `pyspark`.
    
    This pull request also improves consistency between the Scala and Python APIs (i.e. I did not add any functionality that was not already in the Scala API).
    
    Discussed ahead of time on JIRA with marmbrus
    
    ## How was this patch tested?
    
    Added unit tests (and doc tests).  Ran the pertinent tests manually.
    
    Author: Sheamus K. Parkes <shea.parkes@milliman.com>
    
    Closes #16094 from shea-parkes/pyspark-column-alias-metadata.
Loading