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-46055][SQL][FOLLOWUP] Respect code style for scala. #44079

Closed
wants to merge 1 commit into from

Conversation

beliefer
Copy link
Contributor

@beliefer beliefer commented Nov 29, 2023

What changes were proposed in this pull request?

#43959 get metadata when resolving catalogs instead of directly calling catalog.

This PR fix one minor issues that some code didn't follow the code style of scala.

Why are the changes needed?

Respect code style for scala.

Does this PR introduce any user-facing change?

'No'.

How was this patch tested?

Exists test cases.

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

'No'.

@github-actions github-actions bot added the SQL label Nov 29, 2023
@beliefer beliefer changed the title [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [SPARK-46055][SQL][FOLLOWUP][MINOR] Respect code style for scala and reduce the stack depth. Nov 29, 2023
@LuciferYang LuciferYang changed the title [SPARK-46055][SQL][FOLLOWUP][MINOR] Respect code style for scala and reduce the stack depth. [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. Nov 29, 2023
@beliefer
Copy link
Contributor Author

ping @heyihong cc @cloud-fan

Copy link
Contributor

@heyihong heyihong left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -503,7 +503,7 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
*/
override def databaseExists(dbName: String): Boolean = {
try {
getDatabase(dbName)
makeDatabase(None, dbName: String)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we make it more verbose here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reduce the stack depth.

Copy link
Contributor

Choose a reason for hiding this comment

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

the readability will become worse ... I like it the way it was originally

@beliefer
Copy link
Contributor Author

ping @dongjoon-hyun @LuciferYang

@@ -503,7 +503,7 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
*/
override def databaseExists(dbName: String): Boolean = {
try {
getDatabase(dbName)
makeDatabase(None, dbName)
Copy link
Contributor

Choose a reason for hiding this comment

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

I disagree with this change. There is nearly no benefit and it's kind of encouraging people to never use parameter default values but just call the base function with all parameter values specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SGTM. Let's revert it.

@beliefer beliefer changed the title [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala. Dec 1, 2023
fetchMetadata: Boolean): ResolvedNamespace = {
catalog: CatalogPlugin,
ns: Seq[String],
fetchMetadata: Boolean): ResolvedNamespace = {
Copy link
Member

Choose a reason for hiding this comment

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

Is this the only indentation issue in this file, @beliefer ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

@beliefer beliefer closed this in 9c6782f Dec 1, 2023
@beliefer
Copy link
Contributor Author

beliefer commented Dec 1, 2023

Merged to master.
@dongjoon-hyun @cloud-fan @LuciferYang @heyihong Thank you!

asl3 pushed a commit to asl3/spark that referenced this pull request Dec 5, 2023
### What changes were proposed in this pull request?
apache#43959 get metadata when resolving catalogs instead of directly calling catalog.

This PR fix one minor issues that some code didn't follow the code style of scala.

### Why are the changes needed?
Respect code style for scala.

### Does this PR introduce _any_ user-facing change?
'No'.

### How was this patch tested?
Exists test cases.

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

Closes apache#44079 from beliefer/SPARK-46055_followup.

Authored-by: Jiaan Geng <beliefer@163.com>
Signed-off-by: Jiaan Geng <beliefer@163.com>
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.

5 participants