-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: UNIC-705 add HashTransformation traits (#232)
- Loading branch information
Showing
5 changed files
with
15 additions
and
6 deletions.
There are no files selected for viewing
9 changes: 7 additions & 2 deletions
9
...-spark3/src/main/scala/bio/ferlab/datalake/spark3/transformation/HashTransformation.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
package bio.ferlab.datalake.spark3.transformation | ||
|
||
import org.apache.spark.sql.Column | ||
import org.apache.spark.sql.{Column, DataFrame} | ||
import org.apache.spark.sql.functions.lit | ||
import org.apache.spark.sql.types.StringType | ||
|
||
trait HashTransformation[A] extends Transformation {self => | ||
sealed trait HashTransformation[A] extends Transformation {self => | ||
val columns: A | ||
val nullValues: Column = lit(null).cast(StringType) | ||
} | ||
|
||
object HashTransformation { | ||
trait SimpleHashTransformation extends HashTransformation[Seq[String]] | ||
trait DynamicHashTransformation extends HashTransformation[DataFrame => Seq[String]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
datalake-spark3/src/main/scala/bio/ferlab/datalake/spark3/transformation/SHA1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
datalake-spark3/src/main/scala/bio/ferlab/datalake/spark3/transformation/SHA1Dynamic.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
datalake-spark3/src/main/scala/bio/ferlab/datalake/spark3/transformation/SHA256.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters