Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
2.3.1
-
None
-
None
Description
WithColumnRenamed method should work with map parameter. It removes code redundancy.
// example df.withColumnRenamed(Map( "c1" -> "first_column", "c2" -> "second_column" ))
// from abbr columns to desc columns val m = Map( "c1" -> "first_column", "c2" -> "second_column" ) df1.withColumnRenamed(m) df2.withColumnRenamed(m)
It is useful for CJK users when they are working on analysis in notebook environment such as Zeppelin, Databricks, Apache Toree.
// 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)
Attachments
Issue Links
- is duplicated by
-
SPARK-25571 Add withColumnsRenamed method to Dataset
- Resolved
- links to