Guest User

Untitled

a guest
Nov 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. case class Distance(zip: String, id_5: Array[Int])
  2. val dist = Seq(Distance("72712",Array(72713,72714,72715)))
  3. val distDS=dist.toDS()
  4.  
  5. case class Customer (cust_id: Int, id: String)
  6. val c = Seq(Customer(1,"72713"),Customer(2,"72714"),Customer(3,"72720"))
  7. val custDS = c.toDS()
  8.  
  9. val res = distDS.joinWith(custDS,distDS.col("id_5"(??????)) === custDS.col("id"))`
  10.  
  11. import org.apache.spark.sql.functions.expr
  12.  
  13. distDS.joinWith(custDS, expr("array_contains(id_5, cust_id)"))
Add Comment
Please, Sign In to add comment