apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (APEXMALHAR-2157) Improvements in JSON Formatter
Date Mon, 25 Jul 2016 11:44:20 GMT

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

ASF GitHub Bot commented on APEXMALHAR-2157:

Github user shubham-pathak22 commented on a diff in the pull request:

    --- Diff: library/src/test/java/com/datatorrent/lib/formatter/JsonFormatterTest.java ---
    @@ -182,14 +173,19 @@ public void testJSONToPOJONoFieldPOJO()
         Assert.assertEquals(0, validDataSink.collectedTuples.size());
         Assert.assertEquals(1, invalidDataSink.collectedTuples.size());
         Assert.assertEquals(o, invalidDataSink.collectedTuples.get(0));
    +    Assert.assertEquals(1, operator.getIncomingTuplesCount());
    +    Assert.assertEquals(0, operator.getEmittedObjectCount());
    +    Assert.assertEquals(1, operator.getErrorTupleCount());
       public static class Test1Pojo
         public int a;
         public long b;
    +    @JsonProperty("c2")
         public String c;
         public List<String> d;
    +    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd")
    --- End diff --
    1. By default Date object is written as time in millis. Had added the test for it, it
passes on local machine but getting build failures when I check in the code. Hence in the
test case, I have formated the date values to limit to year, month and day
    2. There is no annotation for time field. Time field in the POJO is written as "time in
millis". Faced similar issue with the test case as above.
    3. Have added multiple patterns. Locally I have tested with "timezone" fields as well
and it works. Again, locally the test case passes but fails after checking it in.
    4. http://fasterxml.github.io/jackson-annotations/javadoc/2.1.0/com/fasterxml/jackson/annotation/JsonFormat.Shape.html

> Improvements in JSON Formatter
> ------------------------------
>                 Key: APEXMALHAR-2157
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-2157
>             Project: Apache Apex Malhar
>          Issue Type: Improvement
>            Reporter: shubham pathak
>            Assignee: shubham pathak
>            Priority: Minor
> We need following features in existing JSON Formatter
> 1. Ability to provide date format for different date fields in POJO. Current implementation
accepts just one format and applies the same to all date fields.
> 2. Ability to provide JSON field to POJO field mapping.

This message was sent by Atlassian JIRA

View raw message