-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIFI-11197 Initial check in for Yaml record reader #7665
Conversation
4674f75
to
351952c
Compare
@exceptionfactory Is there anything else you would like me to do for this PR? |
@dan-s1 Nothing yet, I have been focusing on several other things, but plan to review this soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this new feature @dan-s1. The changes for reusing the JSON-based components look straightforward. I plan on doing some additional testing soon, but the general approach looks good.
...record-utils/nifi-json-record-utils/src/main/java/org/apache/nifi/json/JsonRecordSource.java
Outdated
Show resolved
Hide resolved
...d-serialization-services/src/test/java/org/apache/nifi/yaml/TestYamlTreeRowRecordReader.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience on this PR @dan-s1. In the course of review, I noticed several disabled test methods. Unless you are planning to adjust them for this PR, they should be removed. As noted to the comments for those tests, those particular styles may not be applicable to JSON, so it is better to leave them out for the initial version.
...d-serialization-services/src/test/java/org/apache/nifi/yaml/TestYamlTreeRowRecordReader.java
Outdated
Show resolved
Hide resolved
...d-serialization-services/src/test/java/org/apache/nifi/yaml/TestYamlTreeRowRecordReader.java
Outdated
Show resolved
Hide resolved
@exceptionfactory I see three out of the four builds succeeded but I do not see a reason for the one that failed. Also I am not sure why are there conflicts. Please advise. |
@dan-s1 The failure appears to be an intermittent issue based on heap space for the build. We may need to address that separately, but it is not a concern for this PR. However, I just merged a separate PR adding |
@exceptionfactory There are conflicts (I guess obviously) I will try to resolve and then push. |
@exceptionfactory I am trying to rework my code to handle the changes made in #7823 for NIFI-12153. What I am discovering is that YAML supports comments and there is no way to turn off parsing of comments. In addition I am trying to mimic |
Thanks for the details @dan-s1. If the YAML implementation does not support the same constraints, then I recommend not including those property descriptors on the YAML Record Reader implementation. |
@dan-s1 Just out of (genuine) curiosity, what prompted this feature? I have never seen anyone use YAML as anything other than a configuration file format. What horror story/interesting use case prompted it? :-D |
@exceptionfactory Then would it be okay to have in
|
@MikeThomsen Please refer to the ticket for more details but the submitter's use case was to have ability to convert from Yaml to Json. |
Thanks for the example @dan-s1, yes, if those properties do not appear to be honored with the YAML implementation, then that is one approach. However, given the number of times that this method will be called, it would be better to define a local static list of supported properties and return that reference in |
@exceptionfactory The problem with static is I need many of the properties which are defined in instance methods in |
Thanks for noting that detail @dan-s1, in that case, the approach you outlined seems like the best option. |
@exceptionfactory I resolved the conflicts but mistakenly rebased and squashed the commits. I believe all the changes you had requested are all in there. Is that okay? |
Thanks for the updates @dan-s1, I will take a closer look soon. |
@exceptionfactory The failed build seems to not have to do with any of my changes. |
@exceptionfactory Any chance this can make 1.24? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dan-s1, I just pushed a minor update to simplify the JsonParserFactory
interface usage and streamline some test methods. I consolidated the two JsonParserFactory
methods into one, which clarifies the usage in different components.
After going through a few more runtime tests, this should be ready to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@exceptionfactory Great changes! Just had some minor comments.
...cord-utils/nifi-json-record-utils/src/main/java/org/apache/nifi/json/TokenParserFactory.java
Outdated
Show resolved
Hide resolved
...ecord-utils/nifi-json-record-utils/src/main/java/org/apache/nifi/json/JsonParserFactory.java
Show resolved
Hide resolved
...record-utils/nifi-json-record-utils/src/main/java/org/apache/nifi/json/JsonRecordSource.java
Show resolved
Hide resolved
- YAML implementation returns default settings
b9c7af2
to
cd41ca1
Compare
@dan-s1 In the course of runtime testing, I found an issue with the Max String Length property value being |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the contribution @dan-s1, after making one more adjustment to handle the Allow Comments
property, the latest version passes all tests and works as expected during runtime verification. +1 merging
@exceptionfactory Thank you! I am not sure if there is a delay or not but in Jira I still see the status as Patch Available. |
You're welcome @dan-s1. I am verifying the changes for the support branch, I updated the Jira to resolved for 2.0.0, and should be able to include 1.24.0 shortly. |
Summary
NIFI-11197
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000
NIFI-00000
Pull Request Formatting
main
branchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-check
Licensing
LICENSE
andNOTICE
filesDocumentation