Integration / Apache NiFi Interview Questions
What is the SplitText processor and how do you control split behavior?
SplitText is a NiFi processor that splits a FlowFile containing multiple lines of text into multiple smaller FlowFiles, each containing a configurable number of lines. It is the workhorse for splitting large text, CSV, or log files into processable chunks before parallel processing.
Key configuration properties:
Line Split Count: The number of lines per output FlowFile. Set to 1 for one FlowFile per line; set to 1000 for batches of 1000 lines. A value of 0 means no line-count limit (used with Maximum Fragment Size).
Maximum Fragment Size: Optional maximum byte size per output FlowFile. When the current fragment reaches this size during splitting, a new fragment begins. Useful when downstream systems have size limits.
Header Line Count: Number of header lines to include in every output FlowFile (e.g., 1 for a CSV header row). The header is prepended to every fragment so each fragment is independently parseable as a complete CSV file.
Header Marker: A regex pattern identifying header lines embedded in the file.
SplitText sets these attributes on each output FlowFile: fragment.identifier (UUID shared by all fragments from the same original), fragment.index (1-based fragment number), and fragment.count (total number of fragments). These attributes enable MergeContent to reassemble fragments in the correct order.
More Related questions...