Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

This is a followup of #39277 . With planned write, the write command requires neither columnar nor row-based execution. It invokes a new API executeWrite, which returns commit messages, not columnar or row-based data.

This PR updates ApplyColumnarRulesAndInsertTransitions to take this case into consideration.

Why are the changes needed?

If people replaces WriteFilesExec with a columnar version, the plan can't be executed due to an extra columnar to row transition between WriteFilesExee and the write command.

Does this PR introduce any user-facing change?

No

How was this patch tested?

new test

@github-actions github-actions bot added the SQL label Feb 7, 2023
assert(result(2).getLong(0) == 301L)

withTempPath { path =>
val e = intercept[Exception](df.write.parquet(path.getCanonicalPath))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

without the fix, it fails with class org.apache.spark.sql.execution.WholeStageCodegenExec has write support mismatch

Copy link
Member

Choose a reason for hiding this comment

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

Can we catch more specific exception though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Got it. Since it's a test suite and this test case matches the exception message exactly, looks fine.

@cloud-fan
Copy link
Contributor Author

cc @ulysses-you @allisonwang-db

@ulysses-you
Copy link
Contributor

lgtm

@cloud-fan
Copy link
Contributor Author

thanks for the review, merging to master/3.4!

@cloud-fan cloud-fan closed this in 56dd20f Feb 7, 2023
cloud-fan added a commit that referenced this pull request Feb 7, 2023
… before write command

### What changes were proposed in this pull request?

This is a followup of #39277 . With planned write, the write command requires neither columnar nor row-based execution. It invokes a new API `executeWrite`, which returns commit messages, not columnar or row-based data.

This PR updates `ApplyColumnarRulesAndInsertTransitions` to take this case into consideration.

### Why are the changes needed?

If people replaces `WriteFilesExec` with a columnar version, the plan can't be executed due to an extra columnar to row transition between `WriteFilesExee` and the write command.

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

No

### How was this patch tested?

new test

Closes #39922 from cloud-fan/write.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 56dd20f)
Signed-off-by: Wenchen Fan <[email protected]>
snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Jun 20, 2023
… before write command

### What changes were proposed in this pull request?

This is a followup of apache#39277 . With planned write, the write command requires neither columnar nor row-based execution. It invokes a new API `executeWrite`, which returns commit messages, not columnar or row-based data.

This PR updates `ApplyColumnarRulesAndInsertTransitions` to take this case into consideration.

### Why are the changes needed?

If people replaces `WriteFilesExec` with a columnar version, the plan can't be executed due to an extra columnar to row transition between `WriteFilesExee` and the write command.

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

No

### How was this patch tested?

new test

Closes apache#39922 from cloud-fan/write.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 56dd20f)
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