RE: AvroRuntimeException : Duplicate field name

2016-04-26 Thread Panos Geo
Hello Toivo, all, Thank you very much for your feedback. I have tried this with the following JDBC drivers : mariadb-java-client v1.2.3, v.1.3.2, v.1.3.6, v.1.4.2 (latest) and also with mysql-connector-java-5.1.38-bin and they all exhibit the same behaviour. Essentially, the excepti

Is it possible to call a HIVE table from a ExecuteScript Processor?

2016-04-26 Thread Mike Harding
Hi All, I have a requirement to access a lookup Hive table to translate a code number in a FlowFile to a readable name. I'm just unsure how trivial it is to connect to the db from an ExecuteScript processor? Nifi and the hiveserver2 sit on the same node so I'm wondering if its possible to use Hiv

Re: Is it possible to call a HIVE table from a ExecuteScript Processor?

2016-04-26 Thread Pierre Villard
Hi Mike, I never tried but using the JDBC client you should be able to query your Hive table using ExecuteSQL processor. Hope that helps, Pierre 2016-04-26 13:53 GMT+02:00 Mike Harding : > Hi All, > > I have a requirement to access a lookup Hive table to translate a code > number in a FlowFile

Re: Is it possible to call a HIVE table from a ExecuteScript Processor?

2016-04-26 Thread Matt Burgess
Hive doesn't work with ExecuteSQL as its JDBC driver does not support all the JDBC API calls made by ExecuteSQL / PutSQL. However I am working on a Hive NAR to include ExecuteHiveQL and PutHiveQL processors (https://issues.apache.org/jira/browse/NIFI-981), there is a prototype pull request on GitH

Re: ReplaceText processor configuration help

2016-04-26 Thread McDermott, Chris Kevin (MSDU - STaTS/StorefrontRemote)
Hi Igor, jsonPath will return JSON as an unescaped String. Chris From: Igor Kravzov mailto:igork.ine...@gmail.com>> Reply-To: "users@nifi.apache.org" mailto:users@nifi.apache.org>> Date: Monday, April 25, 2016 at 2:27 PM To: "users@nifi.apache.org

Re: ReplaceText processor configuration help

2016-04-26 Thread Igor Kravzov
I see. But I think I found the problem. It's AttributesToJson escapes the result. On Apr 26, 2016 11:46 AM, "McDermott, Chris Kevin (MSDU - STaTS/StorefrontRemote)" wrote: > Hi Igor, > > jsonPath will return JSON as an unescaped String. > > Chris > > From: Igor Kravzov mailto:igork.ine...@gmail.c

Re: ReplaceText processor configuration help

2016-04-26 Thread Matt Burgess
Yes, I think you'll be better off with Aldrin's suggestion of ReplaceText. Then you can put the value of the attribute(s) directly into the content. For example, if you have two attributes "entities" and "users", and you want a JSON doc with those two objects inside, you can use ReplaceText with t

Re: ReplaceText processor configuration help

2016-04-26 Thread Igor Kravzov
Hi Matt, You described an interesting process. I will think about it. Initially I wanted to grab just some properties, like "entities" and "text", of original JSON and create anew one. ReplaceTexts works fine as long as "text" value does not have quotes inside the text. Once it has quotes and goe

Re: ReplaceText processor configuration help

2016-04-26 Thread Matt Burgess
You can certainly use ExecuteScript with Groovy for JSON-to-JSON conversion, I have a blog post about that here: http://funnifi.blogspot.com/2016/02/executescript-json-to-json-conversion.html I am using UTF-8 in that example but you can use whatever you like, or even let the user choose the value

Re: Nifi + opentsdb

2016-04-26 Thread Madhukar Thota
Thanks Guys for the input. I will start with InvokeHTTP for now, but i would like to write a processor for opentsdb and will contribute back to community. On Tue, Apr 26, 2016 at 1:04 AM, karthi keyan wrote: > Madhu, > > As Joe said, Opentsdb has an Rest support you can use InvokeHTTP or if you

Re: Nifi + opentsdb

2016-04-26 Thread Joe Witt
Thanks Madhukar. We look forward to it and obviously there are plenty of people here that can help if you have questions. On Tue, Apr 26, 2016 at 2:57 PM, Madhukar Thota wrote: > Thanks Guys for the input. I will start with InvokeHTTP for now, but i would > like to write a processor for opentsdb

Re: ReplaceText processor configuration help

2016-04-26 Thread Igor Kravzov
HI Matt, I actually tried "manual transformation" because what resulting JSON fields should be. It works. One problem I have is when "text" filed contains special characters like new line or quotes. These have to be escaped before going into actual JSON. For example line like Who would you vote

Help with replace method

2016-04-26 Thread Igor Kravzov
Attached please find the test template. NiFi 0.6.1 I am trying to replace " with \" in a text. So "Here "we" go" should become \"Here \"we\" go\" The call is in ReplaceText processor: {"test":"${teststr:replace('"','\\"')}"} teststr cerated in UpdateAttribute. >From some reason unable to make i

Re: Help with replace method

2016-04-26 Thread Joe Percivall
Hello Igor, I got your template working by using the below replacement string and changing the "Replacement Strategy" to "Always Replace". I've attached a template that works for me. {"test":"${teststr:replaceAll('"','"')}"} The backslashes are a bit weird because they escape characters a