Skip to content

NIFI-9983 Add output relation name attribute in QueryRecord processor#6011

Merged
markap14 merged 2 commits intoapache:mainfrom
juldrixx:NIFI-9983
Jun 21, 2022
Merged

NIFI-9983 Add output relation name attribute in QueryRecord processor#6011
markap14 merged 2 commits intoapache:mainfrom
juldrixx:NIFI-9983

Conversation

@juldrixx
Copy link
Contributor

@juldrixx juldrixx commented May 3, 2022

Summary

_NIFI-9983 updates the QueryRecord processor to write in the output flowfile the name of the destination route as it's done the RouteOnAttribute processor.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-0000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-0000

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 8
    • JDK 11
    • JDK 17

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@juldrixx juldrixx changed the title NIFI-9983 Add output relation name attribute NIFI-9983 Add output relation name attribute in QueryRecord processor May 3, 2022
@mh013370
Copy link
Contributor

mh013370 commented May 3, 2022

Is it possible to add/update unit tests to verify your changes?

@juldrixx
Copy link
Contributor Author

juldrixx commented May 3, 2022

I don't know if I did too much or not enough. If it's the latter, fell free to tell me.

@mh013370
Copy link
Contributor

mh013370 commented May 3, 2022

I don't know if I did too much or not enough. If it's the latter, fell free to tell me.

Thanks, this LGTM

Copy link
Contributor

@pvillard31 pvillard31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused by this change. You're adding the attribute to the original flow file but one could configure many dynamic properties with different queries and there could be many different relationships (one per query). I don't think the change makes sense given how the processor can be used.

@juldrixx
Copy link
Contributor Author

juldrixx commented May 4, 2022

I'm a bit confused by this change. You're adding the attribute to the original flow file but one could configure many dynamic properties with different queries and there could be many different relationships (one per query). I don't think the change makes sense given how the processor can be used.

I'm adding the attibrute to the original flow file in two cases: when the flow file goes in failure queue and in original queue but when the flow file goes to "query" queue and becomes a "transformed" flow file, I add the attribute with name of the "query queue".

To summarise:

  • if the flow file goes to failure, the failure queue name is put in the attribute.
  • if the flow file goes to original, the original queue is put in the attribute.
  • if the flow file goes to "query" queue, the query name is put in the attribute.

I did this to copy what is done in RouteOnAttribute to have an attribute to use to factor out part of the process after the processor with a condition on that attribute.

I'm not sure if its clearer?

Copy link
Contributor

@pvillard31 pvillard31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK understood @juldrixx, it makes sense, I did look at the code changes a bit too fast

@pvillard31 pvillard31 dismissed their stale review May 5, 2022 06:14

Explanations provided by PR author

@juldrixx juldrixx requested a review from pvillard31 May 6, 2022 11:55
@markap14
Copy link
Contributor

Thanks @juldrixx changes look good to me. I'm a +1, will merge to main.

@markap14 markap14 merged commit bc84532 into apache:main Jun 21, 2022
@juldrixx juldrixx deleted the NIFI-9983 branch June 21, 2022 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants