<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to send a list as parameter in databricks notebook task in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34138#M24916</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How we can pass a list as parameter in data bricks notebook to run the notebook parallelly for list of values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Wed, 01 Dec 2021 07:45:35 GMT</pubDate>
    <dc:creator>SailajaB</dc:creator>
    <dc:date>2021-12-01T07:45:35Z</dc:date>
    <item>
      <title>How to send a list as parameter in databricks notebook task</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34138#M24916</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How we can pass a list as parameter in data bricks notebook to run the notebook parallelly for list of values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 07:45:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34138#M24916</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-12-01T07:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a list as parameter in databricks notebook task</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34140#M24918</link>
      <description>&lt;P&gt;Not sure what exactly you want to do, but you can use a widget to pass in parameters.  These widgets can be of several types, including multiple values.&lt;/P&gt;&lt;P&gt;What I do not understand is to run the notebook in parallel.  You want to run the same notebook in multiple jobs concurrently?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 10:07:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34140#M24918</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-12-01T10:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a list as parameter in databricks notebook task</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34141#M24919</link>
      <description>&lt;P&gt;Hi Werners,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to pass a list of values to the databricks notebook i/p parameter(list type). For example ["Eu","JP","APAC"] and need to run my notebook transformations for each value of the list in parallel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Values of  a list should be come from user&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 10:17:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34141#M24919</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-12-01T10:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a list as parameter in databricks notebook task</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34142#M24920</link>
      <description>&lt;P&gt;ok so passing in the values can be done with&lt;A href="https://docs.databricks.com/notebooks/widgets.html" alt="https://docs.databricks.com/notebooks/widgets.html" target="_blank"&gt; widgets&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;But the notebook itself will run in parallel as it runs on spark.&lt;/P&gt;&lt;P&gt;So paralellism is already there.&lt;/P&gt;&lt;P&gt;If there is a reason you want to control the parallelism (which is the case I think), you will have to launch multiple instances of the notebook at once:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/notebooks/notebook-workflows.html" alt="https://docs.databricks.com/notebooks/notebook-workflows.html" target="_blank"&gt;https://docs.databricks.com/notebooks/notebook-workflows.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 10:22:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34142#M24920</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-12-01T10:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a list as parameter in databricks notebook task</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34143#M24921</link>
      <description>&lt;P&gt;Notebook code is executed on driver to achieve parallelism you need just to create Spark dataframe with your list.&lt;/P&gt;&lt;P&gt;As @Werner Stinckens​&amp;nbsp;said you can run multiple notebooks together also so in that case you will not use list just to every notebook pass 1 parameter from your list:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from multiprocessing.pool import ThreadPool
my_params =  ["Eu","JP","APAC"]
pool = ThreadPool(4) # match cpu cores here
pool.map(
    lambda my_param: run_notebook("my_notebook", 3600, {"my_widget": my_param}),
    my_params)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 10:35:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34143#M24921</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2021-12-01T10:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a list as parameter in databricks notebook task</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34144#M24922</link>
      <description>&lt;P&gt;We implemented our code using threadpool&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pool= ThreadPool(mp.cpu_count())&lt;/P&gt;&lt;P&gt;pool.map(fn_name,value_list)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is like how we can pass list type to notebook using widgets.. Currently we are taking string input and splitting it..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 11:44:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34144#M24922</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-12-01T11:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a list as parameter in databricks notebook task</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34145#M24923</link>
      <description>&lt;P&gt;you can convert list to dataframe and register as table/view so it will be accessible from all notebooks&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 11:51:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34145#M24923</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2021-12-01T11:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a list as parameter in databricks notebook task</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34146#M24924</link>
      <description>&lt;P&gt;you could use a multiselect widget, &lt;A href="https://community.databricks.com/s/question/0D53f00001KScRaCAL/dbutilsnotebookrun-with-multiselect-parameter" alt="https://community.databricks.com/s/question/0D53f00001KScRaCAL/dbutilsnotebookrun-with-multiselect-parameter" target="_blank"&gt;here is another topic about that&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;How to pass in the values in this widget? Can be done in several ways depending on what schedule tool you use.&lt;/P&gt;&lt;P&gt;I use Data Factory, where I define the values of what has to be sent to the notebook widget.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 11:57:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34146#M24924</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-12-01T11:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a list as parameter in databricks notebook task</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34147#M24925</link>
      <description>&lt;P&gt;another another way &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  (in databricks you can achieve everything many ways) is to encode list using json library:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import json
print type(json.dumps([1, 2, 3]))
#&amp;gt;&amp;gt; &amp;lt;type 'str'&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 12:02:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-send-a-list-as-parameter-in-databricks-notebook-task/m-p/34147#M24925</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2021-12-01T12:02:23Z</dc:date>
    </item>
  </channel>
</rss>

