[ 
https://issues.apache.org/jira/browse/SPARK-45275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Diogo Marques updated SPARK-45275:
----------------------------------
    Priority: Trivial  (was: Major)

> replace function fails to handle null replace param
> ---------------------------------------------------
>
>                 Key: SPARK-45275
>                 URL: https://issues.apache.org/jira/browse/SPARK-45275
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Diogo Marques
>            Priority: Trivial
>
> [replace |https://spark.apache.org/docs/latest/api/sql/#replace]function 
> fails to handle null replace param, example below:
>  
> df.withColumn('test',F.expr('replace(col1, "nUll", 1)')).show()
> || ||col1||col2||test||
> ||0|person1|0.0|person1|
> ||1|person1|2.0|person1|
> ||2|person1|3.0|person1|
> ||3|person2|1.0|person2|
> ||4|None|2.0|None|
> ||5|nUll|None|1|
>  
> df.withColumn('test',F.expr('replace(col1, "nUll", null)')).show()
> || ||col1||col2||test||
> ||0|person1|0.0|None|
> ||1|person1|2.0|None|
> ||2|person1|3.0|None|
> ||3|person2|1.0|None|
> ||4|None|2.0|None|
> ||5|nUll|None|None|



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to