Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. @Test
  2. void example() throws IOException {
  3.  
  4. String avroSchema = "{\n" +
  5. " \"type\": \"struct\",\n" +
  6. " \"name\": \"MatomoRecord\",\n" +
  7. " \"fields\": [\n" +
  8. " {\"field\": \"name\", \"type\": \"string\"},\n" +
  9. " {\"field\": \"type\", \"type\": \"string\"},\n" +
  10. " {\"field\": \"timestamp\", \"type\": \"int64\"}\n" +
  11. " ]\n" +
  12. "}";
  13.  
  14. JsonConverter jsonConverter = new JsonConverter();
  15. jsonConverter.configure(new HashMap<>(), false);
  16. jsonConverter.asConnectSchema(new ObjectMapper().readTree(avroSchema));
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement