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:ย 

How do we pass parameters which have a "," with bundle run ?

ashish577
New Contributor III

So I have a query "select col1, col2 from table" that I need to pass as a parameter to a databricks job that I am triggering through the bundle run command. Issue is, when I pass this via --params="query=select col1, col2 from table" it splits it based on the comma. Any way to pass this entire query as a single parameter ?

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @ashish577 , When passing a query as a parameter to a Databricks job using the bundle run command, you can avoid the issue of it being split based on the comma.

Here are a couple of approaches you can consider:

  1. Environment Variables:

    • You can pass the query as an environment variable with a specific name. For example:
      BUNDLE_VAR_QUERY="select col1, col2 from table"
      
    • Then, when invoking the bundle run command, reference the environment variable:
      databricks bundle run --var="QUERY=$BUNDLE_VAR_QUERY"
      
  2. Command-Line Argument:

    • Pass the query directly as a command-line argument using the --var flag:
      databricks bundle run --var="query=select col1, col2 from table"
      

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