You can use the FileName port in a 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 that uses the FileName port in the native environment or on the Spark and Databricks Spark engines to read or write a complex file, the Data Integration Service creates separate directories for each value in the FileName port and adds the files within the directories.