Created
February 18, 2015 15:01
-
-
Save chbatey/792f1e2885e70f4d376d to your computer and use it in GitHub Desktop.
Migration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val customerEvents = new JdbcRDD(sc, () => { DriverManager.getConnection(mysqlJdbcString)}, | |
"select * from customer_events ce, staff, store where ce.store = store.store_name and ce.staff = staff.name " + | |
"and ce.id >= ? and ce.id <= ?", startingId, highestId, numberOfPartitions, | |
(r: ResultSet) => { | |
(r.getString("customer"), | |
r.getTimestamp("time"), | |
UUID.randomUUID(), | |
r.getString("event_type"), | |
r.getString("store_name"), | |
r.getString("location"), | |
r.getString("store_type"), | |
r.getString("staff"), | |
r.getString("job_title") | |
) | |
}) | |
customerEvents.saveToCassandra("test", "customer_events", | |
SomeColumns("customer_id", "time", "id", "event_type", "store_name", "store_type", "store_location", "staff_name", "staff_title")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment