You can use the FileName port in a complex file target to dynamically redirect the rows based on the value received by FileName port.
When you run a mapping in the native environment to read or write a flat file using the FileName port, the Data Integration Service creates separate directories for each value in the FileName port in the following format:
When you run a mapping in the native environment or on the Spark engine to read or write an Avro, JSON, ORC, Parquet or Binary(Native) file using the FileName port, the Data Integration Service creates separate directories for each value in the FileName port and adds the files within the directories.