streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfranklin <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: Streams 33
Date Tue, 20 May 2014 13:37:46 GMT
Github user mfranklin commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/21#discussion_r12843302
  
    --- Diff: streams-runtimes/streams-runtime-pig/src/main/java/org/apache/streams/pig/StreamsProcessDatumExec.java
---
    @@ -35,27 +55,50 @@ public StreamsProcessDatumExec(String... execArgs) throws ClassNotFoundException
             Preconditions.checkArgument(execArgs.length > 0);
             String classFullName = execArgs[0];
             Preconditions.checkNotNull(classFullName);
    -        String[] constructorArgs = new String[execArgs.length-1];
    +        String[] prepareArgs = new String[execArgs.length-1];
             ArrayUtils.remove(execArgs, 0);
    -        ArrayUtils.addAll(constructorArgs, execArgs);
    +        ArrayUtils.addAll(prepareArgs, execArgs);
             streamsProcessor = StreamsComponentFactory.getProcessorInstance(Class.forName(classFullName));
    -        streamsProcessor.prepare(null);
    +        if( execArgs.length == 1 ) {
    +            streamsProcessor.prepare(null);
    +        } else if( execArgs.length > 1 ) {
    +            streamsProcessor.prepare(prepareArgs);
    +        }
         }
     
         @Override
    -    public DataBag exec(Tuple line) throws IOException {
    +    public DataBag exec(Tuple input) throws IOException {
     
    -        if (line == null || line.size() == 0)
    +        if (input == null || input.size() == 0)
                 return null;
     
    +        DataBag output = BagFactory.getInstance().newDefaultBag();
    +
             Configuration conf = UDFContext.getUDFContext().getJobConf();
     
    -        String id = (String)line.get(0);
    -        String provider = (String)line.get(1);
    -        Long timestamp = (Long)line.get(2);
    -        String object = (String)line.get(3);
    +//      I would prefer it work this way, but at the moment it doesn't
    --- End diff --
    
    Why not?  Any reason specifically it doesn't work?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message