Spark Sql Outer Apply