@Udf
  public <T> String toJsonString(@UdfParameter final T input) {
    return toJson(input);
  }
@Test
  public void shouldSerializeStruct() {
    // When:
    final Schema schema = SchemaBuilder.struct()
        .field("id", Schema.INT32_SCHEMA)
        .field("name", Schema.STRING_SCHEMA)
        .build();
    final Struct struct = new Struct(schema);
    struct.put("id", 1);
    struct.put("name", "Alice");
    final String result = udf.toJsonString(struct);

    // Then:
    assertEquals("{\"id\":1,\"name\":\"Alice\"}", result);
  }