public boolean createTableLike(CreateTableLikeStmt stmt) throws DdlException {
        String existedDbName = stmt.getExistedDbName();
        String existedTableName = stmt.getExistedTableName();
        Table likeTable = getTable(existedDbName, existedTableName);
        return createTable(stmt.getCreateTableStmt(), likeTable.getPartitionColumns());
    }
@Test
    public void testCreateTableLike() throws DdlException {
        new MockUp<HiveWriteUtils>() {
            public void createDirectory(Path path, Configuration conf) {
            }
        };

        HiveMetastoreOperations mockedHmsOps = new HiveMetastoreOperations(cachingHiveMetastore, true,
                new Configuration(), MetastoreType.HMS, "hive_catalog") {
            @Override
            public Path getDefaultLocation(String dbName, String tableName) {
                return new Path("mytable_locatino");
            }
        };

        // stmt is constructed according to getTable method in HiveMetastoreTest as when creating a table using Create
        // Table Like DDL, the system looks for the like table from hms.
        CreateTableStmt stmt = new CreateTableStmt(
                false,
                false,
                new TableName("hive_catalog", "hive_db", "hive_table"),
                Lists.newArrayList(
                        new ColumnDef("col1", TypeDef.create(PrimitiveType.INT)),
                        new ColumnDef("col2", TypeDef.create(PrimitiveType.INT))),
                "hive",
                null,
                new ListPartitionDesc(Lists.newArrayList("col1"), new ArrayList<>()),
                null,
                new HashMap<>(),
                new HashMap<>(),
                "my table comment");
        List<Column> columns = stmt.getColumnDefs()
                .stream()
                .map(columnDef -> columnDef.toColumn(null))
                .collect(Collectors.toList());
        stmt.setColumns(columns);

        CreateTableLikeStmt createTableLikeStmt = new CreateTableLikeStmt(
                false,
                new TableName("hive_catalog", "hive_db", "hive_table_1"),
                new TableName("hive_catalog", "hive_db", "hive_table"),
                null,
                null,
                new HashMap<>(),
                NodePosition.ZERO);
        createTableLikeStmt.setCreateTableStmt(stmt);
        Assert.assertTrue(mockedHmsOps.createTableLike(createTableLikeStmt));
    }