private void createTable(SinkInfo sinkInfo) {
        LOGGER.info("begin to create iceberg table for sinkInfo={}", sinkInfo);

        // Get all info from config
        IcebergSinkDTO icebergInfo = getIcebergInfo(sinkInfo);
        List<IcebergColumnInfo> columnInfoList = getColumnList(sinkInfo);
        if (CollectionUtils.isEmpty(columnInfoList)) {
            throw new IllegalArgumentException("no iceberg columns specified");
        }
        IcebergTableInfo tableInfo = IcebergSinkDTO.getIcebergTableInfo(icebergInfo, columnInfoList);

        String metastoreUri = icebergInfo.getCatalogUri();
        String warehouse = icebergInfo.getWarehouse();
        String dbName = icebergInfo.getDbName();
        String tableName = icebergInfo.getTableName();

        try {
            // 1. create database if not exists
            IcebergCatalogUtils.createDb(metastoreUri, warehouse, dbName);

            // 2. check if the table exists
            boolean tableExists = IcebergCatalogUtils.tableExists(metastoreUri, dbName, tableName);

            if (!tableExists) {
                // 3. create table
                IcebergCatalogUtils.createTable(metastoreUri, warehouse, tableInfo);
            } else {
                // 4. or update table columns
                List<IcebergColumnInfo> existColumns = IcebergCatalogUtils.getColumns(metastoreUri, dbName, tableName);
                List<IcebergColumnInfo> needAddColumns = tableInfo.getColumns().stream().skip(existColumns.size())
                        .collect(toList());
                if (CollectionUtils.isNotEmpty(needAddColumns)) {
                    IcebergCatalogUtils.addColumns(metastoreUri, dbName, tableName, needAddColumns);
                    LOGGER.info("{} columns added for table {}", needAddColumns.size(), tableName);
                }
            }
            String info = "success to create iceberg resource";
            sinkService.updateStatus(sinkInfo.getId(), SinkStatus.CONFIG_SUCCESSFUL.getCode(), info);
            LOGGER.info(info + " for sinkInfo = {}", info);
        } catch (Throwable e) {
            String errMsg = "create iceberg table failed: " + e.getMessage();
            LOGGER.error(errMsg, e);
            sinkService.updateStatus(sinkInfo.getId(), SinkStatus.CONFIG_FAILED.getCode(), errMsg);
            throw new WorkflowException(errMsg);
        }
    }
Create iceberg table according to the sink config
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/iceberg/IcebergResourceOperator.java