All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bio.ferlab.datalake.spark3.transformation.Rename.scala Maven / Gradle / Ivy

There is a newer version: 14.8.0
Show newest version
package bio.ferlab.datalake.spark3.transformation

import org.apache.spark.sql.DataFrame

case class Rename(renameMap: Map[String, String]) extends Transformation {
  override def transform: DataFrame => DataFrame = { df =>
    renameMap.foldLeft(df) {
      case (d, (existingName, newName)) => d.withColumnRenamed(existingName, newName)
    }
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy