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!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group