Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Coalesce doesn't currently perform as documented since all of the transformation operations happen after it so you never actually get the proper number of output partitions.
I added a repartition at the top of the job to remap the data to more or less partitions (this helps with increasing parallelism) and moved coalesce to the end to create the proper number of outputs (can it go after the sort?, not sure the expectations on output are after the sort)
Also, moved both parameters to SparkArgs as they are likely to be needed in other operations (i.e. reads2ref) There may be better defaults too, but since they both add some overhead they are off by default