Skip to main content

GenerateRecord

Description

This processor creates FlowFiles with records having random value for the specified fields. GenerateRecord is useful for testing, configuration, and simulation. It uses either user-defined properties to define a record schema or a provided schema and generates the specified number of records using random data for the fields in the schema.

Tags

fake, generate, random, test

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Record Writer *record-writerController Service:
RecordSetWriterFactory

Implementations:
AvroRecordSetWriter
CSVRecordSetWriter
FreeFormTextRecordSetWriter
JsonRecordSetWriter
RecordSetWriterLookup
ScriptedRecordSetWriter
XMLRecordSetWriter
Specifies the Controller Service to use for writing out the records
Number of Records *number-of-records100Specifies how many records will be generated for each outgoing FlowFile.

Supports Expression Language, using Environment variables.
Nullable Fields *nullable-fieldstrue
  • true
  • false
Whether the generated fields will be nullable. Note that this property is ignored if Schema Text is set. Also it only affects the schema of the generated data, not whether any values will be null. If this property is true, see 'Null Value Percentage' to set the probability that any generated field will be null.
Null Value Percentage *null-percentage0The percent probability (0-100%) that a generated value for any nullable field will be null. Set this property to zero to have no null values, or 100 to have all null values.

Supports Expression Language, using Environment variables.

This property is only considered if:
  • the property Nullable Fields has a value of true
Schema Textschema-textThe text of an Avro-formatted Schema used to generate record data. If this property is set, any user-defined properties are ignored.

Supports Expression Language, using Environment variables.

Dynamic Properties

NameValueDescription
Field name in generated recordFaker category for generated record valuesCustom properties define the generated record schema using configured field names and value data types in absence of the Schema Text property

Supports Expression Language: No

Relationships

NameDescription
successFlowFiles that are successfully created will be routed to this relationship

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
mime.typeSets the mime.type attribute to the MIME Type specified by the Record Writer
record.countThe number of records in the FlowFile

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component does not allow an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also