You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/11/03 06:43:50 UTC

[GitHub] [spark] MaxGekk opened a new pull request, #38490: [WIP][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

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

   ### 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.
   -->
   
   
   ### 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.
   -->
   
   
   ### 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'.
   -->
   
   
   ### 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.
   -->
   


-- 
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] MaxGekk commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1015159756


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,23 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists."

Review Comment:
   @cloud-fan One more thing, by saying this `... a different table name ...`, you linked the location issue to (managed) table issue but there are other issues w/ location that are not linked to (managed) table. And this error class can be re-used in other cases too (try to search the word `location` in `error-classes.json`)



-- 
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] MaxGekk commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1015248173


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,23 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists."

Review Comment:
   > Can you give some examples?
   
   @cloud-fan For example, this one https://github.com/apache/spark/blob/93d13afe7f0319104e88faa79a8ae72bc6e9215f/core/src/main/resources/error/error-classes.json#L2790-L2794



-- 
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] MaxGekk commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1013389572


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -2750,4 +2750,26 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase {
       errorClass = "UNSUPPORTED_EMPTY_LOCATION",
       messageParameters = Map.empty)
   }
+
+  def locationAlreadyExistsInCreate(
+      tableId: TableIdentifier,
+      location: Path): Throwable = {
+    new SparkRuntimeException(
+      errorClass = "LOCATION_ALREADY_EXISTS.CREATE_MANAGED_TABLE",
+      messageParameters = Map(
+        "location" -> toSQLValue(location.toString, StringType),
+        "table" -> toSQLId(tableId.nameParts)))
+  }
+
+  def locationAlreadyExistsInRename(
+      tableId: TableIdentifier,
+      newTableId: TableIdentifier,
+      location: Path): Throwable = {
+    new SparkRuntimeException(
+      errorClass = "LOCATION_ALREADY_EXISTS.RENAME_MANAGED_TABLE",
+      messageParameters = Map(
+        "location" -> toSQLValue(location.toString, StringType),
+        "table" -> toSQLId(tableId.nameParts),

Review Comment:
   It does, see the modified 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] MaxGekk commented on pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on PR #38490:
URL: https://github.com/apache/spark/pull/38490#issuecomment-1308468531

   Merging to master. All GAs passed. Thank you, @srielau @LuciferYang @cloud-fan @itholic for review.


-- 
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] MaxGekk commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1015155854


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,23 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists."

Review Comment:
   In create table, user can specify the location via a create option explicitly but the rename command doesn't allow this.



-- 
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] MaxGekk commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1014594711


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,24 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists.",
+      "Choose a different path or remove the existing location."
+    ],
+    "subClass" : {

Review Comment:
   > I think we should explain how/that the the table's directory name (?) is derived from the table name?
   
   ok. Added a few words. Don't think we should put too much details about impl. It is more important to say how to fix the issue.



-- 
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] LuciferYang commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1013555153


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -2750,4 +2750,26 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase {
       errorClass = "UNSUPPORTED_EMPTY_LOCATION",
       messageParameters = Map.empty)
   }
