Using DynamicPartitioner with a PartitionedFileSet (PFS) that is using AvroKeyOutputFormat or AvroKeyValueOutputFormat will place the output records in a file in the root directory of the PFS's base location, instead of file paths based upon any partitioning.
In the implementation of DynamicPartitioner, the partition path is set to the OutputFormat by using the FileOutputFormat#setOutputName method, which sets it to the configuration with key 'mapreduce.output.basename.
However, AvroOutputFormatBase does not respect that parameter when creating its output path, but instead, it uses its own key for this purpose - "avro.mo.config.namedOutput", and so the path based upon the partitioning is lost.
For this same reason, there's also this issue in AVRO JIRA (baseOutputPath not respected/used) - https://issues.apache.org/jira/browse/AVRO-1215.
The resolution there was to use the key "avro.mo.config.namedOutput", in the code that sets the configuration, instead of modifying the AvroOutputFormatBase class to use the same parameter as FileOutputFormat.
The majority of other OutputFormats that extend FileOutputFormat respect and use the "mapreduce.output.basename" parameter, and so AvroOutputFormatBase is distinguishable in that sense.
For instance, other subclasses of FileOutputFormat that utilize the parameter "mapreduce.output.basename":
TextOutputFormat, ParquetOutputFormat, SequenceFileOutputFormat, MapFileOutputFormat, OrcNewOutputFormat, AvroSequenceFileOutputFormat.