Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- url =
- "jdbc:postgresql://localhost:5432/mydatabase?user=postgres"
- df = sqlContext
- .read
- .format("jdbc")
- .option("url", url)
- .option("dbtable", "accounts")
- .option("partitionColumn", "id")
- .option("numPartitions", 10)
- .option("lowerBound", 1)
- .option("upperBound", 50000000)
- .option("password", "password")
- .load()
- results = df.map(lambda row: row["name"]).filter(lambda name: "taco" in name).collect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement