spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "holdenk (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SPARK-19454) Improve DataFrame.replace API
Date Wed, 05 Apr 2017 18:51:41 GMT

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

holdenk resolved SPARK-19454.
-----------------------------
       Resolution: Fixed
    Fix Version/s: 2.2.0

Issue resolved by pull request 16793
[https://github.com/apache/spark/pull/16793]

> Improve DataFrame.replace API
> -----------------------------
>
>                 Key: SPARK-19454
>                 URL: https://issues.apache.org/jira/browse/SPARK-19454
>             Project: Spark
>          Issue Type: Improvement
>          Components: PySpark, SQL
>    Affects Versions: 1.5.0, 1.6.0, 2.0.0, 2.1.0, 2.2.0
>            Reporter: Maciej Szymkiewicz
>            Assignee: Maciej Szymkiewicz
>             Fix For: 2.2.0
>
>
> Current implementation suffers from following issues:
> - It is possible to use {{dict}} as {{to_replace}}, but we cannot skip or use {{None}}
as the value {{value}} (although it is ignored). This requires passing "magic" values:
> {code}
> df = sc.parallelize([("Alice", 1, 3.0)]).toDF()
> df.replace({"Alice": "Bob"}, 1)
> {code}
> - Code doesn't check if provided types are correct. This can lead to exception in Py4j
(harder to diagnose):
> {code}
>  df.replace({"Alice": 1}, 1)
> {code}
> or silent failures (with bundled Py4j version):
> {code}
>  df.replace({1: 2, 3.0: 4.1, "a": "b"}, 1)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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


Mime
View raw message