<?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 Adding partition location to external table throwing exception in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/adding-partition-location-to-external-table-throwing-exception/m-p/6954#M2951</link>
    <description>&lt;P&gt;I have created external table like below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;# create table
spark.sql(f"""
    CREATE EXTERNAL TABLE IF NOT EXISTS {database_schema}.{tableName}
    USING PARQUET
    OPTIONS
    (
        'path' '{raw_storage}/{folder_path}',
        'forward_spark_azure_storage_credentials' 'true'
    )
""")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then try to add partition to the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.sql(f"""
     ALTER TABLE {database_schema}.{tableName}
     ADD IF NOT EXISTS PARTITION (local_date_part='{partition_date}')
     LOCATION '{raw_pcmd_storage}/{folder_path}/local_date_part={partition_date}'
""")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Azure databricks throwing below exception&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Got exception: shaded.databricks.azurebfs.org.apache.hadoop.fs.azurebfs.contracts.exceptions.KeyProviderException Failure to initialize configuration)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;i have verified dbfss path and oauth and all are good and i am able to list files as well.  &lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 05:55:45 GMT</pubDate>
    <dc:creator>sribet</dc:creator>
    <dc:date>2023-03-28T05:55:45Z</dc:date>
    <item>
      <title>Adding partition location to external table throwing exception</title>
      <link>https://community.databricks.com/t5/data-engineering/adding-partition-location-to-external-table-throwing-exception/m-p/6954#M2951</link>
      <description>&lt;P&gt;I have created external table like below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;# create table
spark.sql(f"""
    CREATE EXTERNAL TABLE IF NOT EXISTS {database_schema}.{tableName}
    USING PARQUET
    OPTIONS
    (
        'path' '{raw_storage}/{folder_path}',
        'forward_spark_azure_storage_credentials' 'true'
    )
""")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then try to add partition to the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.sql(f"""
     ALTER TABLE {database_schema}.{tableName}
     ADD IF NOT EXISTS PARTITION (local_date_part='{partition_date}')
     LOCATION '{raw_pcmd_storage}/{folder_path}/local_date_part={partition_date}'
""")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Azure databricks throwing below exception&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:Got exception: shaded.databricks.azurebfs.org.apache.hadoop.fs.azurebfs.contracts.exceptions.KeyProviderException Failure to initialize configuration)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;i have verified dbfss path and oauth and all are good and i am able to list files as well.  &lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 05:55:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/adding-partition-location-to-external-table-throwing-exception/m-p/6954#M2951</guid>
      <dc:creator>sribet</dc:creator>
      <dc:date>2023-03-28T05:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Adding partition location to external table throwing exception</title>
      <link>https://community.databricks.com/t5/data-engineering/adding-partition-location-to-external-table-throwing-exception/m-p/6955#M2952</link>
      <description>&lt;P&gt;@sri bet​&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error message suggests that there may be an issue with the configuration of the Azure Key Vault or the authentication process. Here are some possible solutions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Check that the Azure Key Vault is properly configured and accessible by the Databricks cluster. You may need to provide the appropriate access policies for the Databricks service principal in the Key Vault.&lt;/LI&gt;&lt;LI&gt;Ensure that the credentials used by Databricks to access the Azure storage account are valid and up-to-date. You can verify this by listing the files in the storage account using Databricks.&lt;/LI&gt;&lt;LI&gt;Try setting the fs.azure.account.key.&amp;lt;account-name&amp;gt;.dfs.core.windows.net.&amp;lt;your-container&amp;gt;.oauth2.client.id and  fs.azure.account.key.&amp;lt;account-name&amp;gt;.dfs.core.windows.net.&amp;lt;your-container&amp;gt;.oauth2.client.secret configuration properties explicitly in the spark.conf object to authenticate with the Azure Key Vault.&lt;/LI&gt;&lt;LI&gt;Check the Databricks cluster logs for more detailed error messages or warnings that could provide additional insights into the issue.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I hope this helps! Let me know if you have any other questions.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2023 14:13:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/adding-partition-location-to-external-table-throwing-exception/m-p/6955#M2952</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-02T14:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding partition location to external table throwing exception</title>
      <link>https://community.databricks.com/t5/data-engineering/adding-partition-location-to-external-table-throwing-exception/m-p/6956#M2953</link>
      <description>&lt;P&gt;Hi @sri bet​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your question! To assist you better, please take a moment to review the answer and let me know if it best fits your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help us select the best solution by clicking on "Select As Best" if it does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your feedback will help us ensure that we are providing the best possible service to you. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 06:35:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/adding-partition-location-to-external-table-throwing-exception/m-p/6956#M2953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-04T06:35:24Z</dc:date>
    </item>
  </channel>
</rss>

