<?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: Automatic conversion of timestamp to the default timezone in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/automatic-conversion-of-timestamp-to-the-default-timezone/m-p/75574#M34991</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The point is that in the aim of our project, we need the timestamp attribute to be as they are from the source system. So basically our aim would be to have the attribute without the timezone conversion.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did the below tests so far:&lt;/P&gt;&lt;P&gt;1. during ingestion using the "cloudFiles.schemaHints" which cast all timestamp to STRING&lt;/P&gt;&lt;P&gt;2. cast the string to the&amp;nbsp;TIMESTAMP_NTZ. But since i have some attributes containing only the time, not the date included when casting it gives null.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any possible option that we can disable the automatic conversion when the schema is inferred?&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2024 11:15:00 GMT</pubDate>
    <dc:creator>ata_lh</dc:creator>
    <dc:date>2024-06-24T11:15:00Z</dc:date>
    <item>
      <title>Automatic conversion of timestamp to the default timezone</title>
      <link>https://community.databricks.com/t5/data-engineering/automatic-conversion-of-timestamp-to-the-default-timezone/m-p/74885#M34806</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am encountering the issue when ingesting data from adls xml or json files to process them via Pyspark (Autoloader or just reading df). The timestamp is automatically converted to the default timezone.And I have&amp;nbsp; dynamically timezone values. Did anyone of you has found a way how to not let the conversion happened ? I tried to set the&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;spark.conf.&lt;/SPAN&gt;&lt;SPAN&gt;set&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"spark.sql.session.timeZone"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"UTC"&lt;/SPAN&gt;&lt;SPAN&gt;), but it is not working.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Original local time: &lt;/SPAN&gt;&lt;SPAN&gt;2024-06-21 20:50:00&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;the Offset: &lt;/SPAN&gt;&lt;SPAN&gt;+08:00 : &lt;/SPAN&gt;&lt;SPAN&gt;This means the local time is 8 hours ahead of UTC.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Subtract 8 hours: &lt;/SPAN&gt;&lt;SPAN&gt;2024-06-21 20:50:00 - 8:00:00 = 2024-06-21 12:50:00&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Result in UTC&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;2024-06-21T12:50:00Z&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 18 Jun 2024 14:48:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/automatic-conversion-of-timestamp-to-the-default-timezone/m-p/74885#M34806</guid>
      <dc:creator>ata_lh</dc:creator>
      <dc:date>2024-06-18T14:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic conversion of timestamp to the default timezone</title>
      <link>https://community.databricks.com/t5/data-engineering/automatic-conversion-of-timestamp-to-the-default-timezone/m-p/75574#M34991</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The point is that in the aim of our project, we need the timestamp attribute to be as they are from the source system. So basically our aim would be to have the attribute without the timezone conversion.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did the below tests so far:&lt;/P&gt;&lt;P&gt;1. during ingestion using the "cloudFiles.schemaHints" which cast all timestamp to STRING&lt;/P&gt;&lt;P&gt;2. cast the string to the&amp;nbsp;TIMESTAMP_NTZ. But since i have some attributes containing only the time, not the date included when casting it gives null.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any possible option that we can disable the automatic conversion when the schema is inferred?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 11:15:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/automatic-conversion-of-timestamp-to-the-default-timezone/m-p/75574#M34991</guid>
      <dc:creator>ata_lh</dc:creator>
      <dc:date>2024-06-24T11:15:00Z</dc:date>
    </item>
  </channel>
</rss>

