You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by MikeThomsen <gi...@git.apache.org> on 2018/08/27 12:23:44 UTC

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

GitHub user MikeThomsen opened a pull request:

    https://github.com/apache/nifi/pull/2969

    NIFI-5495 Made date format configurable.

    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [ ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [ ] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [ ] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
    - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


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

    $ git pull https://github.com/MikeThomsen/nifi NIFI-5495

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

    https://github.com/apache/nifi/pull/2969.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 #2969
    
----
commit 8333e1282ffee196a66a4f688c2ef2950e1fc9fc
Author: Mike Thomsen <mi...@...>
Date:   2018-08-27T12:22:26Z

    NIFI-5495 Made date format configurable.

----


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r212960490
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    This property only applies to JSON_STANDARD.
    
    - Is there a reason it can't apply to extended?
    - If you use extended what do you get?
    - That should be in the description I think.
    - Do we want to validate that you don't set DATE_FORMAT with JSON_EXTENDED?


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r212960991
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/main/java/org/apache/nifi/mongodb/MongoDBLookupService.java ---
    @@ -83,6 +84,7 @@
             .displayName("Projection")
             .description("Specifies a projection for limiting which fields will be returned.")
             .required(false)
    --- End diff --
    
    OK,  Can you explain what you are changing and why then?


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r213326155
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    Sure.


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r213375336
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    I didn't see any failures when I ran. What are you seeing?


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r213049169
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    I think the documentation is good @MikeThomsen, my gut thinks it would be better to validate dynamically that they don't have extended and date format set at the same time, but I wouldn't go to the mattresses on that.


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r213312718
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    Right, the code will work.  The user however may be a bit surprised.  "Why let me configure it, and then ignore what I put in without telling me?"


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r213305700
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    If they have them both set, it's not a problem. The processor just ignores the date format configuration.


---

[GitHub] nifi issue #2969: NIFI-5495 Made date format configurable.

Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on the issue:

    https://github.com/apache/nifi/pull/2969
  
    @zenfenan @mattyb149 can one of you review?


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r213317913
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    would you accept a PR on your ... PR?


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r213383530
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    When I run the tests in intellij ( I did do a PR, but there was too much shrapnel ), the tests that compare the content to the known values fail, because the json is pretty printed in the result but not the expected.


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r212992888
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    Because extended is the raw output from Mongo's driver and doesn't return a Data object or a String. It looks like this:
    
    ```
    {
      "date_field": {
         "$date":  1234567890L
    }
    ```
    
    We don't mess with extended JSON because it's a safe assumption that if the user wants that version they want the raw output for its Mongisms.


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r213357727
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    Also, some of the IT tests fail because of pretty printing causes comparison failures.


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r212993976
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    @ottobackwards updated the documentation.


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r212960358
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/main/java/org/apache/nifi/mongodb/MongoDBLookupService.java ---
    @@ -83,6 +84,7 @@
             .displayName("Projection")
             .description("Specifies a projection for limiting which fields will be returned.")
             .required(false)
    --- End diff --
    
    No, I'm lazy and didn't want to do a full review for a few lines of changes to fix the mongo test suite.


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r212991535
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/main/java/org/apache/nifi/mongodb/MongoDBLookupService.java ---
    @@ -83,6 +84,7 @@
             .displayName("Projection")
             .description("Specifies a projection for limiting which fields will be returned.")
             .required(false)
    --- End diff --
    
    It has no validator, ergo it is invalid according to the test framework.


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r214460944
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    Just rebased and reran the tests in IntelliJ and got 52/52 for the entire processor test package. Don't know what to tell ya.


---

[GitHub] nifi issue #2969: NIFI-5495 Made date format configurable.

Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on the issue:

    https://github.com/apache/nifi/pull/2969
  
    2/3 passed...


---

[GitHub] nifi issue #2969: NIFI-5495 Made date format configurable.

Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on the issue:

    https://github.com/apache/nifi/pull/2969
  
    @zenfenan Made that change. Seemed reasonable.


---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r213357507
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java ---
    @@ -173,6 +175,29 @@
                 .expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
                 .build();
     
    --- End diff --
    
    Actually, this get's into the weeds if you are going to keep it required. 
    Here is another idea - Can we rename the Display Name of the property to "Date Format For Standard JSON" ?



---

[GitHub] nifi pull request #2969: NIFI-5495 Made date format configurable.

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

    https://github.com/apache/nifi/pull/2969#discussion_r212959015
  
    --- Diff: nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/main/java/org/apache/nifi/mongodb/MongoDBLookupService.java ---
    @@ -83,6 +84,7 @@
             .displayName("Projection")
             .description("Specifies a projection for limiting which fields will be returned.")
             .required(false)
    --- End diff --
    
    Is this change from another PR?


---