Re: [PR] NIFI-12165 Changed the properties "Custom Transformation Class Name" and "Custom Module Directory" to depend on the "Jolt Transformation DSL" property when its value is "Custom" [nifi]
ChrisSamo632 commented on PR #7890: URL: https://github.com/apache/nifi/pull/7890#issuecomment-1775663229 > @ChrisSamo632 @exceptionfactory I understand the history from #7782 that there had to be two processors `JoltTransformJSON` and `JoltTransformRecord`. But my question is why is there duplicate code between the two processors? This MR and NIFI-11959 (#7678) are consequences of duplicate code (i.e. the need to make the same fix in both places). Is there something we can do here to refactor and extract the duplicate code to be shared with these two classes? @dan-s1 absolutely, I was thinking similar when I made the comment about the `*Record` processor in this PR, although I didn't think it was worth extending this PR to cover such a refactor. Could you raise a separate Jira ticket to refactor these processors to merge the logic where possible, e.g. the `PropertyDescriptor`s and such, at the very least, could be merged together. It would be good to explore whether things such as the custom UI available in the `JoltTransformJSON` could be merged together with `JoltTransformRecord` in the future, plus the handling of JOLT logic where possible. I'm not overly familiar with these processor, but without spending much time looking at the code, I'd hope that the only real difference *should* be whether the processor is applying the transform to the entire FlowFile content (i.e. in the `*JSON` processor) or every Record within (e.g. JSON Object within an Array, or every line of an ndjson/jsonl/json-ld file) - once the appropriate content has been read into memory, presumably the same JOLT transformation logic should be executed, then the result serialised either directly as the FlowFile's content (i.e. for `*JSON`) or via the configured `Record Set Writer` (i.e. for `*Record`). I've tried to do a similar thing for the `PutElastisearch*` processors previously (i.e. `*JSON` and `*Record`), which both extend an `AbstractPutElasticsearch` base in an attempt to minimise repetition and avoid maintenance problems/inconsistent behaviour between the processors. -- 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-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] NIFI-12165 Changed the properties "Custom Transformation Class Name" and "Custom Module Directory" to depend on the "Jolt Transformation DSL" property when its value is "Custom" [nifi]
asfgit closed pull request #7890: NIFI-12165 Changed the properties "Custom Transformation Class Name" and "Custom Module Directory" to depend on the "Jolt Transformation DSL" property when its value is "Custom" URL: https://github.com/apache/nifi/pull/7890 -- 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-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] NIFI-12165 Changed the properties "Custom Transformation Class Name" and "Custom Module Directory" to depend on the "Jolt Transformation DSL" property when its value is "Custom" [nifi]
dan-s1 commented on PR #7890: URL: https://github.com/apache/nifi/pull/7890#issuecomment-1772819385 @ChrisSamo632 @exceptionfactory I understand the history from #7782 that there had to be two processors `JoltTransformJSON` and `JoltTransformRecord`. But my question is why is there duplicate code between the two processors? This MR and NIFI-11959 are consequences of duplicate code. Is there something we can do here to refactor and extract the duplicate code to be shared with these two classes? -- 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-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[PR] NIFI-12165 Changed the properties "Custom Transformation Class Name" and "Custom Module Directory" to depend on the "Jolt Transformation DSL" property when its value is "Custom" [nifi]
dan-s1 opened a new pull request, #7890: URL: https://github.com/apache/nifi/pull/7890 # Summary [NIFI-12165](https://issues.apache.org/jira/browse/NIFI-12165) # Tracking Please complete the following tracking steps prior to pull request creation. ### Issue Tracking - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created ### Pull Request Tracking - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-0` - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-0` ### Pull Request Formatting - [ ] Pull Request based on current revision of the `main` branch - [ ] 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 21 ### 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-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org