What's the easy way to combine two columns in SparkR? Consider following Spark DF:
salary_from salary_to position 1500 null a null 1300 b 800 1000 c I would like to get combined salary column with logic like this. From salary_from and salary_to take the one that is not null, and if both present, then take a value in the middle.
salary_from salary_to position salary 1500 null a 1500 null 1300 b 1300 800 1000 c 900 Is there a way to walk through every line and apply my logic, like I would do with apply method in R?