[ 
https://issues.apache.org/jira/browse/METRON-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16042945#comment-16042945
 ] 

ASF GitHub Bot commented on METRON-987:
---------------------------------------

Github user justinleet commented on a diff in the pull request:

    https://github.com/apache/metron/pull/609#discussion_r120932742
  
    --- Diff: 
metron-platform/metron-common/src/main/java/org/apache/metron/common/message/JSONFromPosition.java
 ---
    @@ -40,10 +40,12 @@ public JSONFromPosition(int position) {
     
       @Override
       public JSONObject get(Tuple tuple) {
    +    String s = null;
         try {
    -      return (JSONObject) parser.get().parse(new 
String(tuple.getBinary(position), "UTF8"));
    +      s =  new String(tuple.getBinary(position), "UTF8");
    --- End diff --
    
    Can we just use StandardCharsets.UTF_8 then, and not even worry about the 
string being right?  I'm not sure where that alias is, so I'm not convinced 
it's guaranteed (although a source proving me wrong would also be acceptable)


> Allow stellar enrichments to be specified by a list as well as a map
> --------------------------------------------------------------------
>
>                 Key: METRON-987
>                 URL: https://issues.apache.org/jira/browse/METRON-987
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Casey Stella
>            Assignee: Casey Stella
>
> Currently, stellar enrichments are specified by a map associating fields with 
> the stellar expressions associated with the fields.  There is a significant 
> downside here in that you cannot update previously assigned fields.  For 
> instance, the following cannot be represented currently:
> {code}
>  "fieldMap": {
>        ...
>       "stellar" : {
>         "config" : {
>           "hostname" : "if ENDS_WITH(hostname, '.') then CHOP(hostname) else 
> hostname",
>           "hostname" : "TO_LOWER(hostname)"
>         }
>       }
>     }
> {code}
> A consequent of this deficiency is that we also cannot use temporary 
> variables and unset them after their use inside an enrichment group.
> The proposed change is to allow users to use lists of strings representing 
> stellar expression assignments with the same syntax as the Stellar REPL.  
> This would be as an alternative to maps, but the map syntax would also be 
> supported for legacy.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to