@Udf
  public List<String> items(@UdfParameter final String jsonItems) {
    if (jsonItems == null) {
      return null;
    }


    final List<JsonNode> objectList = UdfJsonMapper.readAsJsonArray(jsonItems);
    final List<String> res = new ArrayList<>();
    objectList.forEach(jsonObject -> {
      res.add(jsonObject.toString());
    });
    return res;
  }
@Test
  public void shouldExtractRecords() throws JsonProcessingException {
    // When
    String jsonArrayStr = "[{\"type\": \"AAA\", \"timestamp\": \"2022-01-27\"}, {\"type\": \"BBB\", \"timestamp\": \"2022-05-18\"}]";

    final List<String> result = udf.items(jsonArrayStr);
    // Then:
    final List<String> expected = ImmutableList.of(
        "{\"type\": \"AAA\", \"timestamp\": \"2022-01-27\"}", "{\"type\": \"BBB\", \"timestamp\": \"2022-05-18\"}");


    assertEquals(mapper.readTree(expected.get(0)), mapper.readTree(result.get(0)));
    assertEquals(mapper.readTree(expected.get(1)), mapper.readTree(result.get(1)));
  }