Skip to content

Conversation

@yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented Apr 1, 2020

What changes were proposed in this pull request?

The SaveMode is resolved before we create FileWriteBuilder to build BatchWrite.

In #25876, we removed save mode for DSV2 from DataFrameWriter. So that the mode method is never used which makes validateInputs fail determinately without mode set.

Why are the changes needed?

rm dead code.

Does this PR introduce any user-facing change?

no

How was this patch tested?

existing tests.

@SparkQA
Copy link

SparkQA commented Apr 1, 2020

Test build #120668 has finished for PR 28090 at commit 540bb99.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

private val options = info.options()
private var mode: SaveMode = _

def mode(mode: SaveMode): WriteBuilder = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yaooqinn . Technically, removal of dead code is not a bug fix. Please re-category this as an Improvement.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks


val fs = path.getFileSystem(hadoopConf)
mode match {
case SaveMode.ErrorIfExists if fs.exists(path) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give me the pointer where handles this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g.

case (SaveMode.Append, Some(table)) =>

@dongjoon-hyun
Copy link
Member

cc @cloud-fan

@cloud-fan
Copy link
Contributor

I'm OK to remove dead code, this was probably leftover when we remove SaveMode from the v2 API. Can we make the PR description clearer?

@yaooqinn
Copy link
Member Author

yaooqinn commented Apr 2, 2020

I'm OK to remove dead code, this was probably leftover when we remove SaveMode from the v2 API. Can we make the PR description clearer?

thanks, referenced the related PR #25876 and updated the PR description

@cloud-fan
Copy link
Contributor

thanks, merging to master/3.0!

@cloud-fan cloud-fan closed this in 1ce584f Apr 2, 2020
cloud-fan pushed a commit that referenced this pull request Apr 2, 2020
### What changes were proposed in this pull request?

The `SaveMode` is resolved before we create `FileWriteBuilder` to build `BatchWrite`.

In #25876, we removed save mode for DSV2 from DataFrameWriter. So that the `mode` method is never used which makes `validateInputs` fail determinately without `mode` set.

### Why are the changes needed?
rm dead code.

### Does this PR introduce any user-facing change?

no

### How was this patch tested?

existing tests.

Closes #28090 from yaooqinn/SPARK-31321.

Authored-by: Kent Yao <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 1ce584f)
Signed-off-by: Wenchen Fan <[email protected]>
@dongjoon-hyun
Copy link
Member

Thank you, @cloud-fan and @yaooqinn .

sjincho pushed a commit to sjincho/spark that referenced this pull request Apr 15, 2020
### What changes were proposed in this pull request?

The `SaveMode` is resolved before we create `FileWriteBuilder` to build `BatchWrite`.

In apache#25876, we removed save mode for DSV2 from DataFrameWriter. So that the `mode` method is never used which makes `validateInputs` fail determinately without `mode` set.

### Why are the changes needed?
rm dead code.

### Does this PR introduce any user-facing change?

no

### How was this patch tested?

existing tests.

Closes apache#28090 from yaooqinn/SPARK-31321.

Authored-by: Kent Yao <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants