<?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 ALTER Not Working in Databricks for external Table. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/alter-not-working-in-databricks-for-external-table/m-p/162914#M55090</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;i am getting error alter not suported .&amp;nbsp;&lt;/P&gt;&lt;P&gt;col1 DOUBLE NOT CONVERTING TO col1 DECIMAL(31,5) VIA ALTER STATEMENT.&lt;BR /&gt;ERROR-&lt;BR /&gt;liquibase.exception.DatabaseException: [Databricks][JDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: 0A000, Query:&lt;BR /&gt;ALTER TABL***, Error message from Server: org.apache.hive.service.cli.HiveSQLException: Error running query: [NOT_SUPPORTED_CHANGE_COLUMN]&lt;BR /&gt;org.apache.spark.sql.catalyst.ExtendedAnalysisException: [NOT_SUPPORTED_CHANGE_COLUMN] ALTER TABLE ALTER/CHANGE COLUMN is not supported for.. Any suggestion , would be appreciate.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jul 2026 06:55:49 GMT</pubDate>
    <dc:creator>Taj2019</dc:creator>
    <dc:date>2026-07-14T06:55:49Z</dc:date>
    <item>
      <title>ALTER Not Working in Databricks for external Table.</title>
      <link>https://community.databricks.com/t5/data-engineering/alter-not-working-in-databricks-for-external-table/m-p/162914#M55090</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;i am getting error alter not suported .&amp;nbsp;&lt;/P&gt;&lt;P&gt;col1 DOUBLE NOT CONVERTING TO col1 DECIMAL(31,5) VIA ALTER STATEMENT.&lt;BR /&gt;ERROR-&lt;BR /&gt;liquibase.exception.DatabaseException: [Databricks][JDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: 0A000, Query:&lt;BR /&gt;ALTER TABL***, Error message from Server: org.apache.hive.service.cli.HiveSQLException: Error running query: [NOT_SUPPORTED_CHANGE_COLUMN]&lt;BR /&gt;org.apache.spark.sql.catalyst.ExtendedAnalysisException: [NOT_SUPPORTED_CHANGE_COLUMN] ALTER TABLE ALTER/CHANGE COLUMN is not supported for.. Any suggestion , would be appreciate.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2026 06:55:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/alter-not-working-in-databricks-for-external-table/m-p/162914#M55090</guid>
      <dc:creator>Taj2019</dc:creator>
      <dc:date>2026-07-14T06:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: ALTER Not Working in Databricks for external Table.</title>
      <link>https://community.databricks.com/t5/data-engineering/alter-not-working-in-databricks-for-external-table/m-p/162933#M55091</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/233250"&gt;@Taj2019&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;ALTER TABLE ... ALTER COLUMN ... TYPE&lt;/SPAN&gt;&lt;SPAN&gt; is supported only for Delta tables and only for supported &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;type-widening&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; conversions. Databricks currently supports conversions such as &lt;/SPAN&gt;&lt;SPAN&gt;FLOAT -&amp;gt; DOUBLE&lt;/SPAN&gt;&lt;SPAN&gt;, integer types -&amp;gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DECIMAL&lt;/SPAN&gt;&lt;SPAN&gt;, and increasing the precision/scale of an existing &lt;/SPAN&gt;&lt;SPAN&gt;DECIMAL&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;BR /&gt;It does &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;not&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt; list &lt;/SPAN&gt;&lt;SPAN&gt;DOUBLE → DECIMAL&lt;/SPAN&gt;&lt;SPAN&gt; as a supported in-place conversion, so enabling &lt;/SPAN&gt;&lt;SPAN&gt;delta.enableTypeWidening&lt;/SPAN&gt;&lt;SPAN&gt; will not solve this particular change.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The easiest fix would be to overwrite or recreate this table from scratch.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from pyspark.sql import functions as F

(
    spark.read.table("catalog.schema.my_table")
    .withColumn("col1", F.col("col1").cast("decimal(31,5)"))
    .write
    .mode("overwrite")
    .option("overwriteSchema", "true")
    .saveAsTable("catalog.schema.my_table")
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;If my answer was helpful, please consider marking it as accepted solution.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2026 10:08:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/alter-not-working-in-databricks-for-external-table/m-p/162933#M55091</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2026-07-14T10:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: ALTER Not Working in Databricks for external Table.</title>
      <link>https://community.databricks.com/t5/data-engineering/alter-not-working-in-databricks-for-external-table/m-p/163046#M55093</link>
      <description>&lt;P&gt;Databricks Delta Lake doesn't support changing column data types directly via ALTER COLUMN, especially for type conversions like DOUBLE to DECIMAL.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Based on the documentation,&amp;nbsp;Databricks doesn't support arbitrary type changes via ALTER COLUMN&amp;nbsp;(like DOUBLE to DECIMAL). Here are your options&lt;/P&gt;&lt;P&gt;Option 1: Recreate Table with New Schema&amp;nbsp;(Recommended)&lt;/P&gt;&lt;P&gt;Option 2: Add New Column &amp;amp; Migrate&amp;nbsp;(Safer - Preserves History)&lt;/P&gt;&lt;P&gt;Option 3: For Liquibase - Use Table Recreation, Since you're using Liquibase, modify your changeset to use:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;CREATE OR REPLACE TABLE&amp;nbsp;instead of&amp;nbsp;ALTER TABLE&lt;/LI&gt;&lt;LI&gt;Or use Liquibase's&amp;nbsp;loadUpdateData&amp;nbsp;with a new table definition&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 15 Jul 2026 04:19:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/alter-not-working-in-databricks-for-external-table/m-p/163046#M55093</guid>
      <dc:creator>ashukasma</dc:creator>
      <dc:date>2026-07-15T04:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: ALTER Not Working in Databricks for external Table.</title>
      <link>https://community.databricks.com/t5/data-engineering/alter-not-working-in-databricks-for-external-table/m-p/163140#M55101</link>
      <description>&lt;P&gt;thanks for the soltion. if i use&amp;nbsp;&lt;SPAN&gt;CREATE OR REPLACE TABLE&amp;nbsp;instead of&amp;nbsp;ALTER TABLE,&amp;nbsp; i have external table then delta_log will overirde or not? if i do full load then it shold be with new changes, it should n't go for update&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2026 06:02:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/alter-not-working-in-databricks-for-external-table/m-p/163140#M55101</guid>
      <dc:creator>Taj2019</dc:creator>
      <dc:date>2026-07-16T06:02:43Z</dc:date>
    </item>
  </channel>
</rss>

