Member since
11-16-2015
905
Posts
665
Kudos Received
249
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 427 | 09-30-2025 05:23 AM | |
| 764 | 06-26-2025 01:21 PM | |
| 657 | 06-19-2025 02:48 PM | |
| 847 | 05-30-2025 01:53 PM | |
| 11379 | 02-22-2024 12:38 PM |
11-11-2016
04:58 PM
1 Kudo
What do the resulting HiveQL statement (and attributes) look like? Are you using parameters (with attributes like hiveql.args.N.value and such)? If so, then it appears from looking at the code that it expects a long integer (probably days or seconds from Epoch depending on the data type) for the value, and the appropriate JDBC type value for DATE, TIME, or TIMESTAMP. If parameterized statements don't work, perhaps a ReplaceText to build an explicit HiveQL statement will (such as to remove quotes from attributes which are strings, or to cast a literal to the appropriate date type, etc.)
... View more
11-10-2016
05:44 PM
1 Kudo
You can use ExecuteScript with Groovy and the following script (assuming your input is newline-delimited):
def flowFile = session.get()
if(!flowFile) return
def header = ''
session.read(flowFile, { inStream ->
header = new BufferedReader(new InputStreamReader(inStream)).readLine()
} as InputStreamCallback)
flowFile = session.putAttribute(flowFile, 'header', header)
session.transfer(flowFile, REL_SUCCESS)
This puts the first line in an attribute called 'header', which you can use with RouteOnAttribute to decide where to send the flow. Note that this script doesn't do error handling, but you could put a try/catch around the session.read to session.transfer, the catch could route the flow file to REL_FAILURE.
... View more
11-08-2016
08:26 PM
Can you share a stack trace / error log from logs/nifi-app.log? I'm curious to see what part of the code gives a "File too large" error.
... View more
11-08-2016
08:11 PM
1 Kudo
Avro doesn't like the dots in the attribute names (which become field names), perhaps you could rename them (with UpdateAttribute or at the source processor(s)) using underscores (or other valid characters like alphanumeric characters, see the link for the rules).
... View more
11-08-2016
07:51 PM
1 Kudo
I don't believe it is currently possible to convert/use the decimal type in the Avro processors, I have written up NIFI-3000 to cover this improvement. If you are comfortable with a scripting language like Javascript or Groovy, you could use the ExecuteScript processor, point the Module Directory property at JAR(s) for Avro 1.8.0, and code the conversion yourself. However beware that you don't do additional Avro processing downstream, as that will likely break (because of the bug in NIFI-3000).
... View more
11-08-2016
04:20 PM
I have written up an improvement Jira to add better validation for the Avro Record Name property.
... View more
11-08-2016
04:13 PM
What do your search and replace regular expressions look like? You might be matching the whole text looking for the delimiter and replacing with the delimiter, when really it sounds like you want to match the delimiter and replace with something else (a comma, e.g.)
... View more
11-08-2016
02:58 PM
1 Kudo
Does the term "avro-schema" (from your error message) appear in the schema? If so, then the error is because it doesn't like the dash, you can only use upper- and lower-case letters and underscores for the first character, then that set plus digits for all remaining characters (see Naming section of Avro doc). Try replacing the dash with an underscore and it should work.
... View more
11-06-2016
03:15 PM
3 Kudos
The code for ScanContent looks like it watches the specified file for changes; otherwise it shouldn't refresh the dictionary file (unless something weird happens with the internal search mechanism). Alternatively, I answered a Stack Overflow question with a similar use case, using ExecuteScript to check the JSON (and in their case, replace the value from an external file). That example also reads the file every time, but you could use a similar approach with InvokeScriptedProcessor to read the file in the initialize() method, then it will not be re-read during onTrigger (which is called when the processor is scheduled).
... View more
11-03-2016
06:25 PM
You could try Presto, that should let you hook up to multiple DBs. Then you can set up a DBCPConnectionPool in NiFi to connect to Presto and issue the query from there. Also perhaps Apache Calcite has this functionality but I'm not sure.
... View more