<?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 Re: dynamically create file path for sql_task in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/122078#M46643</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/147746"&gt;@kenmyers-8451&lt;/a&gt;&amp;nbsp;were you able to solve this? I'm having a similar issue.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jun 2025 06:35:06 GMT</pubDate>
    <dc:creator>jtirila</dc:creator>
    <dc:date>2025-06-18T06:35:06Z</dc:date>
    <item>
      <title>dynamically create file path for sql_task</title>
      <link>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/119685#M45942</link>
      <description>&lt;P&gt;I am trying to make a reusable workflow where I can run a merge script for any number of tables. The idea is I tell the workflow the table name and/or path to it and it can reference that in the file path field. The simplified idea is below:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;resources:
  jobs:
    test_workflow:
      name: test_workflow
      description: some workflow
      tasks:
        - task_key: run_sql_file
          sql_task:
            file:
              path: ${workspace.file_path}/{{job.parameters.sql_directory}}/{{job.parameters.table_name}}.sql
              source: WORKSPACE
            warehouse_id: ${var.serverless_sql_warehouse_ID}
      queue:
        enabled: true
      parameters:
        - name: sql_directory
          default: "path/to/sql"
        - name: table_name
          default: ""  # this one I change when running the task or when calling this workflow from another workflow
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However this doesn't work.&amp;nbsp;${workspace.file_path} is able to be formatted as expected but&amp;nbsp;{{job.parameters.sql_directory}} and&amp;nbsp;{{job.parameters.table_name}} are not able to be formatted, they don't dynamically update and they stay written exactly as is with the curly braces.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm wondering if there is anyway around this or to make this happen?&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 04:52:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/119685#M45942</guid>
      <dc:creator>kenmyers-8451</dc:creator>
      <dc:date>2025-05-20T04:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically create file path for sql_task</title>
      <link>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/119715#M45957</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/147746"&gt;@kenmyers-8451&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I know, you can't mix ${} and {{}} variable styles in the SQL file path. A better approach would be to pass the full SQL file path as a single job parameter, and update its value when triggering the job.&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 10:04:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/119715#M45957</guid>
      <dc:creator>Bhaskar27</dc:creator>
      <dc:date>2025-05-20T10:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically create file path for sql_task</title>
      <link>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/119739#M45964</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/86274"&gt;@Bhaskar27&lt;/a&gt;&amp;nbsp;, unfortunately this doesn't work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;path: {{job.parameters.merge_file_path}}&lt;/LI-CODE&gt;&lt;P&gt;I get a yaml error when I try to deploy because "key is not a scalar". So it seems like it is not possible to use this kind of dynamic variable for the sql_task file path.&lt;BR /&gt;&lt;BR /&gt;Edit: just in case this issue was fixed in a newer version, I upgraded my CLI to 0.252.0 (latest version right now) and I get the same error.&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 13:59:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/119739#M45964</guid>
      <dc:creator>kenmyers-8451</dc:creator>
      <dc:date>2025-05-20T13:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically create file path for sql_task</title>
      <link>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/122078#M46643</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/147746"&gt;@kenmyers-8451&lt;/a&gt;&amp;nbsp;were you able to solve this? I'm having a similar issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 06:35:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/122078#M46643</guid>
      <dc:creator>jtirila</dc:creator>
      <dc:date>2025-06-18T06:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically create file path for sql_task</title>
      <link>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/122087#M46646</link>
      <description>&lt;P&gt;Oh, never mind, I got it working. Just using single quotes around the {{&amp;nbsp; }} part solves it (I guess double quotes would work as well.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I tried this yesterday but probably run into another isssue with dashes in task names:&amp;nbsp;&lt;A href="https://community.databricks.com/t5/data-engineering/dab-for-each-task-passing-task-values/td-p/121072" target="_blank"&gt;https://community.databricks.com/t5/data-engineering/dab-for-each-task-passing-task-values/td-p/121072&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jun 2025 06:56:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dynamically-create-file-path-for-sql-task/m-p/122087#M46646</guid>
      <dc:creator>jtirila</dc:creator>
      <dc:date>2025-06-18T06:56:39Z</dc:date>
    </item>
  </channel>
</rss>

