How to query a MySQL Table from Databricks?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 09:01 AM
I wanted to query a MySQL Table using Databricks rather than reading the complete data using a dbtable option, which will help in incremental loads.
remote_table = (spark.read
.format("jdbc")
.option("driver", driver)
.option("url", URL)
.option("query", query)
.option("user", user)
.option("password", password)
.load()
)
Kindly let me know if there is some way to pass a query like
SELECT * FROM table_name WHERE last_modified_date > 'yyyy-mm-dd';
Regards,
Swapnil
Labels:
- Labels:
-
databricks
-
Mysql
-
MySQLDB
-
Query
-
Sql query
0 REPLIES 0
![](/skins/images/97567C72181EBE789E1F0FD869E4C89B/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/97567C72181EBE789E1F0FD869E4C89B/responsive_peak/images/icon_anonymous_message.png)