fengruotj opened a new pull request, #11413:
URL: https://github.com/apache/paimon/pull/11413
### Purpose
Closes #11412. Related to #4742.
Add `sink.parallelism` to Spark's V1 and V2 write paths for tables in
`HASH_FIXED` bucket mode. A positive value sets the number of Spark partitions
in the final shuffle by table partition and bucket. This lets users tune the
number of write tasks independently
of the table's bucket count and other shuffles in the query. When the
option is unset, zero, or negative, Spark continues to choose the write
parallelism.
For example, the following table uses 16 buckets and requests 7 write
tasks:
```sql
CREATE TABLE events (id INT) USING paimon
TBLPROPERTIES (
'primary-key' = 'id',
'bucket' = '16',
'sink.parallelism' = '7'
);
```
Users can also set a session default with `SET
spark.paimon.sink.parallelism=7`.
### Tests
- Extended `V2WriteRequireDistributionTest` to check the actual
write-stage task count with AQE enabled for both V1 and V2. Coverage includes
explicit and default parallelism, a custom bucket function, and bucket-unaware
tables retaining their input partitions.
- Ran the suite locally on Spark 3.2.4, 3.3.4, and 3.4.4, with 43 tests
passing on each version. On Spark 3.5.9, 35 passed and 8 version-specific tests
were skipped.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]