<?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: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/54885#M30188</link>
    <description>&lt;P&gt;wow&lt;/P&gt;</description>
    <pubDate>Thu, 07 Dec 2023 21:13:13 GMT</pubDate>
    <dc:creator>AlexRodriges202</dc:creator>
    <dc:date>2023-12-07T21:13:13Z</dc:date>
    <item>
      <title>Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8608#M4204</link>
      <description>&lt;P&gt;It seems that due to how Databricks processes SQL cells, it's impossible to escape the $ when it comes to a column name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would expect the following to work:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%sql
SELECT 'hi' `$id`&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The backticks ought to escape everything. And indeed that's exactly what Databricks thinks should happen, too. I was able to create a table outside of SQL commands (from a Dataframe) that had a column called $id . When I did a SHOW CREATE on that table, Databricks suggested using `$id` . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what seems to happen is that Databricks seizes upon the sight of any $X to do Query Snippeting. So I end up with a blank column name instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Query Snippets only seem to respect the \ character as a means of escaping. But this does not bode well in conjunction with the backtick all-encompassing escape method, as the backticks will interpret the \ character literally, leaving me with a fieldname of \$id .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a workaround? If not, how can this be raised to a bug report? Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 23:12:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8608#M4204</guid>
      <dc:creator>VVM</dc:creator>
      <dc:date>2023-02-27T23:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8609#M4205</link>
      <description>&lt;P&gt;Hi @Patrick Mascari​&amp;nbsp;, Just to understand the issue, you have a column named "$id" in your table and when you do "select $id from table" then it is failing. Is my understanding correct?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 10:55:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8609#M4205</guid>
      <dc:creator>Lakshay</dc:creator>
      <dc:date>2023-02-28T10:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8610#M4206</link>
      <description>&lt;P&gt;Hi @Patrick Mascari​&amp;nbsp;can you try by using the &lt;B&gt;SQL()&lt;/B&gt; function, I have written the code below with an example please check if that works for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;B&gt;You can extract any escaped sequence in the column&lt;/B&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data = spark.createDataFrame([("Alberto", 101), 
                              ("Dakota", 202), 
                              ("Kumar", 330),
                              ("Siva", 4),
                              ("Sree", 5),
                              ("Kavin", 6)], 
                                   ["Name", "$id"])