+
+  def locationAlreadyExistsInCreate(
+      tableId: TableIdentifier,
+      location: Path): Throwable = {
+    new SparkRuntimeException(
+      errorClass = "LOCATION_ALREADY_EXISTS.CREATE_MANAGED_TABLE",
+      messageParameters = Map(
+        "location" -> toSQLValue(location.toString, StringType),
+        "table" -> toSQLId(tableId.nameParts)))
+  }
+
+  def locationAlreadyExistsInRename(
+      tableId: TableIdentifier,
+      newTableId: TableIdentifier,
+      location: Path): Throwable = {
+    new SparkRuntimeException(
+      errorClass = "LOCATION_ALREADY_EXISTS.RENAME_MANAGED_TABLE",
+      messageParameters = Map(
+        "location" -> toSQLValue(location.toString, StringType),
+        "table" -> toSQLId(tableId.nameParts),

Review Comment:
   Got 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


[GitHub] [spark] LuciferYang commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1013230919


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -2750,4 +2750,26 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase {
       errorClass = "UNSUPPORTED_EMPTY_LOCATION",
       messageParameters = Map.empty)
   }
+
+  def locationAlreadyExistsInCreate(
+      tableId: TableIdentifier,
+      location: Path): Throwable = {
+    new SparkRuntimeException(
+      errorClass = "LOCATION_ALREADY_EXISTS.CREATE_MANAGED_TABLE",
+      messageParameters = Map(
+        "location" -> toSQLValue(location.toString, StringType),
+        "table" -> toSQLId(tableId.nameParts)))
+  }
+
+  def locationAlreadyExistsInRename(
+      tableId: TableIdentifier,
+      newTableId: TableIdentifier,
+      location: Path): Throwable = {
+    new SparkRuntimeException(
+      errorClass = "LOCATION_ALREADY_EXISTS.RENAME_MANAGED_TABLE",
+      messageParameters = Map(
+        "location" -> toSQLValue(location.toString, StringType),
+        "table" -> toSQLId(tableId.nameParts),

Review Comment:
   No longer print possible `catalog` and `database`?
   
   



-- 
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 #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1017484444


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,23 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists."

Review Comment:
   that's for a specific legacy behavior and will go away eventually. Can we give it a dedicated error class?



-- 
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] MaxGekk closed pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`
URL: https://github.com/apache/spark/pull/38490


-- 
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] srielau commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
srielau commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1014752823


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,24 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists.",
+      "Choose a different path or remove the existing location."
+    ],
+    "subClass" : {

Review Comment:
   Still not a fan of the subclasses... But see new comment above.



-- 
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] srielau commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
srielau commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1014078710


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,24 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists.",
+      "Choose a different path or remove the existing location."
+    ],
+    "subClass" : {

Review Comment:
   Is this level of differentiation necessary?
   Aside the sub-error class partially repeats what the general test says.
   To make this message useful I think we should explain how/that the the  table's directory name (?) is derived from the table 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] cloud-fan commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1015222396


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,23 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists."

Review Comment:
   > user can specify the location via a create option explicitly
   
   I don't think that's a solution. External table is very different from managed table and changing the table type is likely unacceptable to fix this error.
   
   > there are other issues w/ location that are not linked to (managed) table
   
   Can you give some examples? I searched but can't find any.



-- 
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] MaxGekk commented on pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on PR #38490:
URL: https://github.com/apache/spark/pull/38490#issuecomment-1302993756

   @cloud-fan @srielau Any objections to the changes?


-- 
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 #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1015144581


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,23 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists."

Review Comment:
   do we really need sub error classes here? I think we can do
   ```
   Cannot name the managed table as <identifier>, as its associated location <location> already exists. Please pick a different table name, or remove the existing location first.
   ```



-- 
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] srielau commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
srielau commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1014862790


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,24 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists.",
+      "Choose a different path or remove the existing location."

Review Comment:
   I didn't mean to remove advise. I means to collect all the "facts" up front and then collect all the "advise" in the end.
   I.e. in the most trivial solution just move "Choose a different path or remove the existing location." int the suberror message.... Anyway, these are all nits... 



-- 
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] MaxGekk commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1014873100


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,24 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists.",
+      "Choose a different path or remove the existing location."

Review Comment:
   > I.e. in the most trivial solution just move
   
   ok. I'll move 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


[GitHub] [spark] MaxGekk commented on pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on PR #38490:
URL: https://github.com/apache/spark/pull/38490#issuecomment-1302426607

   @srielau @cloud-fan @itholic @LuciferYang @panbingkun Could you review this PR, please.


-- 
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] srielau commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
srielau commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1014078710


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,24 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists.",
+      "Choose a different path or remove the existing location."
+    ],
+    "subClass" : {

Review Comment:
   Is this level of differentiation necessary?
   Aside the sub-error class text partially repeats what the general text says.
   To make this message useful I think we should explain how/that the the  table's directory name (?) is derived from the table 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] MaxGekk commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1014773620


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,24 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists.",
+      "Choose a different path or remove the existing location."

Review Comment:
   Location and table are different levels of abstractions. And this advise are about resolving the issue on different levels. The main message in the main error class tells users about the location in a filesystem - remove the location if it was created in a filesystem using some fs tools behind of Spark, for example. The sub-class messages focus on more specific problem, and tell users how to solve the issue on the table name level.
   
   > with more advise seems weird
   
   If we can advise something that can potentially solve user's issue even the chance is low, we should do that, I believe.
   
   Probably, the advise in this particular case is trivial but I added it because I thought the main error class **can be used alone** w/ linking to a managed table. 



-- 
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] srielau commented on a diff in pull request #38490: [SPARK-41009][SQL] Rename the error class `_LEGACY_ERROR_TEMP_1070` to `LOCATION_ALREADY_EXISTS`

Posted by GitBox <gi...@apache.org>.
srielau commented on code in PR #38490:
URL: https://github.com/apache/spark/pull/38490#discussion_r1014752750


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -668,6 +668,24 @@
       }
     }
   },
+  "LOCATION_ALREADY_EXISTS" : {
+    "message" : [
+      "Cannot create the location <location> because it already exists.",
+      "Choose a different path or remove the existing location."

Review Comment:
   Given the subclass messages, why do we need this sentence?
   We are basically giving advise first, and then adding more info afterwards... with more advise seems weird



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