You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dengziming (via GitHub)" <gi...@apache.org> on 2023/10/17 08:13:25 UTC
[PR] [SPARK-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152 [spark]
dengziming opened a new pull request, #43396:
URL: https://github.com/apache/spark/pull/43396
### What changes were proposed in this pull request?
Assign the name `EXPRESSION_ENCODING_FAILED` to the legacy error class `_LEGACY_ERROR_TEMP_2152`.
### Why are the changes needed?
To assign proper name as a part of activity in SPARK-37935.
### Does this PR introduce _any_ user-facing change?
Yes, the error message will include the error class name
### How was this patch tested?
Add a unit test to produce the error from user code.
### 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-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152 [spark]
Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on code in PR #43396:
URL: https://github.com/apache/spark/pull/43396#discussion_r1363744291
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/RowEncoderSuite.scala:
##########
@@ -276,8 +276,8 @@ class RowEncoderSuite extends CodegenInterpretedPlanTest {
val schema = new StructType().add("int", IntegerType)
val encoder = ExpressionEncoder(schema)
val e = intercept[RuntimeException](toRow(encoder, null))
- assert(e.getMessage.contains("Null value appeared in non-nullable field"))
- assert(e.getMessage.contains("top level Product or row object"))
+ assert(e.getCause.getMessage.contains("Null value appeared in non-nullable field"))
Review Comment:
ditto
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala:
##########
@@ -652,7 +652,7 @@ class ExpressionEncoderSuite extends CodegenInterpretedPlanTest with AnalysisTes
val e = intercept[RuntimeException] {
toRow(bigNumeric)
}
- assert(e.getMessage.contains("Error while encoding"))
+ assert(e.getMessage.contains("Failed to encode a value of the expressions:"))
Review Comment:
Maybe this is a chance to use `checkError` with `errorClass`. cc @MaxGekk
--
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-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152 [spark]
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on code in PR #43396:
URL: https://github.com/apache/spark/pull/43396#discussion_r1363748752
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala:
##########
@@ -652,7 +652,7 @@ class ExpressionEncoderSuite extends CodegenInterpretedPlanTest with AnalysisTes
val e = intercept[RuntimeException] {
toRow(bigNumeric)
}
- assert(e.getMessage.contains("Error while encoding"))
+ assert(e.getMessage.contains("Failed to encode a value of the expressions:"))
Review Comment:
Yep, if it is possible let's use `checkError` but this one is from a nested non-Spark exception, isn't.
--
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-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152 [spark]
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk closed pull request #43396: [SPARK-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152
URL: https://github.com/apache/spark/pull/43396
--
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-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152 [spark]
Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on code in PR #43396:
URL: https://github.com/apache/spark/pull/43396#discussion_r1361756450
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala:
##########
@@ -191,7 +191,7 @@ object ExpressionEncoder {
* thread-safe. Note that multiple calls to `apply(..)` return the same actual [[InternalRow]]
* object. Thus, the caller should copy the result before making another call if required.
*/
- class Serializer[T](private val expressions: Seq[Expression])
Review Comment:
Please avoid this change.
You can use `ExpressionEncoder.createDeserializer`
--
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-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152 [spark]
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #43396:
URL: https://github.com/apache/spark/pull/43396#issuecomment-1770131478
@dengziming Please, resolve conflicts.
--
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-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152 [spark]
Posted by "dengziming (via GitHub)" <gi...@apache.org>.
dengziming commented on code in PR #43396:
URL: https://github.com/apache/spark/pull/43396#discussion_r1363696812
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala:
##########
@@ -191,7 +191,7 @@ object ExpressionEncoder {
* thread-safe. Note that multiple calls to `apply(..)` return the same actual [[InternalRow]]
* object. Thus, the caller should copy the result before making another call if required.
*/
- class Serializer[T](private val expressions: Seq[Expression])
Review Comment:
Thank you for reminding this @beliefer , it was modified by accident and I have reverted it, PTAL again.
--
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-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152 [spark]
Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #43396:
URL: https://github.com/apache/spark/pull/43396#issuecomment-1770851933
All GAs passed: https://github.com/dengziming/spark/actions/runs/6570868445/job/17859440831
Merging to master.
Thank you, @dengziming and @beliefer 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