[ 
https://issues.apache.org/jira/browse/NIFI-15457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Balázs Gerner updated NIFI-15457:
---------------------------------
    Description: 
org.apache.nifi.processors.aws.ml.AbstractAwsMachineLearningJobStatusProcessor#TASK_ID
 property was renamed in scope of 
[https://github.infra.cloudera.com/DIM/nifi/commit/a5f143da5e236e788eeb099ce389641ebd2740da]
 

There is a mismatch however with the new output flowfile attribute name and 
what property name the {color:#000000}GetAwsPollyJobStatus{color} processor 
expects by default:
1. StartAwsPollyJob writes a new attribute called '{*}AWS Task ID{*}'
[https://github.infra.cloudera.com/DIM/nifi/blob/a5f143da5e236e788eeb099ce389641ebd2740da/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/ml/AbstractAwsMachineLearningJobStarter.java#L140]

2. {color:#000000}GetAwsPollyJobStatus reads and evaluates the property value 
of TASK_ID, by default it is *${awsTaskId}*
[https://github.infra.cloudera.com/DIM/nifi/blob/a5f143da5e236e788eeb099ce389641ebd2740da/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/ml/AbstractAwsMachineLearningJobStatusProcessor.java#L52]
 

*Proposed solution:*
Let the output attribute name in the jobstarter remain 'awsTaskId' so that the 
two processors can be compatible:{color}
{color:#000000}FlowFile processedFlowFile {color}= 
{color:#000000}session{color}.putAttribute({color:#000000}flowFile{color}, 
{color:#871094}"awsTaskId"{color}, {color:#000000}awsTaskId{color});

{*}{color:#000000}Important:{color}{*}{color:#000000}This issue is affecting 
all other AWS ML processors as well: Textract, Transcribe, Translate, 
Polly{color}

{color:#000000}*Workaround:* I managed to put an UpdateAttribute processor 
between the {color}{color:#000000}StartAwsPollyJob {color}{color:#000000}and 
the {color}{color:#000000}GetAwsPollyJobStatus, that updates:
{color}
{color:#067d17}"awsTaskId"{color}, to -> 
{color:#067d17}"${{color}{color:#0037a6}"{color}{color:#067d17}AWS Task 
ID{color}{color:#0037a6}"{color}{color:#067d17}}" {color:#172b4d}in order to 
make the getter processor work without any change.{color}{color}
{color:#000000} {color}

  was:
org.apache.nifi.processors.aws.ml.AbstractAwsMachineLearningJobStatusProcessor#TASK_ID
 property was renamed in scope of 
[https://github.infra.cloudera.com/DIM/nifi/commit/a5f143da5e236e788eeb099ce389641ebd2740da]
 

There is a mismatch however with the new output flowfile attribute name and 
what property name the {color:#000000}GetAwsPollyJobStatus{color} processor 
expects by default:
1. StartAwsPollyJob writes a new attribute called '{*}AWS Task ID{*}'
[https://github.infra.cloudera.com/DIM/nifi/blob/a5f143da5e236e788eeb099ce389641ebd2740da/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/ml/AbstractAwsMachineLearningJobStarter.java#L140]

2. {color:#000000}GetAwsPollyJobStatus reads and evaluates the property value 
of TASK_ID, by default it is *${awsTaskId}*
[https://github.infra.cloudera.com/DIM/nifi/blob/a5f143da5e236e788eeb099ce389641ebd2740da/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/ml/AbstractAwsMachineLearningJobStatusProcessor.java#L52]
 

*Proposed solution:*
Let the output attribute name in the jobstarter remain 'awsTaskId' so that the 
two processors can be compatible:{color}
{color:#000000}FlowFile processedFlowFile {color}= 
{color:#000000}session{color}.putAttribute({color:#000000}flowFile{color}, 
{color:#871094}"awsTaskId"{color}, {color:#000000}awsTaskId{color});

{*}{color:#000000}Important:{color}{*}{color:#000000}This issue is affecting 
all other AWS ML processors as well: Textract, Transcribe, Translate, 
Polly{color}


> Fix output attribute name of awsTaskId in AbstractAwsMachineLearningJobStarter
> ------------------------------------------------------------------------------
>
>                 Key: NIFI-15457
>                 URL: https://issues.apache.org/jira/browse/NIFI-15457
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 2.6.0, 2.7.0, 2.7.1, 2.7.2
>            Reporter: Balázs Gerner
>            Assignee: Balázs Gerner
>            Priority: Major
>
> org.apache.nifi.processors.aws.ml.AbstractAwsMachineLearningJobStatusProcessor#TASK_ID
>  property was renamed in scope of 
> [https://github.infra.cloudera.com/DIM/nifi/commit/a5f143da5e236e788eeb099ce389641ebd2740da]
>  
> There is a mismatch however with the new output flowfile attribute name and 
> what property name the {color:#000000}GetAwsPollyJobStatus{color} processor 
> expects by default:
> 1. StartAwsPollyJob writes a new attribute called '{*}AWS Task ID{*}'
> [https://github.infra.cloudera.com/DIM/nifi/blob/a5f143da5e236e788eeb099ce389641ebd2740da/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/ml/AbstractAwsMachineLearningJobStarter.java#L140]
> 2. {color:#000000}GetAwsPollyJobStatus reads and evaluates the property value 
> of TASK_ID, by default it is *${awsTaskId}*
> [https://github.infra.cloudera.com/DIM/nifi/blob/a5f143da5e236e788eeb099ce389641ebd2740da/nifi-extension-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/ml/AbstractAwsMachineLearningJobStatusProcessor.java#L52]
>  
> *Proposed solution:*
> Let the output attribute name in the jobstarter remain 'awsTaskId' so that 
> the two processors can be compatible:{color}
> {color:#000000}FlowFile processedFlowFile {color}= 
> {color:#000000}session{color}.putAttribute({color:#000000}flowFile{color}, 
> {color:#871094}"awsTaskId"{color}, {color:#000000}awsTaskId{color});
> {*}{color:#000000}Important:{color}{*}{color:#000000}This issue is affecting 
> all other AWS ML processors as well: Textract, Transcribe, Translate, 
> Polly{color}
> {color:#000000}*Workaround:* I managed to put an UpdateAttribute processor 
> between the {color}{color:#000000}StartAwsPollyJob {color}{color:#000000}and 
> the {color}{color:#000000}GetAwsPollyJobStatus, that updates:
> {color}
> {color:#067d17}"awsTaskId"{color}, to -> 
> {color:#067d17}"${{color}{color:#0037a6}"{color}{color:#067d17}AWS Task 
> ID{color}{color:#0037a6}"{color}{color:#067d17}}" {color:#172b4d}in order to 
> make the getter processor work without any change.{color}{color}
> {color:#000000} {color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to