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
test("EEA_UK_deaths") { | |
val df = spark.read.option("header", true) | |
.csv("/Users/elena/Downloads/Morticd10_part*") | |
df.createTempView("data") | |
val code2country = spark.read.option("header", true) | |
.csv("/Users/elena/Downloads/WHO_country_codes.csv") |
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
val df = spark.read.option("header", true) | |
.csv("/Users/elena/Downloads/vaccine_combinations.csv") | |
df.createTempView("data") | |
val diseases = df.columns.filter(_ != "ID") | |
diseases.map(d => df.where(col(d) === lit(1)).select(col("ID"), lit(d).as("disease"))) | |
.reduce(_ union _) | |
.createTempView("vac2dis") |