razuredatabricks

How to run R scripts on Databricks Jobs / workflows


Trying to run R scripts from Databricks Workflows, but I only see python script option available. Is there no way to run R scripts on databricks, but only R in notebooks?

enter image description here


Solution

  • I believe you are correct. In the Databricks for R developers documentation it states:

    You can automate R workloads as scheduled or triggered notebook Create and run Databricks Jobs in Databricks.

    Which suggests the recommended approach is to run your R code from notebooks. Whether your choice is to include the script contents/code in your notebook or instead call the script files from the notebook would be up to you.

    Similar workarounds to directly scheduling R script files would be to write either python scripts or jar files that call your R scripts and schedule the python scripts and/or jar files. However, the notebook approach is apparently the recommended approach and arguably simpler.