Forked from rustyrazorblade/gist:d4b2b048c4bd88e538ce
Last active
September 18, 2015 13:54
-
-
Save mikel-code/6f796c53f9a6af1641a2 to your computer and use it in GitHub Desktop.
working 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
from pyspark.sql import SQLContext | |
sql = SQLContext(sc) | |
mysql_movies = sql.read.jdbc("jdbc:mysql://127.0.0.1:3307/movielens?user=root", "movielens.movies") | |
mysql_movies.write.format("org.apache.spark.sql.cassandra").options(table="movies", keyspace="lens").save(mode="append") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment