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/11 05:28:55 UTC

[GitHub] [spark] panbingkun opened a new pull request, #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

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

   ### What changes were proposed in this pull request?
   In the PR, I propose to rename the legacy error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN.
   
   ### Why are the changes needed?
   Proper names of error classes should improve user experience with Spark SQL.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes.
   
   ### How was this patch tested?
   By running the affected test suites:
   > $ build/sbt "sql/testOnly *SQLQuerySuite"
   > $ PYSPARK_PYTHON=python3 build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z strings.sql"


-- 
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 #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -630,6 +630,11 @@
       "Input schema <jsonSchema> can only contain STRING as a key type for a MAP."
     ]
   },
+  "INVALID_LIKE_PATTERN" : {
+    "message" : [
+      "The pattern '<pattern>' is invalid, <message>."

Review Comment:
   Is it always the same message? If so we could map 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 closed pull request #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN
URL: https://github.com/apache/spark/pull/38615


-- 
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] dongjoon-hyun commented on pull request #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on PR #38615:
URL: https://github.com/apache/spark/pull/38615#issuecomment-1313174514

   I made a PR.
   - https://github.com/apache/spark/pull/38645


-- 
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 #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -630,6 +630,11 @@
       "Input schema <jsonSchema> can only contain STRING as a key type for a MAP."
     ]
   },
+  "INVALID_LIKE_PATTERN" : {
+    "message" : [
+      "The pattern '<pattern>' is invalid, <message>."

Review Comment:
   It would be nice to avoid the `message` but it is useful in this case. @cloud-fan @srielau WDYT?



-- 
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 #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -630,6 +630,11 @@
       "Input schema <jsonSchema> can only contain STRING as a key type for a MAP."
     ]
   },
+  "INVALID_LIKE_PATTERN" : {
+    "message" : [
+      "The pattern '<pattern>' is invalid, <message>."

Review Comment:
   Actually, the message comes from Spark's code, see:
   https://github.com/apache/spark/blob/70ec696bce7012b25ed6d8acec5e2f3b3e127f11/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala#L50
   and there are just 2 messages:
   1. https://github.com/apache/spark/blob/70ec696bce7012b25ed6d8acec5e2f3b3e127f11/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala#L59
   2. https://github.com/apache/spark/blob/70ec696bce7012b25ed6d8acec5e2f3b3e127f11/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala#L61
   
   @panbingkun Could you place the messages to the JSON files instead of leaving them in the source code, 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] panbingkun commented on a diff in pull request #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -630,6 +630,11 @@
       "Input schema <jsonSchema> can only contain STRING as a key type for a MAP."
     ]
   },
+  "INVALID_LIKE_PATTERN" : {
+    "message" : [
+      "The pattern '<pattern>' is invalid, <message>."

Review Comment:
   Done



-- 
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] panbingkun commented on pull request #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

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

   cc @MaxGekk @itholic 


-- 
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] dongjoon-hyun commented on a diff in pull request #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on code in PR #38615:
URL: https://github.com/apache/spark/pull/38615#discussion_r1021129372


##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -30,6 +30,7 @@ import org.apache.commons.io.FileUtils
 
 import org.apache.spark.{AccumulatorSuite, SparkException}
 import org.apache.spark.scheduler.{SparkListener, SparkListenerJobStart}
+import org.apache.spark.sql.catalyst.expressions.Cast._

Review Comment:
   This addition was the root cause of Scala style check failure.



-- 
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] dongjoon-hyun commented on pull request #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on PR #38615:
URL: https://github.com/apache/spark/pull/38615#issuecomment-1313170892

   Hi, @MaxGekk . It seems that this PR didn't passed CI properly. Could you check once more?


-- 
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 #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -630,6 +630,23 @@
       "Input schema <jsonSchema> can only contain STRING as a key type for a MAP."
     ]
   },
+  "INVALID_LIKE_PATTERN" : {
+    "message" : [
+      "The pattern <pattern> is invalid."
+    ],
+    "subClass" : {
+      "ESC_IN_THE_MIDDLE" : {

Review Comment:
   sub class order is wrong, should be `ESC_AT_THE_END` then `ESC_IN_THE_MIDDLE`
   
   https://github.com/apache/spark/pull/38658 for fix 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] AmplabJenkins commented on pull request #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

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

   Can one of the admins verify this patch?


-- 
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 #38615: [SPARK-41109][SQL] Rename the error class _LEGACY_ERROR_TEMP_1216 to INVALID_LIKE_PATTERN

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

   +1, LGTM. Merging to master.
   Thank you, @panbingkun and @srielau 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