Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-45475][SQL] Uses DataFrame.foreachPartition instead of RDD.foreachPartition in JdbcUtils #43304

Closed
wants to merge 3 commits into from

Conversation

HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Oct 10, 2023

What changes were proposed in this pull request?

This PR is kind of a followup for #39976 that addresses #39976 (comment) comment.

Why are the changes needed?

In order to probably assign the SQL execution ID so df.observe works with this.

Does this PR introduce any user-facing change?

Yes. df.observe will work with JDBC connectors.

How was this patch tested?

Manually tested.

Was this patch authored or co-authored using generative AI tooling?

Unit test was added.

Copy link

@jim0607 jim0607 left a comment

Choose a reason for hiding this comment

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

QQ: is there an E2E test for this change?

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM.

@HyukjinKwon
Copy link
Member Author

QQ: is there an E2E test for this change?

Added a simple test

@HyukjinKwon
Copy link
Member Author

Merged to master and branch-3.5.

HyukjinKwon added a commit that referenced this pull request Oct 10, 2023
…eachPartition in JdbcUtils

This PR is kind of a followup for #39976 that addresses #39976 (comment) comment.

In order to probably assign the SQL execution ID so `df.observe` works with this.

Yes. `df.observe` will work with JDBC connectors.

Manually tested.

Unit test was added.

Closes #43304 from HyukjinKwon/foreachbatch.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit 39cc4ab)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
Copy link
Contributor

@beliefer beliefer left a comment

Choose a reason for hiding this comment

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

LGTM later.

@tgravescs
Copy link
Contributor

@HyukjinKwon did this break the 3.5 build? I'm seeing an error building:

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala:902: type mismatch;
08:23:21   found   : Object
08:23:21   required: Iterator[org.apache.spark.sql.Row]

@HyukjinKwon
Copy link
Member Author

Oops, please feel free to revert directly. I'll make a PR tmr in my time.

@HyukjinKwon
Copy link
Member Author

I reverted it. I will make a PR tmr.

HyukjinKwon added a commit that referenced this pull request Oct 11, 2023
…D.foreachPartition in JdbcUtils

This PR cherry-picks #43304 to branch-3.5

---

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

This PR is kind of a followup for #39976 that addresses #39976 (comment) comment.

### Why are the changes needed?

In order to probably assign the SQL execution ID so `df.observe` works with this.

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

Yes. `df.observe` will work with JDBC connectors.

### How was this patch tested?

Manually tested.

### Was this patch authored or co-authored using generative AI tooling?

Unit test was added.

Closes #43322 from HyukjinKwon/SPARK-45475-3.5.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
@HyukjinKwon HyukjinKwon deleted the foreachbatch branch January 15, 2024 00:51
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.

7 participants