cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.