Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case class Distance(zip: String, id_5: Array[Int])
- val dist = Seq(Distance("72712",Array(72713,72714,72715)))
- val distDS=dist.toDS()
- case class Customer (cust_id: Int, id: String)
- val c = Seq(Customer(1,"72713"),Customer(2,"72714"),Customer(3,"72720"))
- val custDS = c.toDS()
- val res = distDS.joinWith(custDS,distDS.col("id_5"(??????)) === custDS.col("id"))`
- import org.apache.spark.sql.functions.expr
- distDS.joinWith(custDS, expr("array_contains(id_5, cust_id)"))
Add Comment
Please, Sign In to add comment