Skip to content

Instantly share code, notes, and snippets.

@dgadiraju
Created September 9, 2019 11:00
Show Gist options
  • Select an option

  • Save dgadiraju/d70daaeee983efc12361c5e035b4e0a0 to your computer and use it in GitHub Desktop.

Select an option

Save dgadiraju/d70daaeee983efc12361c5e035b4e0a0 to your computer and use it in GitHub Desktop.
val orders = sc.textFile("/public/retail_db/orders")
val ordersMap = orders.
map(o => (o.split(",")(0).toInt, o))
val orderItems = sc.textFile("/public/retail_db/order_items")
val orderItemsMap = orderItems.
map(oi => (oi.split(",")(1).toInt, oi))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment