@Udf
  public <T> Boolean contains(
      @UdfParameter final String jsonArray,
      @UdfParameter final T val
  ) {
    try (JsonParser parser = PARSER_FACTORY.createParser(jsonArray)) {
      if (parser.nextToken() != START_ARRAY) {
        return false;
      }

      while (parser.nextToken() != null) {
        final JsonToken token = parser.currentToken();

        if (token == null) {
          return val == null;
        } else if (token == END_ARRAY) {
          return false;
        }

        parser.skipChildren();
        if (TOKEN_COMPAT.getOrDefault(token, foo -> false).test(val)) {
          if (token == VALUE_NULL
              || (val != null && Objects.equals(parser.readValueAs(val.getClass()), val))) {
            return true;
          }
        }
      }

      return false;
    } catch (final IOException e) {
      return false;
    }
  }
@Test
    public void shouldFindIntegersInJsonArray() {
        final String json = "[2147483647, {\"ab\":null }, -2147483648, 1, 2, 3, null, [4], 4]";
        assertEquals(true, jsonUdf.contains(json, 2147483647));
        assertEquals(true, jsonUdf.contains(json, -2147483648));
        assertEquals(true, jsonUdf.contains(json, 1));
        assertEquals(true, jsonUdf.contains(json, 2));
        assertEquals(true, jsonUdf.contains(json, 3));
        assertEquals(false, jsonUdf.contains("5", 5));
        assertEquals(false, jsonUdf.contains(json, 5));
    }