I have a data frame with columns
patient_id
,DOB
,Gender
,marital_status
,smoking_status
,city
I need to extract age from the column DOB
and add a new column age
to my data frame. How can I proceed using Scala?
I have a data frame with columns
patient_id
,DOB
,Gender
,marital_status
,smoking_status
,city
I need to extract age from the column DOB
and add a new column age
to my data frame. How can I proceed using Scala?
val df = sqlcontext.sql(" SELECT *, DATEDIFF(hour,DOB,"+GETDATE()+")/8766 AS AgeYearsIntTrunc")