Using the batch state backend requires that the inputs are sorted by a key. Right now when sorting, we sort either all of the inputs or none. It is because we expect that the same key is consumed from all inputs at the same time.
In the process of implementing
FLINK-20491 we can also add support for mixed non-keyed/keyed operators.