Re: String conversion to Int, float double

2016-03-30 Thread Madhukar Thota
ks > > > > On Tue, Mar 29, 2016 at 2:30 AM, Conrad Crampton > > wrote: > >> > >> Hi, > >> Depending on the final destination of the data (json) you could use the > >> JsonToAvro -> ConvertAvroSchema -> AvroToJson, with the > ConvertAvroSch

Re: String conversion to Int, float double

2016-03-30 Thread Joe Witt
on) you could use the >> JsonToAvro -> ConvertAvroSchema -> AvroToJson, with the ConvertAvroSchema >> doing the type conversion. I had to do this as I came across this behaviour >> previously. I use the Avro directly (after the conversion) as that was my >> final data format

Re: String conversion to Int, float double

2016-03-30 Thread Madhukar Thota
our > previously. I use the Avro directly (after the conversion) as that was my > final data format requirement, but I don’t see any reason if you want Json > back that this wouldn’t work. I haven’t tried this by the way, but the type > conversion certainly works for the final attri

Re: String conversion to Int, float double

2016-03-28 Thread Conrad Crampton
il.com>> Reply-To: "users@nifi.apache.org<mailto:users@nifi.apache.org>" mailto:users@nifi.apache.org>> Date: Friday, 25 March 2016 at 14:01 To: "users@nifi.apache.org<mailto:users@nifi.apache.org>" mailto:users@nifi.apache.org>> Subject: Re: String co

Re: String conversion to Int, float double

2016-03-28 Thread Matt Burgess
Sounds good to me. I presume the processor would still put all attributes in the JSON content, but would use any dynamic properties solely for type coercion? Anything not listed would be treated like a String as it is now (to preserve current behavior). We'd need to document the possible values

Re: String conversion to Int, float double

2016-03-28 Thread Joe Witt
Madhu No i do not believe that it does. I am proposing we make this change so that you can handle this case. Just looking for feedback on whether people like that approach or have a better method. Thanks Joe On Mon, Mar 28, 2016 at 11:36 AM, Madhukar Thota wrote: > Hi Joe, > > is this dynamic

Re: String conversion to Int, float double

2016-03-28 Thread Madhukar Thota
Hi Joe, is this dynamic Property works today with AttributesToJSON today? property name: rt_firstbyte property value: Integer -Madhu On Sat, Mar 26, 2016 at 1:13 PM, Joe Witt wrote: > What Madhukar is trying to do seems totally reasonable. As an > alternative to Bryan's proposal what do y

Re: String conversion to Int, float double

2016-03-26 Thread Joe Witt
What Madhukar is trying to do seems totally reasonable. As an alternative to Bryan's proposal what do you all think about updating the behavior of AttributesToJSON to allow the user to suggest the type information they would like for a given attribute? It's default behavior is as is which is it w

Re: String conversion to Int, float double

2016-03-25 Thread Bryan Bende
Depending how many attributes you are dealing with, a possible work around could be to construct the JSON with a ReplaceText text processor. If you have ReplaceText after your UpdateAttribute, you could set the Replacement Value to a String like: { "rt_firstbyte" : ${http.param.t_resp}, "rt_last

Re: String conversion to Int, float double

2016-03-25 Thread Joe Witt
Ok and can you share the config settings you have in Attributes to JSON at this time? We do need to make changes for this probably but want to understand what will be a good path forward. On Fri, Mar 25, 2016 at 9:49 AM, Madhukar Thota wrote: > Hi Joe, > > In my UpdateAtrribute, i am converting

Re: String conversion to Int, float double

2016-03-25 Thread Madhukar Thota
Hi Joe, In my UpdateAtrribute, i am converting the string values to Number like this: rt_firstbyte ${http.param.t_resp:toNumber()} rt_lastbyte ${http.param.t_page:toNumber()} rt_loadtime ${http.param.t_done:toNumber()} when i pass this attribute to AttributeToJson processor, the type should b

Re: String conversion to Int, float double

2016-03-25 Thread Joe Witt
Chase, To unsubscribe send an e-mail here users-unsubscr...@nifi.apache.org Madhukar, As Bryan mentioned attributes are always serialized as Strings. Their type is really a function of when they are being evaluated/used. Can you describe a bit more about what you'd like AttributesToJson to do

Re: String conversion to Int, float double

2016-03-25 Thread Chase Cunningham
unsubscribe On 3/25/16 9:01 AM, Madhukar Thota wrote: Any Other ways to achieve this? On Thu, Mar 24, 2016 at 4:48 PM, Bryan Bende > wrote: I think the problem is that all attributes are actually Strings internally, even after calling toNumber() that is only t

Re: String conversion to Int, float double

2016-03-25 Thread Madhukar Thota
Any Other ways to achieve this? On Thu, Mar 24, 2016 at 4:48 PM, Bryan Bende wrote: > I think the problem is that all attributes are actually Strings > internally, even after calling toNumber() that is only temporary while the > expression language is executing. > > So by the time it gets to Att

Re: String conversion to Int, float double

2016-03-24 Thread Bryan Bende
I think the problem is that all attributes are actually Strings internally, even after calling toNumber() that is only temporary while the expression language is executing. So by the time it gets to AttributesToJson it doesn't have any information about the type of each attribute and they all end

String conversion to Int, float double

2016-03-24 Thread Madhukar Thota
Hi i am trying to convert string value to integer in UpdateAtrributes using toNumber like this ${http.param.t_resp:toNumber()} where http.param.t_resp = "132" but when the fileattribute pushed to Attributetojson processor , i am stilling seeing it as string. Am i am doing something wrong? and a