public static Schema getPinotSchemaFromPinotSchemaWithComplexTypeHandling(Descriptors.Descriptor protoSchema,
      @Nullable Map<String, FieldSpec.FieldType> fieldTypeMap, @Nullable TimeUnit timeUnit, List<String> fieldsToUnnest,
      String delimiter) {
    Schema pinotSchema = new Schema();

    for (Descriptors.FieldDescriptor field : protoSchema.getFields()) {
      extractSchemaWithComplexTypeHandling(field, fieldsToUnnest, delimiter, field.getName(), pinotSchema,
          fieldTypeMap, timeUnit);
    }
    return pinotSchema;
  }
@Test
  public void testGetPinotSchemaFromPinotSchemaWithComplexTypeHandling()
      throws URISyntaxException, IOException {
    Descriptors.Descriptor desc = CompositeTypes.CompositeMessage.getDescriptor();
    Map<String, FieldSpec.FieldType> fieldTypeMap = new HashMap<>();
    fieldTypeMap.put("test_message.long_field", FieldSpec.FieldType.DATE_TIME);
    Schema schema = ProtoBufSchemaUtils.getPinotSchemaFromPinotSchemaWithComplexTypeHandling(
        desc,
        fieldTypeMap,
        TimeUnit.MILLISECONDS,
        Collections.emptyList(),
        ".");
    URL resource = getClass().getClassLoader().getResource("complex_type_schema.json");
    Schema expectedSchema = Schema.fromString(new String(Files.readAllBytes(Paths.get(resource.toURI()))));
    assertEquals(expectedSchema, schema);
  }