metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ottobackwards <...@git.apache.org>
Subject [GitHub] metron pull request #727: METRON-1146: Add ability to parse JSON string into...
Date Tue, 12 Sep 2017 11:06:00 GMT
Github user ottobackwards commented on a diff in the pull request:

    https://github.com/apache/metron/pull/727#discussion_r138314605
  
    --- Diff: metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/functions/StringFunctions.java
---
    @@ -506,29 +506,27 @@ public Object apply(List<Object> strings) {
         }
       }
     
    -  @Stellar( name = "PARSE_JSON_STRING"
    +  @Stellar(name = "JSON_PARSE"
               , description = "Returns a JSON object for the specified JSON string"
               , params = {
                 "str - the JSON String to convert, may be null"
               }
               , returns = "an Object containing the parsed JSON string"
       )
    -  public static class ParseJsonString extends BaseStellarFunction {
    +  public static class JsonParse extends BaseStellarFunction {
     
         @Override
         public Object apply(List<Object> strings) {
     
           if (strings == null || strings.size() == 0) {
    -        throw new IllegalArgumentException("[PARSE_JSON_STRING] incorrect arguments.
Usage: PARSE_JSON_STRING <String>");
    +        throw new IllegalArgumentException("[JSON_PARSE] incorrect arguments. Usage:
JSON_PARSE <String>");
           }
    --- End diff --
    
    Should we make sure instanceof string?


---

Mime
View raw message