public String build(TablePath tablePath) {
        StringBuilder createTableSql = new StringBuilder();
        createTableSql
                .append(CatalogUtils.quoteIdentifier("CREATE TABLE ", fieldIde))
                .append(tablePath.getSchemaAndTableName("\""))
                .append(" (\n");

        List<String> columnSqls =
                columns.stream()
                        .map(
                                column ->
                                        CatalogUtils.quoteIdentifier(
                                                buildColumnSql(column), fieldIde))
                        .collect(Collectors.toList());

        if (createIndex && CollectionUtils.isNotEmpty(constraintKeys)) {
            for (ConstraintKey constraintKey : constraintKeys) {
                if (StringUtils.isBlank(constraintKey.getConstraintName())
                        || (primaryKey != null
                                && StringUtils.equals(
                                        primaryKey.getPrimaryKey(),
                                        constraintKey.getConstraintName()))) {
                    continue;
                }
                isHaveConstraintKey = true;
                switch (constraintKey.getConstraintType()) {
                    case UNIQUE_KEY:
                        String uniqueKeySql = buildUniqueKeySql(constraintKey);
                        columnSqls.add("\t" + uniqueKeySql);
                        break;
                    case INDEX_KEY:
                        String indexKeySql = buildIndexKeySql(tablePath, constraintKey);
                        createIndexSqls.add(indexKeySql);
                        break;
                    case FOREIGN_KEY:
                        // todo: add foreign key
                        break;
                }
            }
        }

        createTableSql.append(String.join(",\n", columnSqls));
        createTableSql.append("\n);");

        List<String> commentSqls =
                columns.stream()
                        .filter(column -> StringUtils.isNotBlank(column.getComment()))
                        .map(
                                columns ->
                                        buildColumnCommentSql(
                                                columns, tablePath.getSchemaAndTableName("\"")))
                        .collect(Collectors.toList());

        if (!commentSqls.isEmpty()) {
            createTableSql.append("\n");
            createTableSql.append(String.join(";\n", commentSqls)).append(";");
        }

        return createTableSql.toString();
    }
@Test
    void build() {
        Arrays.asList(true, false)
                .forEach(
                        otherDB -> {
                            CatalogTable catalogTable = catalogTable(otherDB);
                            PostgresCreateTableSqlBuilder postgresCreateTableSqlBuilder =
                                    new PostgresCreateTableSqlBuilder(catalogTable, true);
                            String createTableSql =
                                    postgresCreateTableSqlBuilder.build(
                                            catalogTable.getTableId().toTablePath());
                            Assertions.assertEquals(
                                    "CREATE TABLE \"test\" (\n"
                                            + "\"id\" int4 NOT NULL PRIMARY KEY,\n"
                                            + "\"name\" text NOT NULL,\n"
                                            + "\"age\" int4 NOT NULL,\n"
                                            + "\tCONSTRAINT unique_name UNIQUE (\"name\")\n"
                                            + ");",
                                    createTableSql);
                            Assertions.assertEquals(
                                    Lists.newArrayList(
                                            "CREATE INDEX test_index_age ON \"test\"(\"age\");"),
                                    postgresCreateTableSqlBuilder.getCreateIndexSqls());

                            // skip index
                            PostgresCreateTableSqlBuilder postgresCreateTableSqlBuilderSkipIndex =
                                    new PostgresCreateTableSqlBuilder(catalogTable, false);
                            String createTableSqlSkipIndex =
                                    postgresCreateTableSqlBuilderSkipIndex.build(
                                            catalogTable.getTableId().toTablePath());
                            Assertions.assertEquals(
                                    "CREATE TABLE \"test\" (\n"
                                            + "\"id\" int4 NOT NULL,\n"
                                            + "\"name\" text NOT NULL,\n"
                                            + "\"age\" int4 NOT NULL\n"
                                            + ");",
                                    createTableSqlSkipIndex);
                            Assertions.assertEquals(
                                    Lists.newArrayList(),
                                    postgresCreateTableSqlBuilderSkipIndex.getCreateIndexSqls());
                        });
    }