Created
December 24, 2021 00:24
-
-
Save 1ambda/5791494ecfb57cb7ea3a0c4d34535aa1 to your computer and use it in GitHub Desktop.
This file contains 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
queryListingJdbc = """(SELECT * FROM pipeline.ListingMeta WHERE listing_id >= 100000) AS target""" | |
dfListingJdbcFiltered = spark\ | |
.read\ | |
.format("jdbc")\ | |
.option("driver", "com.mysql.jdbc.Driver")\ | |
.option("url", "jdbc:mysql://localhost:3306?useSSL=false")\ | |
.option("dbtable", queryListingJdbc)\ | |
.option("user", "root")\ | |
.option("password", "root")\ | |
.option("partitionColumn", "listing_id")\ | |
.option("lowerBound", "0")\ | |
.option("upperBound", "1000")\ | |
.option("customSchema", "listing_id LONG")\ | |
.option("numPartitions", "5")\ | |
.load() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment