<?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 DLT job failed to parse timestamp string with T and Z. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/dlt-job-failed-to-parse-timestamp-string-with-t-and-z/m-p/117508#M45513</link>
    <description>&lt;P&gt;Hi I am struggling with converting a timestamp string with T and Z to a timestamp column in my DLT job.&amp;nbsp; here is the relevent code snippet:&lt;/P&gt;&lt;P&gt;trans_rules={'timestamp_value', '''to_timestamp(timstamp_str, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")'''}&lt;/P&gt;&lt;P&gt;In my DLT function, I have the following:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; col_name, expr_str &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; transformation_rules.&lt;/SPAN&gt;&lt;SPAN&gt;items&lt;/SPAN&gt;&lt;SPAN&gt;():&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; df.&lt;/SPAN&gt;&lt;SPAN&gt;withColumn&lt;/SPAN&gt;&lt;SPAN&gt;(col_name, F.&lt;/SPAN&gt;&lt;SPAN&gt;expr&lt;/SPAN&gt;&lt;SPAN&gt;(expr_str))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The DLT execution succeeded but the target column (timestamp_value) is null.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However, when I execute the similar command in a notebook, it works fine.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-02 at 7.25.03 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/16423i22D28046D11DF90F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2025-05-02 at 7.25.03 AM.png" alt="Screenshot 2025-05-02 at 7.25.03 AM.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am using serverless compute for DLT&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 02 May 2025 12:26:10 GMT</pubDate>
    <dc:creator>Thomas_Zhang</dc:creator>
    <dc:date>2025-05-02T12:26:10Z</dc:date>
    <item>
      <title>DLT job failed to parse timestamp string with T and Z.</title>
      <link>https://community.databricks.com/t5/data-engineering/dlt-job-failed-to-parse-timestamp-string-with-t-and-z/m-p/117508#M45513</link>
      <description>&lt;P&gt;Hi I am struggling with converting a timestamp string with T and Z to a timestamp column in my DLT job.&amp;nbsp; here is the relevent code snippet:&lt;/P&gt;&lt;P&gt;trans_rules={'timestamp_value', '''to_timestamp(timstamp_str, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")'''}&lt;/P&gt;&lt;P&gt;In my DLT function, I have the following:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; col_name, expr_str &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; transformation_rules.&lt;/SPAN&gt;&lt;SPAN&gt;items&lt;/SPAN&gt;&lt;SPAN&gt;():&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; df.&lt;/SPAN&gt;&lt;SPAN&gt;withColumn&lt;/SPAN&gt;&lt;SPAN&gt;(col_name, F.&lt;/SPAN&gt;&lt;SPAN&gt;expr&lt;/SPAN&gt;&lt;SPAN&gt;(expr_str))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The DLT execution succeeded but the target column (timestamp_value) is null.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However, when I execute the similar command in a notebook, it works fine.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-05-02 at 7.25.03 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/16423i22D28046D11DF90F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2025-05-02 at 7.25.03 AM.png" alt="Screenshot 2025-05-02 at 7.25.03 AM.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am using serverless compute for DLT&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 02 May 2025 12:26:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dlt-job-failed-to-parse-timestamp-string-with-t-and-z/m-p/117508#M45513</guid>
      <dc:creator>Thomas_Zhang</dc:creator>
      <dc:date>2025-05-02T12:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: DLT job failed to parse timestamp string with T and Z.</title>
      <link>https://community.databricks.com/t5/data-engineering/dlt-job-failed-to-parse-timestamp-string-with-t-and-z/m-p/117530#M45518</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/109512"&gt;@Thomas_Zhang&lt;/a&gt;&amp;nbsp;, Good Day!&lt;/P&gt;
&lt;P&gt;Can you give it a try with the below code format and check if it helps you to set the timezone with Z :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=======================&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;date_format( &lt;/SPAN&gt;&lt;SPAN&gt; to_timestamp(`createdon`, 'yyyy-MM-dd\'T\'HH:mm:ss.SSSSSSSX'), &lt;/SPAN&gt;&lt;SPAN&gt; 'yyyy-MM-dd\'T\'HH:mm:ss.SSSSSSSX' &lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=======================&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please let me know if this helps and leave a like if this information is useful, followups are appreciated.&lt;BR /&gt;Kudos&lt;BR /&gt;Ayushi&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2025 15:56:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dlt-job-failed-to-parse-timestamp-string-with-t-and-z/m-p/117530#M45518</guid>
      <dc:creator>Ayushi_Suthar</dc:creator>
      <dc:date>2025-05-02T15:56:27Z</dc:date>
    </item>
  </channel>
</rss>

