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/05/03 18:19:51 UTC

[GitHub] [nifi] juldrixx opened a new pull request, #6011: NIFI-9983 Add output relation name attribute

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

   <!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
   <!-- contributor license agreements.  See the NOTICE file distributed with -->
   <!-- this work for additional information regarding copyright ownership. -->
   <!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
   <!-- (the "License"); you may not use this file except in compliance with -->
   <!-- the License.  You may obtain a copy of the License at -->
   <!--     http://www.apache.org/licenses/LICENSE-2.0 -->
   <!-- Unless required by applicable law or agreed to in writing, software -->
   <!-- distributed under the License is distributed on an "AS IS" BASIS, -->
   <!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
   <!-- See the License for the specific language governing permissions and -->
   <!-- limitations under the License. -->
   
   # Summary
   
   _[NIFI-9983](https://issues.apache.org/jira/browse/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
   
   - [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-0000`
   - [X] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-0000`
   
   ### 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
   
   - [X] 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 merged pull request #6011: NIFI-9983 Add output relation name attribute in QueryRecord processor

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


-- 
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] juldrixx commented on pull request #6011: NIFI-9983 Add output relation name attribute in QueryRecord processor

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

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


-- 
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] michael81877 commented on pull request #6011: NIFI-9983 Add output relation name attribute in QueryRecord processor

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

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


-- 
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] michael81877 commented on pull request #6011: NIFI-9983 Add output relation name attribute in QueryRecord processor

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

   > 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


-- 
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] juldrixx commented on a diff in pull request #6011: NIFI-9983 Add output relation name attribute in QueryRecord processor

Posted by GitBox <gi...@apache.org>.
juldrixx commented on code in PR #6011:
URL: https://github.com/apache/nifi/pull/6011#discussion_r865616151


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryRecord.java:
##########
@@ -312,6 +317,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
                     final QueryResult queryResult = query(session, original, readerSchema, sql, recordReaderFactory);
 
                     final AtomicReference<String> mimeTypeRef = new AtomicReference<>();
+                    final FlowFile originalFlowFile = original;

Review Comment:
   Yes I need a final variable for the inner class so I don't get this error: `Variable 'original' is accessed from within inner class, needs to be final or effectively final`.
   
   The same was done for the AbstractRecordProcessor class [here](https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractRecordProcessor.java#L119).



-- 
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] pvillard31 commented on a diff in pull request #6011: NIFI-9983 Add output relation name attribute in QueryRecord processor

Posted by GitBox <gi...@apache.org>.
pvillard31 commented on code in PR #6011:
URL: https://github.com/apache/nifi/pull/6011#discussion_r865580973


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryRecord.java:
##########
@@ -312,6 +317,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
                     final QueryResult queryResult = query(session, original, readerSchema, sql, recordReaderFactory);
 
                     final AtomicReference<String> mimeTypeRef = new AtomicReference<>();
+                    final FlowFile originalFlowFile = original;

Review Comment:
   is this required?



-- 
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] juldrixx commented on a diff in pull request #6011: NIFI-9983 Add output relation name attribute in QueryRecord processor

Posted by GitBox <gi...@apache.org>.
juldrixx commented on code in PR #6011:
URL: https://github.com/apache/nifi/pull/6011#discussion_r865616151


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryRecord.java:
##########
@@ -312,6 +317,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
                     final QueryResult queryResult = query(session, original, readerSchema, sql, recordReaderFactory);
 
                     final AtomicReference<String> mimeTypeRef = new AtomicReference<>();
+                    final FlowFile originalFlowFile = original;

Review Comment:
   Yes I need a final variable an the inner class so I don't get this error: `Variable 'original' is accessed from within inner class, needs to be final or effectively final`.
   
   The same was done for the AbstractRecordProcessor class [here](https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractRecordProcessor.java#L119).



-- 
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] juldrixx commented on pull request #6011: NIFI-9983 Add output relation name attribute in QueryRecord processor

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

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


-- 
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 #6011: NIFI-9983 Add output relation name attribute in QueryRecord processor

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

   Thanks @juldrixx changes look good to me. I'm a +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