You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "heyihong (via GitHub)" <gi...@apache.org> on 2023/08/06 13:58:09 UTC

[GitHub] [spark] heyihong opened a new pull request, #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

heyihong opened a new pull request, #42363:
URL: https://github.com/apache/spark/pull/42363

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   - Move subclasses of AnalysisException to sql/api
   - Refactor some dependent utilities
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   - Supporting throws these exceptions for better compatibility with the existing control flow behaviors
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   No
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   
   - Existing tests
   


-- 
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


[GitHub] [spark] heyihong commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1286441314


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/QuotingUtils.scala:
##########
@@ -37,6 +49,18 @@ object QuotingUtils {
     }
   }
 
+  def quoted(namespace: Array[String]): String = {
+    namespace.map(quoteIfNeeded).mkString(".")
+  }
+
+  def quoted(ident: Identifier): String = {

Review Comment:
   It may be easier to use if quoted supports overload?



-- 
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


[GitHub] [spark] amaliujia commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "amaliujia (via GitHub)" <gi...@apache.org>.
amaliujia commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1286129876


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala:
##########
@@ -100,13 +100,7 @@ object SparkStringUtils extends Logging {
     truncatedString(seq, "", sep, "", maxFields)
   }
 
-  def quoteIdentifier(name: String): String = {
-    // Escapes back-ticks within the identifier name with double-back-ticks, and then quote the
-    // identifier with back-ticks.
-    "`" + name.replace("`", "``") + "`"
-  }
-
-  /**
+    /**

Review Comment:
   revert this?



##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/QuotingUtils.scala:
##########
@@ -37,6 +49,18 @@ object QuotingUtils {
     }
   }
 
+  def quoted(namespace: Array[String]): String = {
+    namespace.map(quoteIfNeeded).mkString(".")
+  }
+
+  def quoted(ident: Identifier): String = {

Review Comment:
   Nit: I am wondering if this should be renamed to `quotedIdentifier`. Same for the above which might be `quotedNamespace`?



##########
sql/api/src/main/java/org/apache/spark/sql/connector/catalog/IdentifierImpl.java:
##########
@@ -17,14 +17,14 @@
 
 package org.apache.spark.sql.connector.catalog;
 
+import org.apache.arrow.util.Preconditions;

Review Comment:
   Is this used?



-- 
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


[GitHub] [spark] hvanhovell commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "hvanhovell (via GitHub)" <gi...@apache.org>.
hvanhovell commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1285253906


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/analysis/AlreadyExistException.scala:
##########


Review Comment:
   Convention: rename this to `alreadyExistsExceptions.scala`.



-- 
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


[GitHub] [spark] heyihong commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1288461045


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/analysis/alreadyExistException.scala:
##########
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.catalyst.analysis
+
+import org.apache.spark.SparkThrowableHelper
+import org.apache.spark.sql.AnalysisException
+import org.apache.spark.sql.catalyst.util.AttributeNameParser
+import org.apache.spark.sql.catalyst.util.QuotingUtils.{quoted, quoteIdentifier, quoteNameParts}
+import org.apache.spark.sql.connector.catalog.Identifier
+
+/**
+ * Thrown by a catalog when an item already exists. The analyzer will rethrow the exception
+ * as an [[org.apache.spark.sql.AnalysisException]] with the correct position information.
+ */
+class DatabaseAlreadyExistsException(db: String)

Review Comment:
   Some dependent utilities in these exceptions are moved to sql/api as well for avoiding dependency on catalyst module. The change is reflected in the import as well
   Before:
   ```
   import org.apache.spark.sql.catalyst.util.{quoteIdentifier, quoteNameParts }
   import org.apache.spark.sql.connector.catalog.CatalogV2Implicits.IdentifierHelper
   ```
   After:
   ```
   import org.apache.spark.sql.catalyst.util.QuotingUtils.{quoted, quoteIdentifier, quoteNameParts}
   ```



##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/analysis/alreadyExistException.scala:
##########
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.catalyst.analysis
+
+import org.apache.spark.SparkThrowableHelper
+import org.apache.spark.sql.AnalysisException
+import org.apache.spark.sql.catalyst.util.AttributeNameParser
+import org.apache.spark.sql.catalyst.util.QuotingUtils.{quoted, quoteIdentifier, quoteNameParts}
+import org.apache.spark.sql.connector.catalog.Identifier
+
+/**
+ * Thrown by a catalog when an item already exists. The analyzer will rethrow the exception
+ * as an [[org.apache.spark.sql.AnalysisException]] with the correct position information.
+ */
+class DatabaseAlreadyExistsException(db: String)

Review Comment:
   Some dependent utilities in these exceptions are moved to sql/api as well for avoiding dependency on catalyst module. The change is reflected in the import as well
   
   Before:
   ```
   import org.apache.spark.sql.catalyst.util.{quoteIdentifier, quoteNameParts }
   import org.apache.spark.sql.connector.catalog.CatalogV2Implicits.IdentifierHelper
   ```
   After:
   ```
   import org.apache.spark.sql.catalyst.util.QuotingUtils.{quoted, quoteIdentifier, quoteNameParts}
   ```



-- 
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


[GitHub] [spark] heyihong commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1286441314


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/QuotingUtils.scala:
##########
@@ -37,6 +49,18 @@ object QuotingUtils {
     }
   }
 
