Today I enjoy this by comparing a set of 1/0 values ββwith a logical one. I had to go back to Spark 1.4.1, and I finally got it working:
Try(if (p(11).toString == "1" || p(11).toString == "true") true else false).getOrElse(false))
where p (11) is the dataframe field
In my previous version there was no "Try", it works, other ways to make it available ...
TobyEvans Oct 07 '16 at 15:54 2016-10-07 15:54
source share