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 2022/12/07 04:18:32 UTC

[GitHub] [nifi] mattyb149 opened a new pull request, #6763: NIFI-10956: Fix inference issues with mixed arrays

mattyb149 opened a new pull request, #6763:
URL: https://github.com/apache/nifi/pull/6763

   # Summary
   
   [NIFI-10956](https://issues.apache.org/jira/browse/NIFI-10956)
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - [x] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [x] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [x] Pull Request based on current revision of the `main` branch
   - [x] Pull Request refers to a feature branch with one commit containing changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
     - [ ] JDK 8
     - [x] JDK 11
     - [ ] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


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

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] markap14 commented on pull request #6763: NIFI-10956: Fix inference issues with mixed arrays

Posted by GitBox <gi...@apache.org>.
markap14 commented on PR #6763:
URL: https://github.com/apache/nifi/pull/6763#issuecomment-1341266254

   @mattyb149 I actually just encountered an issue with another test. I tried sending in a case where we did have an ARRAY[STRING] and in another record an ARRAY[RECORD]. In that case, it still converted the Records into Strings.
   


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

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] markap14 merged pull request #6763: NIFI-10956: Fix inference issues with mixed arrays

Posted by GitBox <gi...@apache.org>.
markap14 merged PR #6763:
URL: https://github.com/apache/nifi/pull/6763


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

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] markap14 commented on pull request #6763: NIFI-10956: Fix inference issues with mixed arrays

Posted by GitBox <gi...@apache.org>.
markap14 commented on PR #6763:
URL: https://github.com/apache/nifi/pull/6763#issuecomment-1341077872

   Thanks for the fix @mattyb149! Definitely not a simple problem. The code looks good. The unit tests look good. I also did some manual testing with some more complex JSON objects.
   
   The only thing that I don't love about this PR is the fact that it's doing some stuff that's not very obvious. I.e., the fact that it's creating an ARRAY data type with a `null` element type, and then it's going in and replace those - and there's no documentation as to exactly what it's doing or why.
   
   Do you mind adding some inline documentation that explains what's going on? Namely that:
   - If we encounter an empty array in the first record, we have no way of knowing the type of elements.
   - If we just decide to use STRING as the type like we previously did, this can cause problems because:
         - Anything can be coerced into a STRING.
         - If we later encounter an array of Records there, we end up inferring that as a STRING
         - So we end up converting the Record objects into STRINGs
   - Instead, we create an Array where the element type is null
   - We then consider ARRAY[x] wider than ARRAY[null] for any x (other than null)
   - We then have to wait until the very end, after making inferences based on all data
   - At that point if the type is still inferred to be null we can just change it to a STRING
   
   In short, code looks great but needs a bit of documentation :)
   Otherwise I'm a +1


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

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] markap14 commented on pull request #6763: NIFI-10956: Fix inference issues with mixed arrays

Posted by GitBox <gi...@apache.org>.
markap14 commented on PR #6763:
URL: https://github.com/apache/nifi/pull/6763#issuecomment-1342821391

   Thanks @mattyb149 looks like all is working well now. +1 will merge to main


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

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org