I have a flat file on HDFS containing a list of companies
CompanyA
CompanyA Decription
April '12
San Fran
11-50
CompanyB
...
and i want to map this into a companies class
case class Company(company: String,
desc: String,
founded: Date,
location: String,
employees: String)
I have tried the following but it doesn't seem to map properly
val companiesText = sc.textFile(...)
val companies = companyText.map(
lines => Company(
lines(0).toString.replaceAll("\"", ""),
lines(1).toString.replaceAll("\"", ""),
lines(2).toString.replaceAll("\"", ""),
lines(3).toString.replaceAll("\"", ""),
lines(4).toString.replaceAll("\"", ""),
lines(5).toString.replaceAll("\"", "")
)
)
i know i am not doing the date properly here but that is not the issue.