You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by shubham-pathak22 <gi...@git.apache.org> on 2016/04/15 13:59:11 UTC

[GitHub] incubator-apex-malhar pull request: SPOI-7909 Bug Fixed

GitHub user shubham-pathak22 opened a pull request:

    https://github.com/apache/incubator-apex-malhar/pull/243

    SPOI-7909 Bug Fixed

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shubham-pathak22/incubator-apex-malhar SPOI-7909

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-apex-malhar/pull/243.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #243
    
----
commit 7a7a9619370df5afcff90a2a8e56ed126821d626
Author: shubham <sh...@github.com>
Date:   2016-04-15T11:57:32Z

    SPOI-7909 Bug Fixed

----


---
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.
---

[GitHub] incubator-apex-malhar pull request: APEXMALHAR-2057 : CSVParser fa...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-apex-malhar/pull/243


---
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.
---

[GitHub] incubator-apex-malhar pull request: APEXMALHAR-2057 : CSVParser fa...

Posted by gauravgopi123 <gi...@git.apache.org>.
Github user gauravgopi123 commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-malhar/pull/243#discussion_r63084018
  
    --- Diff: contrib/src/test/java/com/datatorrent/contrib/parser/CsvPOJOParserTest.java ---
    @@ -319,6 +331,19 @@ public void TestParserMoreFields()
       }
     
       @Test
    +  public void TestParserMoreFieldsOnlyPOJOPortConnected()
    +  {
    +    parser.parsedOutput.setSink(null);
    +    parser.beginWindow(0);
    +    parser.in.process(
    +        "1234,98233,adxyz,0.2,2015-03-08 03:37:12,11/12/2012,12,y,OPTIMIZATION,CAMP_AD,Y,yes,ExtraField".getBytes());
    +    parser.endWindow();
    +    Assert.assertEquals(0, objectPort.collectedTuples.size());
    +    Assert.assertEquals(0, pojoPort.collectedTuples.size());
    +    Assert.assertEquals(1, error.collectedTuples.size());
    --- End diff --
    
    Can you add small addition to make sure that error port has same string tuple that was passed on input port?


---
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.
---

[GitHub] incubator-apex-malhar pull request: APEXMALHAR-2057 : CSVParser fa...

Posted by sandeepdeshmukh <gi...@git.apache.org>.
Github user sandeepdeshmukh commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-malhar/pull/243#discussion_r63366117
  
    --- Diff: contrib/src/test/java/com/datatorrent/contrib/parser/CsvPOJOParserTest.java ---
    @@ -292,30 +313,68 @@ public void TestParserHeaderAsInput()
         Assert.assertEquals(0, objectPort.collectedTuples.size());
         Assert.assertEquals(0, pojoPort.collectedTuples.size());
         Assert.assertEquals(1, error.collectedTuples.size());
    +    KeyValPair<String,String> errorTuple = (KeyValPair<String, String>)error.collectedTuples.get(0);
    +    Assert.assertEquals(input, errorTuple.getKey());
       }
     
       @Test
       public void TestParserLessFields()
       {
    +    String input = "1234,98233,adxyz,0.2,2015-03-08 03:37:12,11/12/2012,12,y,OPTIMIZATION";
         parser.beginWindow(0);
    -    parser.in.process("1234,98233,adxyz,0.2,2015-03-08 03:37:12,11/12/2012,12,y,OPTIMIZATION".getBytes());
    +    parser.in.process(input.getBytes());
         parser.endWindow();
         Assert.assertEquals(0, objectPort.collectedTuples.size());
         Assert.assertEquals(0, pojoPort.collectedTuples.size());
         Assert.assertEquals(1, error.collectedTuples.size());
    +    KeyValPair<String,String> errorTuple = (KeyValPair<String, String>)error.collectedTuples.get(0);
    +    Assert.assertEquals(input, errorTuple.getKey());
    +  }
    +
    +  @Test
    +  public void TestParserLessFieldsOnlyPOJOPortConnected()
    +  {
    +    String input = "1234,98233,adxyz,0.2,2015-03-08 03:37:12,11/12/2012,12,y,OPTIMIZATION";
    +    parser.parsedOutput.setSink(null);
    +    parser.beginWindow(0);
    +    parser.in.process(input.getBytes());
    +    parser.endWindow();
    +    Assert.assertEquals(0, objectPort.collectedTuples.size());
    +    Assert.assertEquals(0, pojoPort.collectedTuples.size());
    +    Assert.assertEquals(1, error.collectedTuples.size());
    +    KeyValPair<String, String> errorTuple = (KeyValPair<String, String>)error.collectedTuples.get(0);
    +    Assert.assertEquals(input, errorTuple.getKey());
       }
     
       @Test
       public void TestParserMoreFields()
       {
     
    +    String input = "1234,98233,adxyz,0.2,2015-03-08 03:37:12,11/12/2012,12,y,OPTIMIZATION,CAMP_AD,Y,yes,ExtraField";
         parser.beginWindow(0);
    -    parser.in.process("1234,98233,adxyz,0.2,2015-03-08 03:37:12,11/12/2012,12,y,OPTIMIZATION,CAMP_AD,Y,yes,ExtraField"
    -        .getBytes());
    +    parser.in.process(input.getBytes());
    +    parser.endWindow();
    +    Assert.assertEquals(0, objectPort.collectedTuples.size());
    +    Assert.assertEquals(0, pojoPort.collectedTuples.size());
    +    Assert.assertEquals(1, error.collectedTuples.size());
    +    KeyValPair<String, String> errorTuple = (KeyValPair<String, String>)error.collectedTuples.get(0);
    +    Assert.assertEquals(input, errorTuple.getKey());
    +  }
    +
    +  @Test
    +  public void TestParserMoreFieldsOnlyPOJOPortConnected()
    +  {
    +    String input = "1234,98233,adxyz,0.2,2015-03-08 03:37:12,11/12/2012,12,y,OPTIMIZATION,CAMP_AD,Y,yes,ExtraField";
    +    parser.parsedOutput.setSink(null);
    +    parser.beginWindow(0);
    +    parser.in.process(input.getBytes());
         parser.endWindow();
         Assert.assertEquals(0, objectPort.collectedTuples.size());
         Assert.assertEquals(0, pojoPort.collectedTuples.size());
         Assert.assertEquals(1, error.collectedTuples.size());
    +    Assert.assertEquals(1, error.collectedTuples.size());
    --- End diff --
    
    Looks like  duplicate line, same as 374. Could you please remove that.


---
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.
---