public static void validateSchema(DescriptorProperties descriptorProperties) {
        final boolean defineSchema = descriptorProperties.containsKey(FORMAT_SCHEMA);
        final boolean deriveSchema = descriptorProperties.containsKey(FORMAT_DERIVE_SCHEMA);

        if (defineSchema && deriveSchema) {
            throw new ValidationException("Format cannot define a schema and "
                    + "derive from the table's schema at the same time.");
        } else if (defineSchema) {
            descriptorProperties.validateString(FORMAT_SCHEMA, false);
        } else if (deriveSchema) {
            descriptorProperties.validateBoolean(FORMAT_DERIVE_SCHEMA, false);
        } else {
            throw new ValidationException("A definition of a schema or "
                    + "derivation from the table's schema is required.");
        }
    }
Validates the schema in the descriptor.

@param descriptorProperties The properties of the descriptor.
inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/base/TableFormatUtils.java