&amp;nbsp;
data.createOrReplaceTempView("temp_table")
sql("select `$id` as id, name from temp_table").show()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 13:51:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8610#M4206</guid>
      <dc:creator>Tayyab_Vohra</dc:creator>
      <dc:date>2023-02-28T13:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8611#M4207</link>
      <description>&lt;P&gt;I want to build a table using the CREATE TABLE statement in Databricks SQL. But I can't name the column $id because `$id` does not work (in spite of Databricks' SHOW CREATE saying it should)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that I can probably work around this by swapping to python/scala to run a spark query. If that's the only resort, then Databricks surely has a bug that needs reported and resolved..&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 16:52:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8611#M4207</guid>
      <dc:creator>VVM</dc:creator>
      <dc:date>2023-02-28T16:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8612#M4208</link>
      <description>&lt;P&gt;Thank you for engaging with us on Databricks Community!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you say you are trying this in Databricks SQL, I do not understand why the create table command is not working for you. Please see my working example with $'s in the column names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/582i20103B1E3346E64B/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To further narrow down what you are facing. Please clarify if you are attempting this in the Databricks SQL persona in the UI via the SQL editor (like in my screenshot above), or in a Notebook within the Data Science &amp;amp; Engineering persona.  Screenshots would be helpful to further understand.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 17:01:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8612#M4208</guid>
      <dc:creator>NateAnth</dc:creator>
      <dc:date>2023-02-28T17:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8613#M4209</link>
      <description>&lt;P&gt;Yes, this is in a Notebook. You can see below that it fails because both instances get detected as query snippets and swapped out with blank, so the query effectively becomes CREATE TABLE my_temp_table( `` int, `` string )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/587iFB00389FC4947704/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 17:17:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8613#M4209</guid>
      <dc:creator>VVM</dc:creator>
      <dc:date>2023-02-28T17:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8614#M4210</link>
      <description>&lt;P&gt;Thank you for clarifying. I too see the same behavior and have brought this to the attention of our Notebook team to further investigate.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 17:28:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8614#M4210</guid>
      <dc:creator>NateAnth</dc:creator>
      <dc:date>2023-02-28T17:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8615#M4211</link>
      <description>&lt;P&gt;Thank you @Patrick Mascari​&amp;nbsp;for bringing this to our attention, the appropriate engineering and product team is aware of the issue and will prioritize it accordingly to be addressed in the future. There is no ETA that can be provided at this time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the mean time, consider the following work arounds:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use spark.sql() in a python cell&lt;/LI&gt;&lt;LI&gt;Use the Databricks SQL Editor in the SQL Persona&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 19:09:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8615#M4211</guid>
      <dc:creator>NateAnth</dc:creator>
      <dc:date>2023-02-28T19:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8616#M4212</link>
      <description>&lt;P&gt;I am working with an imported cdc table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can select the column `__$operation` in the query editor but not in a SQL notebook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is so annoying.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 05:37:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/8616#M4212</guid>
      <dc:creator>_Dusk</dc:creator>
      <dc:date>2023-03-31T05:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/38975#M26829</link>
      <description>&lt;P&gt;Is this issue resolved?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 04:48:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/38975#M26829</guid>
      <dc:creator>Lee78</dc:creator>
      <dc:date>2023-08-03T04:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/39402#M26962</link>
      <description>&lt;P&gt;This has not been resolved from what I can see. Databricks team, any progress updates here? Its been 6 months.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 19:30:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/39402#M26962</guid>
      <dc:creator>Whit127</dc:creator>
      <dc:date>2023-08-08T19:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/54885#M30188</link>
      <description>&lt;P&gt;wow&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 21:13:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/54885#M30188</guid>
      <dc:creator>AlexRodriges202</dc:creator>
      <dc:date>2023-12-07T21:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/65800#M32926</link>
      <description>&lt;P&gt;What is the status on this bug report? its been over a year now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 11:24:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/65800#M32926</guid>
      <dc:creator>Casper-Bang</dc:creator>
      <dc:date>2024-04-08T11:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/88064#M37476</link>
      <description>&lt;P&gt;What is the status of this bug? This is affecting user experience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 14:15:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/88064#M37476</guid>
      <dc:creator>JR-20773</dc:creator>
      <dc:date>2024-09-03T14:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/118225#M45620</link>
      <description>&lt;P&gt;+1 here - hoping to hear any updates.&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 14:41:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/118225#M45620</guid>
      <dc:creator>rgower</dc:creator>
      <dc:date>2025-05-07T14:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/127640#M48042</link>
      <description>&lt;P&gt;As someone who spent a few hours this morning bashing my head against this and this is the only relevant thread I could see. A solution I found to inserting a '$' in a query string in a notebook was to concat(chr(36), 'xxx')&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 02:58:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/127640#M48042</guid>
      <dc:creator>ryry_luma</dc:creator>
      <dc:date>2025-08-07T02:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL - Unable to Escape Dollar Sign ($) in Column Name</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/127744#M48066</link>
      <description>&lt;P&gt;I needed a $ character in the context of Java format strings in the SQL printf function.&lt;/P&gt;&lt;P&gt;With some trial and error, I found workarounds:&lt;/P&gt;&lt;P&gt;A trailing backslash escapes the dollar character successfully, like so&lt;BR /&gt;SELECT printf('%1$\s, %1$\s', 'hi') AS test&lt;BR /&gt;Column names can be escaped normally when wrapped in a statement string and executed with EXECUTE IMMEDIATE:&lt;BR /&gt;EXECUTE IMMEDIATE 'SELECT printf(\'%1$\s, %1$\s\', \'hi\') AS `\$test`'&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 23:55:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-unable-to-escape-dollar-sign-in-column-name/m-p/127744#M48066</guid>
      <dc:creator>andreasmarkmann</dc:creator>
      <dc:date>2025-08-07T23:55:14Z</dc:date>
    </item>
  </channel>
</rss>

