how to modify data type of a column explicitly via DBSQL
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 03:01 AM
is there a SQL equivalent of overwriteSchema ?https://docs.databricks.com/en/delta/update-schema.html#explicitly-update-schema-to-change-column-ty...
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2024 07:41 AM
In place schema adjustment =>
Then ALTER TABLE XXX ADD/DROP COLUMN XXX INT
Example
Then ALTER TABLE XXX ADD/DROP COLUMN XXX INT
Example
create table test (id int, first_name string, last_name string ); insert into test values (1, 'john', 'smith'); alter table test add column age int; select * from test
Create a new table with an adjusted Schema =>
Then CTAS should do the trickCREATE OR REPLACE TABLE [new_table] AS ( SELECT * FROM OLD_TABLE ... )
Then CTAS should do the trickCREATE OR REPLACE TABLE [new_table] AS ( SELECT * FROM OLD_TABLE ... )

