edrevo commented on a change in pull request #25945: [SPARK-29248][SQL] Pass in
number of partitions to WriteBuilder
URL: https://github.com/apache/spark/pull/25945#discussion_r328979974
##########
File path:
sql/catalyst/src/main/java/org/apache/spark/sql/connector/write/WriteBuilder.java
##########
@@ -55,6 +55,16 @@ default WriteBuilder withInputDataSchema(StructType schema)
{
return this;
}
+ /**
+ * Passes the number of partitions of the input data from Spark to data
source.
+ *
+ * @return a new builder with the `schema`. By default it returns `this`,
which means the given
+ * `numPartitions` is ignored. Please override this method to take
the `numPartitions`.
+ */
+ default WriteBuilder withNumPartitions(int numPartitions) {
Review comment:
I agree with you that the WriteInfo approach has better compile time
guarantees. I actually started implementing the change like that, but then felt
it was maybe too much of a change and that I should focus on the numPartitions.
I'm happy to change it in a followup PR, if that works for everyone.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]