edrevo opened a new pull request #26591: [SPARK-29248][SQL] Add 
PhysicalWriteInfo with number of partitions
URL: https://github.com/apache/spark/pull/26591
 
 
   ### What changes were proposed in this pull request?
   When implementing a ScanBuilder, we require the implementor to provide the 
schema of the data and the number of partitions.
   
   However, when someone is implementing WriteBuilder we only pass them the 
schema, but not the number of partitions. This is an asymetrical developer 
experience. 
   
   This PR adds a `PhysicalWriteInfo` interface that is passed to 
`createBatchWriterFactory` and `createStreamingWriterFactory` that adds the 
number of partitions of the data that is going to be written.
   
   ### Why are the changes needed?
   Passing in the number of partitions on the WriteBuilder would enable data 
sources to provision their write targets before starting to write. For example:
   - it could be used to provision a Kafka topic with a specific number of 
partitions
   - it could be used to scale a microservice prior to sending the data to it
   - it could be used to create a DsV2 that sends the data to another spark 
cluster (currently not possible since the reader wouldn't be able to know the 
number of partitions)
   
   
   ### Does this PR introduce any user-facing change?
   No
   
   
   ### How was this patch tested?
   Tests passed

----------------------------------------------------------------
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]

Reply via email to