Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 09:10 AM
@Dp15 - yes you are correct. Dropping a column from an managed table in Databricks works different from the external table(as the schema is inferred by the underlying source). Below hack can help. AFAIK. Please let me know if this works for you.
1. create or replace new external table B on the new schema (new set of columns you want to keep) and new data source path
2. insert into new table B as select (required columns) from table A(old table).
3. Drop table A
4. Alter table - Rename table B to table A