You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "steven-matison (via GitHub)" <gi...@apache.org> on 2023/05/31 11:35:24 UTC

[GitHub] [nifi] steven-matison opened a new pull request, #7316: NIFI-11608 Fixing Expression Language Evaluation in dataset and tablename.

steven-matison opened a new pull request, #7316:
URL: https://github.com/apache/nifi/pull/7316

   # Summary
   [NIFI-00000](https://issues.apache.org/jira/browse/NIFI-00000)
   Fixing Expression Language Evaluation in dataset and tablename.
   
   # 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-00000`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### 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 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
   
   - [ ] 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] exceptionfactory commented on a diff in pull request #7316: NIFI-11608 Fixing Expression Language Evaluation in dataset and tablename.

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #7316:
URL: https://github.com/apache/nifi/pull/7316#discussion_r1211688613


##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/PutBigQuery.java:
##########
@@ -203,20 +201,24 @@ public void onUnscheduled() {
     public void onTrigger(ProcessContext context, ProcessSession session)  {
         WriteStream writeStream;
         Descriptors.Descriptor protoDescriptor;
+
+        FlowFile flowFile = session.get();
+        if (flowFile == null) {
+            return;
+        }
+
+        final TableName tableName = TableName.of(context.getProperty(PROJECT_ID).getValue(), context.getProperty(DATASET).evaluateAttributeExpressions(flowFile).getValue(), context.getProperty(TABLE_NAME).evaluateAttributeExpressions(flowFile).getValue());

Review Comment:
   This variable name is shadowing `tableName` on line 118, so the member variable declaration on that line needs to be removed as well.



##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/PutBigQuery.java:
##########
@@ -203,20 +201,24 @@ public void onUnscheduled() {
     public void onTrigger(ProcessContext context, ProcessSession session)  {
         WriteStream writeStream;
         Descriptors.Descriptor protoDescriptor;
+
+        FlowFile flowFile = session.get();
+        if (flowFile == null) {
+            return;
+        }
+
+        final TableName tableName = TableName.of(context.getProperty(PROJECT_ID).getValue(), context.getProperty(DATASET).evaluateAttributeExpressions(flowFile).getValue(), context.getProperty(TABLE_NAME).evaluateAttributeExpressions(flowFile).getValue());

Review Comment:
   Recommend breaking this into multiple lines for better readability.
   ```suggestion
           final String projectId = context.getProperty(PROJECT_ID).getValue();
           final String dataset = context.getProperty(DATASET).evaluateAttributeExpressions(flowFile).getValue();
           final String dataTableName = context.getProperty(TABLE_NAME).evaluateAttributeExpressions(flowFile).getValue();
           final TableName tableName = TableName.of(projectId, dataset, dataTableName);
   ```



-- 
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] steven-matison commented on a diff in pull request #7316: NIFI-11608 Fixing Expression Language Evaluation in dataset and tablename.

Posted by "steven-matison (via GitHub)" <gi...@apache.org>.
steven-matison commented on code in PR #7316:
URL: https://github.com/apache/nifi/pull/7316#discussion_r1211726531


##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/PutBigQuery.java:
##########
@@ -203,20 +201,24 @@ public void onUnscheduled() {
     public void onTrigger(ProcessContext context, ProcessSession session)  {
         WriteStream writeStream;
         Descriptors.Descriptor protoDescriptor;
+
+        FlowFile flowFile = session.get();
+        if (flowFile == null) {
+            return;
+        }
+
+        final TableName tableName = TableName.of(context.getProperty(PROJECT_ID).getValue(), context.getProperty(DATASET).evaluateAttributeExpressions(flowFile).getValue(), context.getProperty(TABLE_NAME).evaluateAttributeExpressions(flowFile).getValue());

Review Comment:
   Done



##########
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/PutBigQuery.java:
##########
@@ -203,20 +201,24 @@ public void onUnscheduled() {
     public void onTrigger(ProcessContext context, ProcessSession session)  {
         WriteStream writeStream;
         Descriptors.Descriptor protoDescriptor;
+
+        FlowFile flowFile = session.get();
+        if (flowFile == null) {
+            return;
+        }
+
+        final TableName tableName = TableName.of(context.getProperty(PROJECT_ID).getValue(), context.getProperty(DATASET).evaluateAttributeExpressions(flowFile).getValue(), context.getProperty(TABLE_NAME).evaluateAttributeExpressions(flowFile).getValue());

Review Comment:
   Done



-- 
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] exceptionfactory closed pull request #7316: NIFI-11608 Fixing Expression Language Evaluation in dataset and tablename.

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory closed pull request #7316: NIFI-11608 Fixing Expression Language Evaluation in dataset and tablename.
URL: https://github.com/apache/nifi/pull/7316


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