class DropColumnAction extends BaseAlterTableAction {

    @Override
    public void alter(final Table table) {
        if (!existsColumn(table.getMetadata())) {
            SwiftLoggers.getLogger().warn("column {} is not present in {}, will drop nothing", relatedColumnMeta, table);
            return;
        }
        SwiftLoggers.getLogger().info("drop column {} of {}", relatedColumnMeta, table);

        List<SegmentKey> segKeys = SwiftContext.get().getBean(SegmentService.class).getSegmentKeys(table.getSourceKey());
        for (final SegmentKey segKey : segKeys) {
            if (segKey.getStoreType().isTransient()) {
                // 删内存
                ResourceDiscovery.getInstance().releaseColumn(segKey.getSwiftSchema(), segKey.getTable(), new ColumnKey(relatedColumnMeta.getName()));
                // 删备份
                FileUtil.delete(new CubePathBuilder(segKey).asAbsolute().asBackup().setColumnId(relatedColumnMeta.getColumnId()).build());
                continue;
            }

            // 删history todo 还要删共享存储
            int currentDir = CubeUtil.getCurrentDir(segKey.getTable());
            FileUtil.delete(new CubePathBuilder(segKey).asAbsolute().setTempDir(currentDir).setColumnId(relatedColumnMeta.getColumnId()).build());
        }

        alterMeta(table);
    }

    public  DropColumnAction(SwiftMetaDataColumn relatedColumnMeta);

}