<?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: date_format 'LLLL' returns '1' in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/date-format-llll-returns-1/m-p/65876#M32947</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Turns out it was actually a Java 8 bug:&lt;/P&gt;&lt;P&gt;IllegalArgumentException: Java 8 has a bug to support stand-alone form (3 or more 'L' or 'q' in the pattern string). Please use 'M' or 'Q' instead, or upgrade your Java version. For more details, please read &lt;A href="https://bugs.openjdk.java.net/browse/JDK-8114833" target="_blank"&gt;https://bugs.openjdk.java.net/browse/JDK-8114833&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Upgarding to Java 11 fixed the issue.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2024 09:38:25 GMT</pubDate>
    <dc:creator>Kibour</dc:creator>
    <dc:date>2024-04-09T09:38:25Z</dc:date>
    <item>
      <title>date_format 'LLLL' returns '1'</title>
      <link>https://community.databricks.com/t5/data-engineering/date-format-llll-returns-1/m-p/63556#M32274</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;In my notebook, when I run my cell with following code&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;%sql&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;select&lt;/SPAN&gt; &lt;SPAN&gt;date_format&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;date&lt;/SPAN&gt; &lt;SPAN&gt;'1970-01-01'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"LLL"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I get '1', while I expect 'Jan' according to the doc&lt;BR /&gt;&lt;A href="https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html" target="_blank" rel="noopener"&gt;https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would also expect the following to return 'January', but I get '1' instead&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;%sql&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;select&lt;/SPAN&gt;&lt;SPAN&gt; to_csv(named_struct(&lt;/SPAN&gt;&lt;SPAN&gt;'date'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;date&lt;/SPAN&gt; &lt;SPAN&gt;'1970-01-01'&lt;/SPAN&gt;&lt;SPAN&gt;), map(&lt;/SPAN&gt;&lt;SPAN&gt;'dateFormat'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'LLLL'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'locale'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'EN'&lt;/SPAN&gt;&lt;SPAN&gt;));&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What am I missing?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance for your insights&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Mar 2024 13:54:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/date-format-llll-returns-1/m-p/63556#M32274</guid>
      <dc:creator>Kibour</dc:creator>
      <dc:date>2024-03-13T13:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: date_format 'LLLL' returns '1'</title>
      <link>https://community.databricks.com/t5/data-engineering/date-format-llll-returns-1/m-p/63836#M32375</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Thanks for your detailed answer. If I read you correctly, this means the spark docuementation is incorrect. I copy-pasted my queries direclty from the documentation examples, but can't reproduce them.&lt;/P&gt;&lt;P&gt;My cluster is runnig with &lt;SPAN&gt;Apache Spark 3.5.0, Scala 2.12&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;Thanks and kind regards&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 15:30:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/date-format-llll-returns-1/m-p/63836#M32375</guid>
      <dc:creator>Kibour</dc:creator>
      <dc:date>2024-03-15T15:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: date_format 'LLLL' returns '1'</title>
      <link>https://community.databricks.com/t5/data-engineering/date-format-llll-returns-1/m-p/65876#M32947</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Turns out it was actually a Java 8 bug:&lt;/P&gt;&lt;P&gt;IllegalArgumentException: Java 8 has a bug to support stand-alone form (3 or more 'L' or 'q' in the pattern string). Please use 'M' or 'Q' instead, or upgrade your Java version. For more details, please read &lt;A href="https://bugs.openjdk.java.net/browse/JDK-8114833" target="_blank"&gt;https://bugs.openjdk.java.net/browse/JDK-8114833&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Upgarding to Java 11 fixed the issue.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 09:38:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/date-format-llll-returns-1/m-p/65876#M32947</guid>
      <dc:creator>Kibour</dc:creator>
      <dc:date>2024-04-09T09:38:25Z</dc:date>
    </item>
  </channel>
</rss>

