You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Stéphane Maarek <st...@gmail.com> on 2016/05/23 23:53:02 UTC

ReplaceText Infinite loop?

Hi

I'm extracting text from the following sentence using a regex:

dummy$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A

The placing the content into a json (using replacetext).

I think ReplaceText is in an infinite loop due to the $ sign in my first field.
How should I handle these cases? Isn't NiFi supposed to escape any
character in an attribute?

Thanks!


[image: pasted1]

[image: pasted2]

Stephane

Re: ReplaceText Infinite loop?

Posted by Stéphane Maarek <st...@gmail.com>.
Opened here: https://issues.apache.org/jira/browse/NIFI-1915

On Tue, May 24, 2016 at 11:11 AM Oleg Zhurakousky <
ozhurakousky@hortonworks.com> wrote:

> Stephane
>
> This definitely needs to be looked at. Would you mind raising JIRA for it?
>
> Thanks
> Oleg
>
> On May 23, 2016, at 20:08, Stéphane Maarek <st...@gmail.com>
> wrote:
>
> An easy way to reproduce is to take the csv to json template here:
>
> https://cwiki.apache.org/confluence/download/attachments/57904847/CsvToJSON.xml?version=1&modificationDate=1442927496000&api=v2
>
>
> In the first ReplaceText, replace a,b,c,d by a$a,b,c,d (it simulates data
> that may or may not contain a $ sign)
> Launch the flow, you'll see the errors / warning / infinite loop
>
>
>
> On Tue, May 24, 2016 at 9:53 AM Stéphane Maarek <st...@gmail.com>
> wrote:
>
> Hi
>>
>> I'm extracting text from the following sentence using a regex:
>>
>> dummy$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A
>>
>> The placing the content into a json (using replacetext).
>>
>> I think ReplaceText is in an infinite loop due to the $ sign in my first field.
>> How should I handle these cases? Isn't NiFi supposed to escape any character in an attribute?
>>
>> Thanks!
>>
>>
>> <pasted1>
>>
>> <pasted2>
>>
>> Stephane
>>
>

Re: ReplaceText Infinite loop?

Posted by Oleg Zhurakousky <oz...@hortonworks.com>.
Stephane

This definitely needs to be looked at. Would you mind raising JIRA for it?

Thanks
Oleg

On May 23, 2016, at 20:08, St?phane Maarek <st...@gmail.com>> wrote:

An easy way to reproduce is to take the csv to json template here:
https://cwiki.apache.org/confluence/download/attachments/57904847/CsvToJSON.xml?version=1&modificationDate=1442927496000&api=v2

In the first ReplaceText, replace a,b,c,d by a$a,b,c,d (it simulates data that may or may not contain a $ sign)
Launch the flow, you'll see the errors / warning / infinite loop



On Tue, May 24, 2016 at 9:53 AM St?phane Maarek <st...@gmail.com>> wrote:
Hi

I'm extracting text from the following sentence using a regex:

dummy$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A

The placing the content into a json (using replacetext).

I think ReplaceText is in an infinite loop due to the $ sign in my first field.
How should I handle these cases? Isn't NiFi supposed to escape any character in an attribute?

Thanks!

<pasted1>

<pasted2>

Stephane

Re: ReplaceText Infinite loop?

Posted by Stéphane Maarek <st...@gmail.com>.
An easy way to reproduce is to take the csv to json template here:
https://cwiki.apache.org/confluence/download/attachments/57904847/CsvToJSON.xml?version=1&modificationDate=1442927496000&api=v2


In the first ReplaceText, replace a,b,c,d by a$a,b,c,d (it simulates data
that may or may not contain a $ sign)
Launch the flow, you'll see the errors / warning / infinite loop



On Tue, May 24, 2016 at 9:53 AM Stéphane Maarek <st...@gmail.com>
wrote:

> Hi
>
> I'm extracting text from the following sentence using a regex:
>
> dummy$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A
>
> The placing the content into a json (using replacetext).
>
> I think ReplaceText is in an infinite loop due to the $ sign in my first field.
> How should I handle these cases? Isn't NiFi supposed to escape any character in an attribute?
>
> Thanks!
>
>
> [image: pasted1]
>
> [image: pasted2]
>
> Stephane
>