cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to query a MySQL Table from Databricks?

Swapnil1998
New Contributor III

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

0 REPLIES 0
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!