You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2021/04/21 14:25:00 UTC
[jira] [Assigned] (SPARK-35173) Support columns batch adding in
PySpark.dataframe
[ https://issues.apache.org/jira/browse/SPARK-35173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-35173:
------------------------------------
Assignee: (was: Apache Spark)
> Support columns batch adding in PySpark.dataframe
> -------------------------------------------------
>
> Key: SPARK-35173
> URL: https://issues.apache.org/jira/browse/SPARK-35173
> Project: Spark
> Issue Type: Improvement
> Components: PySpark, SQL
> Affects Versions: 3.2.0
> Reporter: Yikun Jiang
> Priority: Major
>
> Now, the pyspark can only use withColumn to do column adding a column or replacing the existing column that has the same name. The scala withColumn can adding columns at one pass. [1]
>
> Before this added, the user can only use withColumn again and again like:
>
> {code:java}
> self.df.withColumn("key1", col("key1")).withColumn("key2", col("key2")).withColumn("key3", col("key3")){code}
>
> After the support, you user can use the with_columns complete batch operations:
>
> {code:java}
> self.df.withColumn(["key1", "key2", "key3"], [col("key1"), col("key2"), col("key3")]){code}
>
> [1] [https://github.com/apache/spark/blob/b5241c97b17a1139a4ff719bfce7f68aef094d95/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala#L2402]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org