public static void validateSchema(@Nonnull Schema schema,
      @Nonnull SchemaConformingTransformerConfig transformerConfig) {
    validateSchemaFieldNames(schema.getPhysicalColumnNames(), transformerConfig);

    String indexableExtrasFieldName = transformerConfig.getIndexableExtrasField();
    getAndValidateExtrasFieldType(schema, indexableExtrasFieldName);
    String unindexableExtrasFieldName = transformerConfig.getUnindexableExtrasField();
    if (null != unindexableExtrasFieldName) {
      getAndValidateExtrasFieldType(schema, indexableExtrasFieldName);
    }

    validateSchemaAndCreateTree(schema);
  }
@Test
  public void testInvalidFieldNamesInSchema() {
    // Ensure schema fields which end with unindexableFieldSuffix are caught as invalid
    Assert.assertThrows(() -> {
      Schema schema =
          createDefaultSchemaBuilder().addSingleValueDimension("a" + UNINDEXABLE_FIELD_SUFFIX, DataType.STRING)
              .addSingleValueDimension("a.b" + UNINDEXABLE_FIELD_SUFFIX, DataType.INT).build();
      SchemaConformingTransformer.validateSchema(schema,
          new SchemaConformingTransformerConfig(INDEXABLE_EXTRAS_FIELD_NAME, null, UNINDEXABLE_FIELD_SUFFIX, null));
    });

    // Ensure schema fields which are in fieldPathsToDrop are caught as invalid
    Assert.assertThrows(() -> {
      Schema schema = createDefaultSchemaBuilder().addSingleValueDimension("a", DataType.STRING)
          .addSingleValueDimension("b.c", DataType.INT).build();
      Set<String> fieldPathsToDrop = new HashSet<>(Arrays.asList("a", "b.c"));
      SchemaConformingTransformer.validateSchema(schema,
          new SchemaConformingTransformerConfig(INDEXABLE_EXTRAS_FIELD_NAME, null, null, fieldPathsToDrop));
    });
  }