<?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: Spark SQL INITCAP not capitalizing letters after periods in abbreviations in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140293#M51372</link>
    <description>&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Coffee77_0-1764066460243.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/21947iE21F90A677EC493B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Coffee77_0-1764066460243.png" alt="Coffee77_0-1764066460243.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Nov 2025 10:28:15 GMT</pubDate>
    <dc:creator>Coffee77</dc:creator>
    <dc:date>2025-11-25T10:28:15Z</dc:date>
    <item>
      <title>Spark SQL INITCAP not capitalizing letters after periods in abbreviations</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140282#M51371</link>
      <description>&lt;P class=""&gt;Using&amp;nbsp;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;INITCAP(&lt;/SPAN&gt;&lt;SPAN&gt;"text (e.g., text, text, etc.)"&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;&lt;/SPAN&gt;abbreviations with periods like e.g. are not being fully capitalized.&lt;/P&gt;&lt;P class=""&gt;Current behavior:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Input:  "text (e.g., text, text, etc.)"&lt;/SPAN&gt;&lt;SPAN&gt;Output: "Text (e.g., Text, Text, Etc.)"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P class=""&gt;Expected behavior:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Output: "Text (E.G., Text, Text, Etc.)"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P class=""&gt;Version:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;16.4.x-scala2.12&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Nov 2025 09:19:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140282#M51371</guid>
      <dc:creator>dkhodyriev1208</dc:creator>
      <dc:date>2025-11-25T09:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Spark SQL INITCAP not capitalizing letters after periods in abbreviations</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140293#M51372</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Coffee77_0-1764066460243.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/21947iE21F90A677EC493B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Coffee77_0-1764066460243.png" alt="Coffee77_0-1764066460243.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 10:28:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140293#M51372</guid>
      <dc:creator>Coffee77</dc:creator>
      <dc:date>2025-11-25T10:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spark SQL INITCAP not capitalizing letters after periods in abbreviations</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140299#M51375</link>
      <description>&lt;P&gt;Thanks for suggestion.&lt;/P&gt;&lt;P&gt;Good option, but few concerns here: there is no space in my original example for&amp;nbsp;&lt;SPAN&gt;e.g. so it would require more sophisticated regex or custom udf.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I think that the root cause of the issue is some limitation of initcap function, that treats only spaces as delimiter. Also, I've tried such query in EKS cluster, and it works as expected, so this is rather some limitation of Databricks Spark version&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 10:48:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140299#M51375</guid>
      <dc:creator>dkhodyriev1208</dc:creator>
      <dc:date>2025-11-25T10:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Spark SQL INITCAP not capitalizing letters after periods in abbreviations</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140300#M51376</link>
      <description>&lt;P&gt;My solution is indeed a workaround. INITCAP is behaving as you comment. You can include another regular expression at the beginning to remove non-original "spaces" but I agree that makes it a little complex. However, no other solution so far I'm aware of&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 10:55:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140300#M51376</guid>
      <dc:creator>Coffee77</dc:creator>
      <dc:date>2025-11-25T10:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Spark SQL INITCAP not capitalizing letters after periods in abbreviations</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140448#M51431</link>
      <description>&lt;P&gt;Yes similar to what&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/179536"&gt;@Coffee77&lt;/a&gt;&amp;nbsp;has told, you can alternatively create an SQL function and use it directly with the custom logic using the regexp:&lt;/P&gt;
&lt;PRE&gt;CREATE OR REPLACE FUNCTION PROPER_WITH_ABBREVIATIONS(input STRING)&lt;BR /&gt;RETURNS STRING&lt;BR /&gt;RETURN regexp_replace(&lt;BR /&gt;INITCAP(input),&lt;BR /&gt;'(?i)(?&amp;lt;!\\d)([a-z])\\.(?!\\d)',&lt;BR /&gt;upper('$1') || '.'&lt;BR /&gt;);&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Nov 2025 18:06:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-sql-initcap-not-capitalizing-letters-after-periods-in/m-p/140448#M51431</guid>
      <dc:creator>iyashk-DB</dc:creator>
      <dc:date>2025-11-26T18:06:20Z</dc:date>
    </item>
  </channel>
</rss>

