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

Nikolay Izhikov edited comment on IGNITE-7655 at 2/26/18 6:01 AM:
------------------------------------------------------------------

[~dmagda]

> What does appending mean here? As far as I understand, you're just going to 
> insert new data ignoring the data which keys are already in the table.

Appends mean we will not execute {{DROP TABLE}}/{{CREATE TABLE}}.
Since all inserts are executed through IgniteDataStreamer behaviour will be 
like this:

* {{OPTION_STREAMER_ALLOW_OVERWRITE=false}} - existing keys will be ignored.
* {{OPTION_STREAMER_ALLOW_OVERWRITE=true}} - existing key/value will 
overwritten with DataFrame data.

> which mode is a default? 

ErrorIfExsists

> Is there a mode that updates existing rows, inserts new from the data frame 
> and does NOT delete the rows that were in the table initially?

{{SaveMode.Append}} + {{OPTION_STREAMER_ALLOW_OVERWRITE=true}}

> How do I set a mode? You start talking about the data frames right away but 
> do not explain how to use them.

One can use {{dataFrame.write.mode(SaveMode.Append)}}.  It's a part of Spark 
API. 
OK, I will add an example to the page.

> I would start "Saving Data Frame" section with the explanation of how all 
> this works

OK. Will do.


was (Author: nizhikov):
[~dmagda]

> What does appending mean here? As far as I understand, you're just going to 
> insert new data ignoring the data which keys are already in the table.

Appends mean we will not execute `DROP TABLE`/`CREATE TABLE`.
Since all inserts are executed through IgniteDataStreamer behaviour will be 
like this:

* `OPTION_STREAMER_ALLOW_OVERWRITE=false` - existing keys will be ignored.
* `OPTION_STREAMER_ALLOW_OVERWRITE=true` - existing key/value will overwritten 
with DataFrame data.

> which mode is a default? 

ErrorIfExsists

> Is there a mode that updates existing rows, inserts new from the data frame 
> and does NOT delete the rows that were in the table initially?

`SaveMode.Append` + `OPTION_STREAMER_ALLOW_OVERWRITE=true`

> How do I set a mode? You start talking about the data frames right away but 
> do not explain how to use them.

One can use `dataFrame.write.mode(SaveMode.Append)`. It's a part of Spark API. 
OK, I will add an example to the page.

> I would start "Saving Data Frame" section with the explanation of how all 
> this works

OK. Will do.

> Spark Data Frames: saving data frames into Ignite needs to be documented
> ------------------------------------------------------------------------
>
>                 Key: IGNITE-7655
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7655
>             Project: Ignite
>          Issue Type: Bug
>          Components: documentation, spark
>            Reporter: Nikolay Izhikov
>            Assignee: Nikolay Izhikov
>            Priority: Major
>             Fix For: 2.4
>
>
> Once IGNITE-7337 is ready for merge.
> This new feature of Ignite needs to be documented.



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

Reply via email to