class TableSchemaUtils {

	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();
	}

}