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

ASF GitHub Bot commented on APEXMALHAR-2015:
--------------------------------------------

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

    
https://github.com/apache/incubator-apex-malhar/pull/217#discussion_r56806642
  
    --- Diff: 
library/src/test/java/com/datatorrent/lib/projection/ProjectionTest.java ---
    @@ -0,0 +1,264 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +
    +package com.datatorrent.lib.projection;
    +
    +import java.lang.reflect.Field;
    +
    +import org.junit.AfterClass;
    +import org.junit.Assert;
    +import org.junit.BeforeClass;
    +import org.junit.Test;
    +
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +/**
    + * Tests for ProjectionOperator
    + */
    +
    +public class ProjectionTest
    --- End diff --
    
    Can you also add a test with source and sink?
    For example you can refer here:
    
https://github.com/apache/incubator-apex-malhar/blob/master/library/src/test/java/com/datatorrent/lib/math/AverageTest.java
    
    There are bunch of others too.


> Projection Operator
> -------------------
>
>                 Key: APEXMALHAR-2015
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-2015
>             Project: Apache Apex Malhar
>          Issue Type: New Feature
>            Reporter: Pradeep A Dalvi
>
> Projection Operator will allow apex users to project (select/drop) certain 
> fields from the incoming tuples. This operation might be done unconditionally 
> or based on certain condition.
> Use case:
> -------------
> Not all fields of tuples are of interest for the downstream operators. In 
> such cases, one may want project selective fields to downstream. Also one may 
> want to drop few fields, instead of selecting many.
> In certain scenarios, one may want to project certain fields based on given 
> condition or expression.
> Functionality:
> -----------------
> 1. Projection operator shall receive POJO as input tuple and emit 2 POJOs on 
> separate output ports i.e. selected and dropped. Selected output port shall 
> emit POJO with selected fields and dropped output shall emit POJO of dropped 
> fields.
> 2. Operator needs select or drop fields as input params. This shall be 
> specified using comma separated list of fields.
> 3. Operator shall emit POJO only on connected output ports. In another words, 
> if dropped output port is not connected, it shall not even try to generate 
> POJOs with dropped fields.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to