Skip to content

Conversation

@ulysses-you
Copy link
Contributor

What changes were proposed in this pull request?

This pr moves method withSQLConf from SQLHelper in catalyst test module to SQLConfHelper trait in catalyst module. To make it easy to use such case: val x = withSQLConf {}, this pr also changes its return type.

Why are the changes needed?

A part of #44013

Does this PR introduce any user-facing change?

no

How was this patch tested?

Pass CI

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

no

@github-actions github-actions bot added the SQL label Dec 4, 2023
@ulysses-you
Copy link
Contributor Author

cc @dongjoon-hyun @cloud-fan thank you

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-46227][SQL] Move withSQLConf from SQLHelper trait to SQLConfHelper trait [SPARK-46227][SQL] Move withSQLConf from SQLHelper to SQLConfHelper Dec 4, 2023
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.

Thank you so much, @ulysses-you .

* Sets all SQL configurations specified in `pairs`, calls `f`, and then restores all SQL
* configurations.
*/
protected def withSQLConf[T](pairs: (String, String)*)(f: => T): T = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why change it to type parameter?

Copy link
Contributor

Choose a reason for hiding this comment

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

Then it can return things, looks reasonable

Copy link
Member

Choose a reason for hiding this comment

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

Ya, the PR description descirbed the goal, @beliefer

To make it easy to use such case: val x = withSQLConf {}, this pr also changes its return type.

@dongjoon-hyun
Copy link
Member

Merged to master for Apache Spark 4.

@dongjoon-hyun
Copy link
Member

Thank you, @ulysses-you , @beliefer , @cloud-fan .

@ulysses-you ulysses-you deleted the withSQLConf branch December 4, 2023 05:56
asl3 pushed a commit to asl3/spark that referenced this pull request Dec 5, 2023
…per`

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

This pr moves method `withSQLConf` from `SQLHelper` in catalyst test module to `SQLConfHelper` trait in catalyst module. To make it easy to use such case: `val x = withSQLConf {}`, this pr also changes its return type.

### Why are the changes needed?

A part of apache#44013

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

no

### How was this patch tested?

Pass CI

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

no

Closes apache#44142 from ulysses-you/withSQLConf.

Authored-by: ulysses-you <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
dbatomic pushed a commit to dbatomic/spark that referenced this pull request Dec 11, 2023
…per`

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

This pr moves method `withSQLConf` from `SQLHelper` in catalyst test module to `SQLConfHelper` trait in catalyst module. To make it easy to use such case: `val x = withSQLConf {}`, this pr also changes its return type.

### Why are the changes needed?

A part of apache#44013

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

no

### How was this patch tested?

Pass CI

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

no

Closes apache#44142 from ulysses-you/withSQLConf.

Authored-by: ulysses-you <[email protected]>
Signed-off-by: Dongjoon Hyun <[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