Search code examples
azureapache-spark-sqldatabricksazure-databricks

how to pass static value into dynamic on basis of column value in azure databricks


how to pass static value into dynamic on basis of column value in Azure Databricks. Currently, I have 13 notebook and its scheduled ,so I want to schedule only one notebook and In addition, data of column( 13 rows) which I defined separate in 13 notebook so how I dynamically pass that value .


Solution

  • You can create different jobs that refer the single notebook, pass parameters to a job and then retrieve these parameters using Databricks Widgets (widgets are available for all languages). In the notebook it will look as following (for example, in Python):

    # this is necessary only if you execute notebook interactively
    dbutils.widgets.text("param1_name", "default_value", "description")
    # get job parameter
    param1 = dbutils.widgets.get("param1_name")
    # ... use param1