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-7843 Recursive avro schemas fail to write with RecordWriter #4550
Conversation
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.
LGTM
getSchemaName().isPresent() && getSchemaName().equals(other.getSchemaName())) { | ||
return true; | ||
} | ||
|
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.
I think it would worth to extend TestSimpleRecordSchema#testHashCodeAndEqualsWithSelfReferencingSchema
with this case.
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 @simonbence for the comment, I added a new test case to the TestSimpleRecordSchema
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 taking care of it!
Testing with different |
It seems Parquet doesn't support recursive schema. They have an open Jira and even a pull request, but the last meaningful updates on those are 2 years old: |
Thanks for the reply @turcsanyip, it seems it's in the Parquet library, as @tpalfy pointed out and the stacktrace supports this:
|
@tpalfy, @adenes Thanks for the clarification regarding Parquet. I tested the following cases and it works properly:
Found only one use case where still getting StackOverflow: both the reader and writer schemas defined explicitly, the schemas use the same field names but have different schema names. +1 LGTM |
Add new test case to TestSimpleRecordSchema to test the scenario when schema name and schema namespace match.
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.
lgtm+1
@adenes Thanks for the fix. Merging to main. |
NIFI-7843 Recursive avro schemas fail to write with RecordWriter Add new test case to TestSimpleRecordSchema to test the scenario when schema name and schema namespace match. This closes apache#4550. Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
NIFI-7843 Recursive avro schemas fail to write with RecordWriter Add new test case to TestSimpleRecordSchema to test the scenario when schema name and schema namespace match. This closes apache#4550. Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
NIFI-7843 Recursive avro schemas fail to write with RecordWriter Add new test case to TestSimpleRecordSchema to test the scenario when schema name and schema namespace match. This closes apache#4550. Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
Thank you for submitting a contribution to Apache NiFi.
Please provide a short description of the PR here:
Description of PR
Fixes StackOverflowError when trying to write avro data with recursive schema using RecordWriter.
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
main
)?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:
mvn -Pcontrib-check clean install
at the rootnifi
folder?LICENSE
file, including the mainLICENSE
file undernifi-assembly
?NOTICE
file, including the mainNOTICE
file found undernifi-assembly
?.displayName
in addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.