Convert Date of Birth into Age in Spark Dataframe API

前端 未结 4 1895
被撕碎了的回忆
被撕碎了的回忆 2021-01-16 08:16

This seems simple but I couldn\'t find the answer. I\'m trying to convert a column of date-of-birth in the below date format to the date format in Spark Dataframe API and th

4条回答
  •  感情败类
    2021-01-16 08:39

    LocalDate birthdate = new LocalDate (1970, 1, 20);
    LocalDate now = new LocalDate();
    Years age = Years.yearsBetween(birthdate, now);
    

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题