<?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: column mask on &amp;lt;tinyint&amp;gt;Y columns gives error in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/column-mask-on-lt-tinyint-gt-y-columns-gives-error/m-p/93703#M8556</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/126281"&gt;@DW&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I have replicated your scenario and encountered the same error when applying a column mask to a column named 1Y in Databricks SQL.&lt;/P&gt;&lt;P&gt;In short, it makes sense simply to follow Databricks documentation and use the SQL naming conventions, so that column names:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Begin with a letter or an underscore.&lt;/LI&gt;&lt;LI&gt;Contain only letters, digits, and underscores.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In my experience, using not standard column names, then the need to use ` backticks characters is asking oneself for trouble.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Oct 2024 11:09:44 GMT</pubDate>
    <dc:creator>filipniziol</dc:creator>
    <dc:date>2024-10-13T11:09:44Z</dc:date>
    <item>
      <title>column mask on &lt;tinyint&gt;Y columns gives error</title>
      <link>https://community.databricks.com/t5/get-started-discussions/column-mask-on-lt-tinyint-gt-y-columns-gives-error/m-p/93646#M8555</link>
      <description>&lt;P&gt;My table breaks when I try to mask a column with a name like `&amp;lt;tinyint&amp;gt;Y`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="terminal,monaco"&gt;-- Create a table with a masked column&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;&amp;gt; CREATE FUNCTION mask_int_col(col_val INTEGER) RETURN CASE WHEN is_member('HumanResourceDept') THEN col_val ELSE CAST(NULL as INTEGER) END;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;&amp;gt; CREATE TABLE persons(name STRING, 1Y INTEGER MASK mask_int_col);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;&amp;gt; INSERT INTO persons VALUES('James', 1);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;-- What I expect when I'm not a member of the Human Resource Department&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;&amp;gt; SELECT * FROM persons;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;James NULL&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;-- What I get&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;&amp;gt; SELECT * FROM persons;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="terminal,monaco"&gt;[UNRESOLVED_COLUMN.WITHOUT_SUGGESTION] A column, variable, or function parameter with name `1Y` cannot be resolved. SQLSTATE: 42703&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;Column names like e.g. 128Y or 1Ya are not a problem.&lt;/P&gt;&lt;P&gt;I understand column names like 1Y are better to be avoided, but that a table breaks because of this does surprise me.&lt;/P&gt;&lt;P&gt;Is there a solution for this problem?&lt;/P&gt;&lt;P&gt;Luckily I can access the table again when dropping the mask.&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;ALTER&lt;/SPAN&gt; &lt;SPAN&gt;TABLE&lt;/SPAN&gt;&lt;SPAN&gt; &lt;FONT face="terminal,monaco"&gt;persons&lt;/FONT&gt; &lt;/SPAN&gt;&lt;SPAN&gt;ALTER&lt;/SPAN&gt; &lt;SPAN&gt;COLUMN&lt;/SPAN&gt; &lt;SPAN&gt;`1Y`&lt;/SPAN&gt; &lt;SPAN&gt;DROP&lt;/SPAN&gt; &lt;SPAN&gt;MASK&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 16:07:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/column-mask-on-lt-tinyint-gt-y-columns-gives-error/m-p/93646#M8555</guid>
      <dc:creator>DW</dc:creator>
      <dc:date>2024-10-11T16:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: column mask on &lt;tinyint&gt;Y columns gives error</title>
      <link>https://community.databricks.com/t5/get-started-discussions/column-mask-on-lt-tinyint-gt-y-columns-gives-error/m-p/93703#M8556</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/126281"&gt;@DW&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I have replicated your scenario and encountered the same error when applying a column mask to a column named 1Y in Databricks SQL.&lt;/P&gt;&lt;P&gt;In short, it makes sense simply to follow Databricks documentation and use the SQL naming conventions, so that column names:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Begin with a letter or an underscore.&lt;/LI&gt;&lt;LI&gt;Contain only letters, digits, and underscores.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In my experience, using not standard column names, then the need to use ` backticks characters is asking oneself for trouble.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2024 11:09:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/column-mask-on-lt-tinyint-gt-y-columns-gives-error/m-p/93703#M8556</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-10-13T11:09:44Z</dc:date>
    </item>
  </channel>
</rss>

