You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "beliefer (via GitHub)" <gi...@apache.org> on 2023/11/29 11:36:40 UTC
[PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [spark]
beliefer opened a new pull request, #44079:
URL: https://github.com/apache/spark/pull/44079
### What changes were proposed in this pull request?
https://github.com/apache/spark/pull/43959 get metadata when resolving catalogs instead of directly calling catalog.
This PR fix two minor issues.
- Some code didn't follow the code style of scala.
- Reduce the call site depth.
### Why are the changes needed?
Respect code style for scala and reduce the stack depth.
### 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'.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala. [spark]
Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer closed pull request #44079: [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala.
URL: https://github.com/apache/spark/pull/44079
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #44079:
URL: https://github.com/apache/spark/pull/44079#discussion_r1409292351
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -503,7 +503,7 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
*/
override def databaseExists(dbName: String): Boolean = {
try {
- getDatabase(dbName)
+ makeDatabase(None, dbName: String)
Review Comment:
why do we make it more verbose here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala. [spark]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #44079:
URL: https://github.com/apache/spark/pull/44079#discussion_r1411516522
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala:
##########
@@ -59,9 +59,9 @@ class ResolveCatalogs(val catalogManager: CatalogManager)
}
private def resolveNamespace(
- catalog: CatalogPlugin,
- ns: Seq[String],
- fetchMetadata: Boolean): ResolvedNamespace = {
+ catalog: CatalogPlugin,
+ ns: Seq[String],
+ fetchMetadata: Boolean): ResolvedNamespace = {
Review Comment:
Is this the only indentation issue in this file, @beliefer ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #44079:
URL: https://github.com/apache/spark/pull/44079#discussion_r1410715355
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -503,7 +503,7 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
*/
override def databaseExists(dbName: String): Boolean = {
try {
- getDatabase(dbName)
+ makeDatabase(None, dbName: String)
Review Comment:
the readability will become worse ... I like it the way it was originally
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [spark]
Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on code in PR #44079:
URL: https://github.com/apache/spark/pull/44079#discussion_r1411503344
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -503,7 +503,7 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
*/
override def databaseExists(dbName: String): Boolean = {
try {
- getDatabase(dbName)
+ makeDatabase(None, dbName)
Review Comment:
SGTM. Let's revert it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala. [spark]
Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on code in PR #44079:
URL: https://github.com/apache/spark/pull/44079#discussion_r1411553017
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala:
##########
@@ -59,9 +59,9 @@ class ResolveCatalogs(val catalogManager: CatalogManager)
}
private def resolveNamespace(
- catalog: CatalogPlugin,
- ns: Seq[String],
- fetchMetadata: Boolean): ResolvedNamespace = {
+ catalog: CatalogPlugin,
+ ns: Seq[String],
+ fetchMetadata: Boolean): ResolvedNamespace = {
Review Comment:
Yes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [spark]
Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on PR #44079:
URL: https://github.com/apache/spark/pull/44079#issuecomment-1833701248
ping @dongjoon-hyun @LuciferYang
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [spark]
Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on code in PR #44079:
URL: https://github.com/apache/spark/pull/44079#discussion_r1410062675
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -503,7 +503,7 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
*/
override def databaseExists(dbName: String): Boolean = {
try {
- getDatabase(dbName)
+ makeDatabase(None, dbName: String)
Review Comment:
Reduce the stack depth.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [spark]
Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on PR #44079:
URL: https://github.com/apache/spark/pull/44079#issuecomment-1831872346
ping @heyihong cc @cloud-fan
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala. [spark]
Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on PR #44079:
URL: https://github.com/apache/spark/pull/44079#issuecomment-1835574168
Merged to master.
@dongjoon-hyun @cloud-fan @LuciferYang @heyihong Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46055][SQL][FOLLOWUP] Respect code style for scala and reduce the stack depth. [spark]
Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #44079:
URL: https://github.com/apache/spark/pull/44079#discussion_r1410968044
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -503,7 +503,7 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
*/
override def databaseExists(dbName: String): Boolean = {
try {
- getDatabase(dbName)
+ makeDatabase(None, dbName)
Review Comment:
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org