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: 

Global or environment parameters.

Data_Engineeri7
New Contributor

Hi All,

Need a help on creating utility file that can be use in pyspark notebook.

Utility file contain variables like database and schema names. So I need to pass this variables in other notebook wherever I am using database and schema.

Thanks

 

 

 

3 REPLIES 3

ilarsen
Contributor

Hi.  Have you looked at using cluster spark configurations?  We're using it for default catalog for example and it works quite well.  I don't know for certain, but there might be an option to pre-set databases as well.

Here's a topic about setting catalog: Re: Set default database thru Cluster Spark Config... - Databricks - 47645

KSI
New Contributor II

You can use:

${param_catalog}.schema.tablename.
Pass actual value in the notebook through a job param "param_catalog" or widget utils through text called "param_catalog"

Oh yeah, using widgets, of course!