public static SerializableFunction<Row, byte[]> getRowToProtoBytesFromSchema(
      String schemaString, String messageName) {

    Descriptors.Descriptor descriptor = getDescriptorFromProtoSchema(schemaString, messageName);

    ProtoDynamicMessageSchema<DynamicMessage> protoDynamicMessageSchema =
        ProtoDynamicMessageSchema.forDescriptor(ProtoDomain.buildFrom(descriptor), descriptor);
    return new SimpleFunction<Row, byte[]>() {
      @Override
      public byte[] apply(Row input) {
        SerializableFunction<Row, DynamicMessage> res =
            protoDynamicMessageSchema.getFromRowFunction();
        return res.apply(input).toByteArray();
      }
    };
  }
@Test
  public void testRowToProtoSchemaFunction() {
    Row row =
        Row.withSchema(SCHEMA)
            .withFieldValue("id", 1234)
            .withFieldValue("name", "Doe")
            .withFieldValue("active", false)
            .withFieldValue("address.city", "seattle")
            .withFieldValue("address.street", "fake street")
            .withFieldValue("address.zip_code", "TO-1234")
            .withFieldValue("address.state", "wa")
            .build();

    Assert.assertNotNull(
        ProtoByteUtils.getRowToProtoBytesFromSchema(PROTO_STRING_SCHEMA, "MyMessage").apply(row));
  }