Github user viirya commented on the issue:
https://github.com/apache/spark/pull/16724
@cloud-fan OK. I see. If we don't want to add implicit penalty into the
existing API, the only way I can think now, is a config to preserve the sort
order. This config can be in `SQLConf`, or we can just have an option for it in
`DataFrameWriter` like `maxRecordsPerFile`.
E.g.,
val df = spark.range(100)
.select($"id", explode(array(col("id") + 1, col("id") + 2, col("id")
+ 3)).as("value"))
.repartition($"id")
.sortWithinPartitions($"value".desc).toDF()
df.write
.option("perserveSortOrder", true) // default is false
.partitionBy("id")
.parquet(tempDir)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]