bio.ferlab.datalake.spark3.transformation.CurrentDate.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datalake-spark3_2.12 Show documentation
Show all versions of datalake-spark3_2.12 Show documentation
Library built on top of Apache Spark to speed-up data lakes development..
package bio.ferlab.datalake.spark3.transformation
import org.apache.spark.sql.DataFrame
import org.apache.spark.sql.functions.current_date
case class CurrentDate(columns: String*) extends Transformation {
override def transform: DataFrame => DataFrame = { df =>
columns.foldLeft(df){ case (d, column) =>
d.withColumn(column, current_date())
}
}
}