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

        // Get all info from config
        HudiSinkDTO hudiInfo = getHudiInfo(sinkInfo);
        List<HudiColumnInfo> columnInfoList = getColumnList(sinkInfo);
        if (CollectionUtils.isEmpty(columnInfoList)) {
            throw new IllegalArgumentException("no hudi columns specified");
        }
        HudiTableInfo tableInfo = HudiSinkDTO.getHudiTableInfo(hudiInfo, columnInfoList);

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

        HudiCatalogClient client = null;
        try {
            client = new HudiCatalogClient(metastoreUri, warehouse, dbName);
            client.open();

            // 1. create database if not exists
            client.createDatabase(warehouse, true);
            // 2. check if the table exists
            boolean tableExists = client.tableExist(tableName);

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