<?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: Cannot create a table having a column whose name contains commas in Hive metastore. in Data Governance</title>
    <link>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21853#M719</link>
    <description>&lt;P&gt;@Pat Sienkiewicz​&amp;nbsp;, Thanks for responding. &lt;/P&gt;&lt;P&gt;So, does this mean that the delta table column cannot contain any non-ascii characters? I thought option("delta.columnMapping.mode", "name") handles columns with non-ascii characters which is a feature from DBR &amp;gt; 10.2. But, looks like Metastore is not supporting such column naming. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 19 Nov 2022 07:29:51 GMT</pubDate>
    <dc:creator>Shafi</dc:creator>
    <dc:date>2022-11-19T07:29:51Z</dc:date>
    <item>
      <title>Cannot create a table having a column whose name contains commas in Hive metastore.</title>
      <link>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21851#M717</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Tried to create a delta table from spark data frame using below command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;destination_path = "/dbfs/mnt/kidneycaredevstore/delta/df_corr_feats_spark_4"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df_corr_feats_spark.write.format("delta").option("delta.columnMapping.mode", "name").option("path",destination_path).saveAsTable("CKD_Features_4")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting below error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AnalysisException: Cannot create a table having a column whose name contains commas in Hive metastore. Table: `default`.`abc_features_4`; Column: Adverse, abc initial encounter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that there are around 6k columns in this data frame and it is developed by data scientist generate feature. So, we cannot rename columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to fix this error. Any help will be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 07:39:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21851#M717</guid>
      <dc:creator>Shafi</dc:creator>
      <dc:date>2022-11-18T07:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot create a table having a column whose name contains commas in Hive metastore.</title>
      <link>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21852#M718</link>
      <description>&lt;P&gt;Hi @Shafiul Alam​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;who gave those names to columns? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can rename you columns, replace spaces / special characters, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%python
import re
list_of_columns = df_corr_feats_spark.colums
renamed_list_of_columns = [ re.sub(r'[^0-9a-zA-Z]+', "_", col) for col in list_of_columns]
df_corr_feats_spark.toDF(*new_column_name_list)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 13:07:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21852#M718</guid>
      <dc:creator>Pat</dc:creator>
      <dc:date>2022-11-18T13:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot create a table having a column whose name contains commas in Hive metastore.</title>
      <link>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21853#M719</link>
      <description>&lt;P&gt;@Pat Sienkiewicz​&amp;nbsp;, Thanks for responding. &lt;/P&gt;&lt;P&gt;So, does this mean that the delta table column cannot contain any non-ascii characters? I thought option("delta.columnMapping.mode", "name") handles columns with non-ascii characters which is a feature from DBR &amp;gt; 10.2. But, looks like Metastore is not supporting such column naming. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 07:29:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21853#M719</guid>
      <dc:creator>Shafi</dc:creator>
      <dc:date>2022-11-19T07:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot create a table having a column whose name contains commas in Hive metastore.</title>
      <link>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21854#M720</link>
      <description>&lt;P&gt;Hi @Shafiul Alam​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yeah it was what I would do old days. Rename the column, I used this as an example: re.sub(r'[^0-9a-zA-Z]+', "_", col) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is here that hive_metastore doesn't allow names with commas you are right. The documentation must be related to the Databricks implementation of metastore - it's confusing in the documentation sometimes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was fine for tables in Unity Catalog:&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/1166iE74164D6D11AA1CB/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;but for hive_metastore it throws an error:&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/1165i0A811CEE7B7E7CE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 08:24:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21854#M720</guid>
      <dc:creator>Pat</dc:creator>
      <dc:date>2022-11-19T08:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot create a table having a column whose name contains commas in Hive metastore.</title>
      <link>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21855#M721</link>
      <description>&lt;P&gt;@Pat Sienkiewicz​&amp;nbsp;, thanks a  lot for sharing this suggestion&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 18:23:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/cannot-create-a-table-having-a-column-whose-name-contains-commas/m-p/21855#M721</guid>
      <dc:creator>Shafi</dc:creator>
      <dc:date>2022-11-21T18:23:43Z</dc:date>
    </item>
  </channel>
</rss>

