You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/02/21 15:35:42 UTC

[GitHub] [nifi] taz1988 opened a new pull request #4067: NIFI-7178 - Handle the case when schema is not available

taz1988 opened a new pull request #4067: NIFI-7178 - Handle the case when schema is not available
URL: https://github.com/apache/nifi/pull/4067
 
 
   Thank you for submitting a contribution to Apache NiFi.
   
   This little fix contains an NPE fix. This NPE happening in the JsonPathRowRecordReader.java if the schema is not descript all fields in the input JSON.
   
   #### Description of PR
   
   This little fix contains an NPE fix. This NPE happening in the JsonPathRowRecordReader.java if the schema is not descript all fields in the input JSON.
   
   ### For all changes:
   - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
        in the commit message?
   
   - [x] 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.
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically `master`)?
   
   - [x] Is your initial contribution a single, squashed commit? _Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not `squash` or use `--force` when pushing to allow for clean monitoring of changes._
   
   ### For code changes:
   - [x] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi` folder?
   - [x] Have you written or updated unit tests to verify your changes?
   - [x] Have you verified that the full build is successful on both JDK 8 and JDK 11?
   - [x] 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)? 
   - [x] If applicable, have you updated the `LICENSE` file, including the main `LICENSE` file under `nifi-assembly`?
   - [x] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-assembly`?
   - [x] If adding new Properties, have you added `.displayName` in addition to .name (programmatic access) for each of the new properties?
   
   ### For documentation related changes:
   - [x] 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.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi] pvillard31 commented on a change in pull request #4067: NIFI-7178 - Handle the case when schema is not available

Posted by GitBox <gi...@apache.org>.
pvillard31 commented on a change in pull request #4067: NIFI-7178 - Handle the case when schema is not available
URL: https://github.com/apache/nifi/pull/4067#discussion_r382719408
 
 

 ##########
 File path: nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/JsonPathRowRecordReader.java
 ##########
 @@ -180,7 +181,7 @@ protected Object convert(final Object value, final DataType dataType, final Stri
             return new MapRecord(childSchema, values);
         }
 
-        if (value instanceof String) {
+        if (value instanceof String && Objects.nonNull(dataType)) {
 
 Review comment:
   To be consistent with the checks done in other parts of the code, would you be ok with?
   ```suggestion
           if (dataType != null && value instanceof String) {
   ```
   
   If yes, the Objects import should be removed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi] asfgit closed pull request #4067: NIFI-7178 - Handle the case when schema is not available

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #4067: NIFI-7178 - Handle the case when schema is not available
URL: https://github.com/apache/nifi/pull/4067
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi] taz1988 commented on a change in pull request #4067: NIFI-7178 - Handle the case when schema is not available

Posted by GitBox <gi...@apache.org>.
taz1988 commented on a change in pull request #4067: NIFI-7178 - Handle the case when schema is not available
URL: https://github.com/apache/nifi/pull/4067#discussion_r382767621
 
 

 ##########
 File path: nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/JsonPathRowRecordReader.java
 ##########
 @@ -180,7 +181,7 @@ protected Object convert(final Object value, final DataType dataType, final Stri
             return new MapRecord(childSchema, values);
         }
 
-        if (value instanceof String) {
+        if (value instanceof String && Objects.nonNull(dataType)) {
 
 Review comment:
   👍 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi] pvillard31 commented on issue #4067: NIFI-7178 - Handle the case when schema is not available

Posted by GitBox <gi...@apache.org>.
pvillard31 commented on issue #4067: NIFI-7178 - Handle the case when schema is not available
URL: https://github.com/apache/nifi/pull/4067#issuecomment-589988333
 
 
   +1, merged to master, thanks @taz1988 for your contribution!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [nifi] pvillard31 commented on a change in pull request #4067: NIFI-7178 - Handle the case when schema is not available

Posted by GitBox <gi...@apache.org>.
pvillard31 commented on a change in pull request #4067: NIFI-7178 - Handle the case when schema is not available
URL: https://github.com/apache/nifi/pull/4067#discussion_r382771816
 
 

 ##########
 File path: nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/JsonPathRowRecordReader.java
 ##########
 @@ -22,6 +22,7 @@
 import com.jayway.jsonpath.JsonPath;
 import com.jayway.jsonpath.PathNotFoundException;
 import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
+import java.util.Objects;
 
 Review comment:
   I believe this import should be removed now (because checkstyle will complain about unused import)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services