[ 
https://issues.apache.org/jira/browse/SPARK-24882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16584305#comment-16584305
 ] 

Ryan Blue commented on SPARK-24882:
-----------------------------------

{{BatchOverwriteSupport}} should extend {{BatchWriteSupport}}. If you can 
overwrite data, then clearly you can write data without deleting anything.

Spark will call these methods in the physical plan nodes. You can see some of 
the new physical plans for the current write API in the [CTAS/RTAS PR, 
#21877|https://github.com/apache/spark/pull/21877/files#diff-61622e3b262074a520a698d38835e7c2R128].
 To update for this API, the {{doAppend}} method will accept a 
{{BatchWriteSupport}} and a {{WriteConfig}} and will then append using that 
write config and commit. The {{WriteConfig}} would be created in each physical 
plan before calling {{doAppend}}. For the overwrite case, 
{{ReplaceDynamicPartitionsExec}} will require a {{BatchOverwriteSupport}} and 
will call {{newDynamicOverwrite}} instead of {{newWriteConfig}}. The normal 
case, {{AppendDataExec}}, would call {{newWriteConfig}} to create one.

For streaming, a variant of {{newWriteConfig}} should accept options and an 
{{OutputMode}}. [~joseph.torres] probably has some good ideas for adapting this 
plan for streaming, too.

> data source v2 API improvement
> ------------------------------
>
>                 Key: SPARK-24882
>                 URL: https://issues.apache.org/jira/browse/SPARK-24882
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Wenchen Fan
>            Assignee: Wenchen Fan
>            Priority: Major
>
> Data source V2 is out for a while, see the SPIP 
> [here|https://docs.google.com/document/d/1n_vUVbF4KD3gxTmkNEon5qdQ-Z8qU5Frf6WMQZ6jJVM/edit?usp=sharing].
>  We have already migrated most of the built-in streaming data sources to the 
> V2 API, and the file source migration is in progress. During the migration, 
> we found several problems and want to address them before we stabilize the V2 
> API.
> To solve these problems, we need to separate responsibilities in the data 
> source v2 API, isolate the stateull part of the API, think of better naming 
> of some interfaces. Details please see the attached google doc: 
> https://docs.google.com/document/d/1DDXCTCrup4bKWByTalkXWgavcPdvur8a4eEu8x1BzPM/edit?usp=sharing



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to