Update table schema programmatically

Hi, Dremio community.

Tools being used: dremio latest from docker image dremio/dremio-oss:latest with azure blob storage.

Use case: suppose I have a table named “table1” in dremio with columns “a”, “b” and “c”. Every time I update data in azure blob keeping same “a”, “b” and “c” columns and run: alter table “<my_context>.table1” refresh metadata, it works fine.

If I drop column “c” and insert a new column “d” in azure blob and execute the same refresh statement, it also updates with new column, but it keeps column “c” as legacy with all values null.

How to update both: table content and schema through a sql statement or in another programmatic way?

Thanks.

Run the below 2 commands

alter table “<my_context>.table1” forget metadata
alter table “<my_context>.table1” refresh metadata