public static TableSchema dropConstraint(TableSchema oriSchema, String constraintName) {
        // Validate the constraint name is valid.
        Optional<UniqueConstraint> uniqueConstraintOpt = oriSchema.getPrimaryKey();
        if (!uniqueConstraintOpt.isPresent()
                || !uniqueConstraintOpt.get().getName().equals(constraintName)) {
            throw new ValidationException(
                    String.format("Constraint %s to drop does not exist", constraintName));
        }
        TableSchema.Builder builder = builderWithGivenColumns(oriSchema.getTableColumns());
        // Copy watermark specification.
        for (WatermarkSpec wms : oriSchema.getWatermarkSpecs()) {
            builder.watermark(
                    wms.getRowtimeAttribute(),
                    wms.getWatermarkExpr(),
                    wms.getWatermarkExprOutputType());
        }
        return builder.build();
    }
@Test
    void testDropConstraint() {
        TableSchema originalSchema =
                TableSchema.builder()
                        .field("a", DataTypes.INT().notNull())
                        .field("b", DataTypes.STRING())
                        .field("c", DataTypes.INT(), "a + 1")
                        .field("t", DataTypes.TIMESTAMP(3))
                        .primaryKey("ct1", new String[] {"a"})
                        .watermark("t", "t", DataTypes.TIMESTAMP(3))
                        .build();
        TableSchema newSchema = TableSchemaUtils.dropConstraint(originalSchema, "ct1");
        TableSchema expectedSchema =
                TableSchema.builder()
                        .field("a", DataTypes.INT().notNull())
                        .field("b", DataTypes.STRING())
                        .field("c", DataTypes.INT(), "a + 1")
                        .field("t", DataTypes.TIMESTAMP(3))
                        .watermark("t", "t", DataTypes.TIMESTAMP(3))
                        .build();
        assertThat(newSchema).isEqualTo(expectedSchema);

        // Drop non-exist constraint.
        assertThatThrownBy(() -> TableSchemaUtils.dropConstraint(originalSchema, "ct2"))
                .isInstanceOf(ValidationException.class)
                .hasMessage("Constraint ct2 to drop does not exist");
    }