Search code examples
databricksazure-databricksdelta-lakedatabricks-sql

AnalysisException: Operation not allowed: `CREATE TABLE LIKE` is not supported for Delta tables;


create table if not exists map_table like position_map_view;

While using this it is giving me operation not allowed error


Solution

  • As pointed in documentation, you need to use CREATE TABLE AS, just use LIMIT 0 in SELECT:

    create table map_table as select * from position_map_view limit 0;