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 2023/01/11 07:32:56 UTC
[GitHub] [spark] itholic opened a new pull request, #39498: [SPARK-41975][SQL] Improve error message for `INDEX_NOT_FOUND`
itholic opened a new pull request, #39498:
URL: https://github.com/apache/spark/pull/39498
### What changes were proposed in this pull request?
This PR proposes to improve error message for `INDEX_NOT_FOUND`.
### Why are the changes needed?
Make the error message more clear and proper.
### 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.
-->
Fix UT and `./build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite*`
--
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] itholic commented on pull request #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
Posted by GitBox <gi...@apache.org>.
itholic commented on PR #39498:
URL: https://github.com/apache/spark/pull/39498#issuecomment-1381248615
Test passed.
cc @MaxGekk @srielau FYI
--
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] itholic commented on a diff in pull request #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
Posted by GitBox <gi...@apache.org>.
itholic commented on code in PR #39498:
URL: https://github.com/apache/spark/pull/39498#discussion_r1071742050
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala:
##########
@@ -224,7 +224,11 @@ private object PostgresDialect extends JdbcDialect with SQLConfHelper {
sqlException.getSQLState match {
// https://www.postgresql.org/docs/14/errcodes-appendix.html
case "42P07" => throw new IndexAlreadyExistsException(message, cause = Some(e))
- case "42704" => throw new NoSuchIndexException(message, cause = Some(e))
+ case "42704" =>
+ // The message is: Failed to drop index indexName in tableName
+ val regex = "(?s)Failed to drop index (.*) in".r
Review Comment:
Do you mean `tableName` so maybe do we want to show the error message like:
`Cannot find the index <indexName> on table <tableName>.`
?
--
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 #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on PR #39498:
URL: https://github.com/apache/spark/pull/39498#issuecomment-1397987596
thanks, merging to master!
--
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 #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
Posted by GitBox <gi...@apache.org>.
srielau commented on code in PR #39498:
URL: https://github.com/apache/spark/pull/39498#discussion_r1070635016
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala:
##########
@@ -224,7 +224,11 @@ private object PostgresDialect extends JdbcDialect with SQLConfHelper {
sqlException.getSQLState match {
// https://www.postgresql.org/docs/14/errcodes-appendix.html
case "42P07" => throw new IndexAlreadyExistsException(message, cause = Some(e))
- case "42704" => throw new NoSuchIndexException(message, cause = Some(e))
+ case "42704" =>
+ // The message is: Failed to drop index indexName in tableName
+ val regex = "(?s)Failed to drop index (.*) in".r
Review Comment:
Seems we may be able to pick up the qualifiers as well ?
--
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] itholic commented on pull request #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
Posted by GitBox <gi...@apache.org>.
itholic commented on PR #39498:
URL: https://github.com/apache/spark/pull/39498#issuecomment-1397888101
Also 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
[GitHub] [spark] srielau commented on a diff in pull request #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
Posted by GitBox <gi...@apache.org>.
srielau commented on code in PR #39498:
URL: https://github.com/apache/spark/pull/39498#discussion_r1072729600
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala:
##########
@@ -224,7 +224,11 @@ private object PostgresDialect extends JdbcDialect with SQLConfHelper {
sqlException.getSQLState match {
// https://www.postgresql.org/docs/14/errcodes-appendix.html
case "42P07" => throw new IndexAlreadyExistsException(message, cause = Some(e))
- case "42704" => throw new NoSuchIndexException(message, cause = Some(e))
+ case "42704" =>
+ // The message is: Failed to drop index indexName in tableName
+ val regex = "(?s)Failed to drop index (.*) in".r
Review Comment:
Yeah..
--
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] itholic commented on a diff in pull request #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
Posted by GitBox <gi...@apache.org>.
itholic commented on code in PR #39498:
URL: https://github.com/apache/spark/pull/39498#discussion_r1073050100
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala:
##########
@@ -224,7 +224,11 @@ private object PostgresDialect extends JdbcDialect with SQLConfHelper {
sqlException.getSQLState match {
// https://www.postgresql.org/docs/14/errcodes-appendix.html
case "42P07" => throw new IndexAlreadyExistsException(message, cause = Some(e))
- case "42704" => throw new NoSuchIndexException(message, cause = Some(e))
+ case "42704" =>
+ // The message is: Failed to drop index indexName in tableName
+ val regex = "(?s)Failed to drop index (.*) in".r
Review Comment:
Thanks! Just update the message
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala:
##########
@@ -224,7 +224,11 @@ private object PostgresDialect extends JdbcDialect with SQLConfHelper {
sqlException.getSQLState match {
// https://www.postgresql.org/docs/14/errcodes-appendix.html
case "42P07" => throw new IndexAlreadyExistsException(message, cause = Some(e))
- case "42704" => throw new NoSuchIndexException(message, cause = Some(e))
+ case "42704" =>
+ // The message is: Failed to drop index indexName in tableName
+ val regex = "(?s)Failed to drop index (.*) in".r
Review Comment:
Thanks! Just updated the message
--
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 #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
URL: https://github.com/apache/spark/pull/39498
--
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] itholic commented on a diff in pull request #39498: [SPARK-41976][SQL] Improve error message for `INDEX_NOT_FOUND`
Posted by GitBox <gi...@apache.org>.
itholic commented on code in PR #39498:
URL: https://github.com/apache/spark/pull/39498#discussion_r1071742050
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala:
##########
@@ -224,7 +224,11 @@ private object PostgresDialect extends JdbcDialect with SQLConfHelper {
sqlException.getSQLState match {
// https://www.postgresql.org/docs/14/errcodes-appendix.html
case "42P07" => throw new IndexAlreadyExistsException(message, cause = Some(e))
- case "42704" => throw new NoSuchIndexException(message, cause = Some(e))
+ case "42704" =>
+ // The message is: Failed to drop index indexName in tableName
+ val regex = "(?s)Failed to drop index (.*) in".r
Review Comment:
Do you mean maybe we should also pick up the `tableName` so that we show the error message like:
`Cannot find the index <indexName> on table <tableName>.`
?
--
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