private static String getColumnsAndComments(StarRocksTableInfo tableInfo) {
        List<StarRocksColumnInfo> columns = tableInfo.getColumns();
        List<String> columnList = new ArrayList<>();
        List<String> sortKeyList = new ArrayList<>();
        List<String> distributeList = new ArrayList<>();
        for (StarRocksColumnInfo columnInfo : columns) {
            // Construct columns and partition columns
            StringBuilder columnStr = new StringBuilder().append("`").append(columnInfo.getFieldName()).append("` ")
                    .append(columnInfo.getFieldType());
            if (StringUtils.isNotEmpty(columnInfo.getFieldComment())) {
                columnStr.append(" COMMENT ").append("'").append(columnInfo.getFieldComment()).append("'");
            }

            if (columnInfo.getIsDistributed()) {
                distributeList.add("`" + columnInfo.getFieldName() + "` ");
            }
            if (columnInfo.getIsSortKey()) {
                sortKeyList.add("`" + columnInfo.getFieldName() + "` ");
            }
            columnList.add(columnStr.toString());
        }
        StringBuilder result = new StringBuilder().append(" (").append(StringUtils.join(columnList, ",")).append(") ");
        if (StringUtils.isNotBlank(tableInfo.getPrimaryKey())) {
            result.append("PRIMARY KEY (")
                    .append(tableInfo.getPrimaryKey())
                    .append(") ");
        }
        // set partitions
        if (sortKeyList.size() > 0) {
            result.append("DUPLICATE KEY (").append(StringUtils.join(sortKeyList, ",")).append(") ");
        }
        if (distributeList.size() <= 0 && columns.size() > 0) {
            distributeList.add("`" + columns.get(0).getFieldName() + "` ");
        }
        result.append("DISTRIBUTED BY HASH (").append(StringUtils.join(distributeList, ",")).append(") ")
                .append("BUCKETS ")
                .append(tableInfo.getBarrelSize());
        return result.toString();
    }
Get columns and table comment string for create table SQL.

For example: col_name data_type [COMMENT col_comment], col_name data_type [COMMENT col_comment]....
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/starrocks/StarRocksSqlBuilder.java