spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goun Na (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-25430) Add map parameter for withColumnRenamed
Date Fri, 14 Sep 2018 08:50:00 GMT

    [ https://issues.apache.org/jira/browse/SPARK-25430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16614530#comment-16614530
] 

Goun Na commented on SPARK-25430:
---------------------------------

I am working on it.

> Add map parameter for withColumnRenamed
> ---------------------------------------
>
>                 Key: SPARK-25430
>                 URL: https://issues.apache.org/jira/browse/SPARK-25430
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.3.1
>            Reporter: Goun Na
>            Priority: Major
>
> WithColumnRenamed method should work with map parameter. It removes code redundancy.
> {code:java}
> // example
> df.withColumnRenamed(Map( "c1" -> "first_column", "c2" -> "second_column" )){code}
> {code:java}
> // from abbr columns to desc columns
> val m = Map( "c1" -> "first_column", "c2" -> "second_column" ) df1.withColumnRenamed(m)

> df2.withColumnRenamed(m){code}
> It is useful for CJK users when they are working on analysis in notebook environment
such as Zeppelin, Databricks, Apache Toree. 
> {code:java}
> // for CJK users once define dictionary into map, reuse column map to translate columns
whenever report visualization is required
> val m = Map( "c1" -> "컬럼_1", "c2" -> "컬럼_2") 
> df1.withColumnRenamed(m) 
> df2.withColumnRenamed(m)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message