+  def quoted(namespace: Array[String]): String = {
+    namespace.map(quoteIfNeeded).mkString(".")
+  }
+
+  def quoted(ident: Identifier): String = {

Review Comment:
   `quoted` seems to be easier to use because of the overload support?



-- 
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


[GitHub] [spark] cloud-fan commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1288371611


##########
sql/api/src/main/java/org/apache/spark/sql/connector/catalog/Identifier.java:
##########


Review Comment:
   It's weird to only move one DS v2 API to the api module. Shall we move all of them?



-- 
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


[GitHub] [spark] cloud-fan commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1288671904


##########
sql/api/src/main/java/org/apache/spark/sql/connector/catalog/Identifier.java:
##########


Review Comment:
   yea, can you create a JIRA ticket? to make sure we don't lose track.



-- 
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


[GitHub] [spark] heyihong commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1286443119


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/QuotingUtils.scala:
##########
@@ -37,6 +49,18 @@ object QuotingUtils {
     }
   }
 
+  def quoted(namespace: Array[String]): String = {
+    namespace.map(quoteIfNeeded).mkString(".")
+  }
+
+  def quoted(ident: Identifier): String = {

Review Comment:
   `quoted` may be easier to use because of the overload support?



-- 
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


[GitHub] [spark] cloud-fan commented on pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #42363:
URL: https://github.com/apache/spark/pull/42363#issuecomment-1672662578

   thanks, merging to master/3.5!


-- 
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


[GitHub] [spark] heyihong commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1288464312


##########
sql/api/src/main/java/org/apache/spark/sql/connector/catalog/Identifier.java:
##########


Review Comment:
   It is a good point that we shall move all of them to the api module. But it seems to be out of scope for this pr. Ca we do this in a follow up?



-- 
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


[GitHub] [spark] hvanhovell commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "hvanhovell (via GitHub)" <gi...@apache.org>.
hvanhovell commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1285253833


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/analysis/NoSuchItemException.scala:
##########


Review Comment:
   Convention: Rename to `noSuchItemsExceptions.scala`.



-- 
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


[GitHub] [spark] cloud-fan commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1288372326


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/analysis/alreadyExistException.scala:
##########
@@ -0,0 +1,185 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.catalyst.analysis
+
+import org.apache.spark.SparkThrowableHelper
+import org.apache.spark.sql.AnalysisException
+import org.apache.spark.sql.catalyst.util.AttributeNameParser
+import org.apache.spark.sql.catalyst.util.QuotingUtils.{quoted, quoteIdentifier, quoteNameParts}
+import org.apache.spark.sql.connector.catalog.Identifier
+
+/**
+ * Thrown by a catalog when an item already exists. The analyzer will rethrow the exception
+ * as an [[org.apache.spark.sql.AnalysisException]] with the correct position information.
+ */
+class DatabaseAlreadyExistsException(db: String)

Review Comment:
   is there any actual change? or it's just code move around?



-- 
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


[GitHub] [spark] amaliujia commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "amaliujia (via GitHub)" <gi...@apache.org>.
amaliujia commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1286462131


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/QuotingUtils.scala:
##########
@@ -37,6 +49,18 @@ object QuotingUtils {
     }
   }
 
+  def quoted(namespace: Array[String]): String = {
+    namespace.map(quoteIfNeeded).mkString(".")
+  }
+
+  def quoted(ident: Identifier): String = {

Review Comment:
   I am fine with either way



-- 
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


[GitHub] [spark] cloud-fan closed pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan closed pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api
URL: https://github.com/apache/spark/pull/42363


-- 
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


[GitHub] [spark] hvanhovell commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "hvanhovell (via GitHub)" <gi...@apache.org>.
hvanhovell commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1285253833


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/analysis/NoSuchItemException.scala:
##########


Review Comment:
   Convention: `noSuchItemsExceptions.scala` as the file name.



-- 
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


[GitHub] [spark] heyihong commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1286441314


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/QuotingUtils.scala:
##########
@@ -37,6 +49,18 @@ object QuotingUtils {
     }
   }
 
+  def quoted(namespace: Array[String]): String = {
+    namespace.map(quoteIfNeeded).mkString(".")
+  }
+
+  def quoted(ident: Identifier): String = {

Review Comment:
   `quoted` seems to be easier to use because of the overload support?



-- 
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


[GitHub] [spark] heyihong commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1288995290


##########
sql/api/src/main/java/org/apache/spark/sql/connector/catalog/Identifier.java:
##########


Review Comment:
   Yes, https://issues.apache.org/jira/browse/SPARK-44744



##########
sql/api/src/main/java/org/apache/spark/sql/connector/catalog/Identifier.java:
##########


Review Comment:
   Yes, created https://issues.apache.org/jira/browse/SPARK-44744



-- 
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


[GitHub] [spark] heyihong commented on a diff in pull request #42363: [SPARK-44691][SQL][CONNECT] Move Subclasses of AnalysisException to sql/api

Posted by "heyihong (via GitHub)" <gi...@apache.org>.
heyihong commented on code in PR #42363:
URL: https://github.com/apache/spark/pull/42363#discussion_r1286134566


##########
sql/api/src/main/java/org/apache/spark/sql/connector/catalog/IdentifierImpl.java:
##########
@@ -17,14 +17,14 @@
 
 package org.apache.spark.sql.connector.catalog;
 
+import org.apache.arrow.util.Preconditions;

Review Comment:
   Yes
   ```
     IdentifierImpl(String[] namespace, String name) {
       Preconditions.checkNotNull(namespace, "Identifier namespace cannot be null");
       Preconditions.checkNotNull(name, "Identifier name cannot be null");
       this.namespace = namespace;
       this.name = name;
     }
   ```



-- 
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