<?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: How to access the job-Scheduling Date from within the notebook? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-access-the-job-scheduling-date-from-within-the-notebook/m-p/21565#M14718</link>
    <description>&lt;P&gt;Hi, I guess the files are in the same directory structure so that you can use cloud files autoloader. It will incrementally read only new files &lt;A href="https://docs.microsoft.com/en-us/azure/databricks/spark/latest/structured-streaming/auto-loader" alt="https://docs.microsoft.com/en-us/azure/databricks/spark/latest/structured-streaming/auto-loader" target="_blank"&gt;https://docs.microsoft.com/en-us/azure/databricks/spark/latest/structured-streaming/auto-loader&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it will be another way around, so you can take the date from the input file using.:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.withColumn("filePath",input_file_name())&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 11:58:42 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2022-05-03T11:58:42Z</dc:date>
    <item>
      <title>How to access the job-Scheduling Date from within the notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-access-the-job-scheduling-date-from-within-the-notebook/m-p/21564#M14717</link>
      <description>&lt;P&gt;I have created a job that contains a notebook that reads a file from Azure Storage. &lt;/P&gt;&lt;P&gt;The file-name contains the date of when the file was transferred to the storage. A new file arrives every Monday, and the read-job is scheduled to run every Monday. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my notebook, I want to use the schedule-date of the job to read the file from Azure Storage with the same date in the filename, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;file_location = ("file_name+"_"+job_date+_+country_id+.csv")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have tried to pass a date as a parameter and I am able to access that from the notebook, but if the job fails and I want to re-run the job the next day, I'd have to manually enter yesterdays date as the input parameter. I want to avoid this and just use the real scheduling date for the job. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;How do I access the job scheduling date from within the notebook? &lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Karolin &lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 09:18:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-access-the-job-scheduling-date-from-within-the-notebook/m-p/21564#M14717</guid>
      <dc:creator>karolinalbinsso</dc:creator>
      <dc:date>2022-05-03T09:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to access the job-Scheduling Date from within the notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-access-the-job-scheduling-date-from-within-the-notebook/m-p/21565#M14718</link>
      <description>&lt;P&gt;Hi, I guess the files are in the same directory structure so that you can use cloud files autoloader. It will incrementally read only new files &lt;A href="https://docs.microsoft.com/en-us/azure/databricks/spark/latest/structured-streaming/auto-loader" alt="https://docs.microsoft.com/en-us/azure/databricks/spark/latest/structured-streaming/auto-loader" target="_blank"&gt;https://docs.microsoft.com/en-us/azure/databricks/spark/latest/structured-streaming/auto-loader&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it will be another way around, so you can take the date from the input file using.:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.withColumn("filePath",input_file_name())&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 11:58:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-access-the-job-scheduling-date-from-within-the-notebook/m-p/21565#M14718</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-05-03T11:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to access the job-Scheduling Date from within the notebook?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-access-the-job-scheduling-date-from-within-the-notebook/m-p/88853#M37644</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/78314"&gt;@Kani&lt;/a&gt;&amp;nbsp;Yes...I have similar use case where i run a sql query with filter start date and end_date and job has to run in every 10days&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current run &amp;gt; select * from table where start_date &amp;gt; 01-01-2024 and end_date &amp;lt; 01-10-24&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now if job is succsful in nect run it should pick &amp;gt; Select * from table where start_date &amp;gt; 01-10-24 and end_date &amp;lt; 01-20-24&lt;/P&gt;&lt;P&gt;Workflow should automatically take these dates on execution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 10:38:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-access-the-job-scheduling-date-from-within-the-notebook/m-p/88853#M37644</guid>
      <dc:creator>Deepak010101</dc:creator>
      <dc:date>2024-09-06T10:38:47Z</dc:date>
    </item>
  </channel>
</rss>

