private static String getColumnsAndComments(List<HiveColumnInfo> columns, String tableComment) {
        List<String> columnList = new ArrayList<>();
        List<String> partitionList = new ArrayList<>();
        for (HiveColumnInfo columnInfo : columns) {
            // Construct columns and partition columns
            StringBuilder columnStr = new StringBuilder().append("`").append(columnInfo.getName()).append("` ")
                    .append(columnInfo.getType());
            if (StringUtils.isNotEmpty(columnInfo.getDesc())) {
                columnStr.append(" COMMENT ").append("'").append(columnInfo.getDesc()).append("'");
            }

            if (columnInfo.isPartition()) {
                partitionList.add(columnStr.toString());
            } else {
                columnList.add(columnStr.toString());
            }
        }
        StringBuilder result = new StringBuilder().append(" (").append(StringUtils.join(columnList, ",")).append(") ");

        // set table comment
        if (StringUtils.isNotEmpty(tableComment)) {
            result.append("COMMENT ").append("'").append(tableComment).append("' ");
        }
        // set partitions
        if (partitionList.size() > 0) {
            result.append("PARTITIONED BY (").append(StringUtils.join(partitionList, ",")).append(") ");
        }

        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/hive/SqlBuilder.java