<?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: Retrieve job id and run id from scala in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18244#M12075</link>
    <description>&lt;P&gt;Another method of getting access to this data is through the spark context, and this will not require use of the dbutils library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check the environment tab of the spark cluster UI, you'll see that Databricks adds a number of properties to the spark config that can be easily retrieved using the native spark apis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example of the value of spark.databricks.clusterUsageTags.clusterName is "job-12345678901-run-987654-default" and you can retrieve this using spark.conf.get()&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jun 2022 18:22:20 GMT</pubDate>
    <dc:creator>ron_defreitas</dc:creator>
    <dc:date>2022-06-29T18:22:20Z</dc:date>
    <item>
      <title>Retrieve job id and run id from scala</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18238#M12069</link>
      <description>&lt;P&gt;I need to retrieve job id and run id of the job from a jar file in Scala.&lt;/P&gt;&lt;P&gt;When I try to compile below code in IntelliJ, below error is shown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import com.databricks.dbutils_v1.DBUtilsHolder.dbutils
&amp;nbsp;
object MainSNL {
&amp;nbsp;
  @throws(classOf[Exception])
  def main(args: Array[String]): Unit = {
&amp;nbsp;
  dbutils.notebook.getContext.tags("jobId").toString()
&amp;nbsp;  dbutils.notebook.getContext.tags("runId").toString()
&amp;nbsp;
}
&amp;nbsp;
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error: Symbol 'type com.databricks.backend.common.rpc.CommandContext' is missing from the classpath.&lt;/P&gt;&lt;P&gt;[ERROR] This symbol is required by 'method com.databricks.dbutils_v1.NotebookUtils.getContext'.&lt;/P&gt;&lt;P&gt;[ERROR] Make sure that type CommandContext is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.&lt;/P&gt;&lt;P&gt;[ERROR] A full rebuild may help if 'NotebookUtils.class' was compiled against an incompatible version of com.databricks.backend.common.rpc.&lt;/P&gt;&lt;P&gt;[ERROR]&amp;nbsp;&amp;nbsp;&amp;nbsp;dbutils.notebook.getContext.tags("jobId").toString()&lt;/P&gt;&lt;P&gt;[ERROR]&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;[ERROR] one error found&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 17:55:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18238#M12069</guid>
      <dc:creator>Sunny</dc:creator>
      <dc:date>2022-06-08T17:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve job id and run id from scala</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18240#M12071</link>
      <description>This is the same code I've used but receiving compilation error in IntelliJ.</description>
      <pubDate>Thu, 09 Jun 2022 10:45:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18240#M12071</guid>
      <dc:creator>Sunny</dc:creator>
      <dc:date>2022-06-09T10:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve job id and run id from scala</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18241#M12072</link>
      <description>&lt;P&gt;Do you use databricks-connect with Intellij?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 13:17:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18241#M12072</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2022-06-09T13:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve job id and run id from scala</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18242#M12073</link>
      <description>&lt;P&gt;No&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 14:34:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18242#M12073</guid>
      <dc:creator>Sunny</dc:creator>
      <dc:date>2022-06-09T14:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve job id and run id from scala</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18243#M12074</link>
      <description>&lt;P&gt;Hi @Kaniz Fatma​&amp;nbsp; Are there any alternatives to this, please advise&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 12:09:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18243#M12074</guid>
      <dc:creator>Sunny</dc:creator>
      <dc:date>2022-06-17T12:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve job id and run id from scala</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18244#M12075</link>
      <description>&lt;P&gt;Another method of getting access to this data is through the spark context, and this will not require use of the dbutils library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check the environment tab of the spark cluster UI, you'll see that Databricks adds a number of properties to the spark config that can be easily retrieved using the native spark apis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example of the value of spark.databricks.clusterUsageTags.clusterName is "job-12345678901-run-987654-default" and you can retrieve this using spark.conf.get()&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 18:22:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18244#M12075</guid>
      <dc:creator>ron_defreitas</dc:creator>
      <dc:date>2022-06-29T18:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve job id and run id from scala</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18245#M12076</link>
      <description>&lt;P&gt;This is resolved by passing {{job_id}} and {{run_id}} as parameters to the jar&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 12:03:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18245#M12076</guid>
      <dc:creator>Sunny</dc:creator>
      <dc:date>2022-06-30T12:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve job id and run id from scala</title>
      <link>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18246#M12077</link>
      <description>&lt;P&gt;Maybe its worth going through the Task Parameter variables section of the below doc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/data-engineering/jobs/jobs.html#task-parameter-variables" alt="https://docs.databricks.com/data-engineering/jobs/jobs.html#task-parameter-variables" target="_blank"&gt;https://docs.databricks.com/data-engineering/jobs/jobs.html#task-parameter-variables&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 10:08:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/retrieve-job-id-and-run-id-from-scala/m-p/18246#M12077</guid>
      <dc:creator>Mohit_m</dc:creator>
      <dc:date>2022-07-05T10:08:22Z</dc:date>
    </item>
  </channel>
</rss>

