-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-45569][SQL] Assign name to the error _LEGACY_ERROR_TEMP_2152 #43396
Conversation
@@ -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]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid this change.
You can use ExpressionEncoder.createDeserializer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reminding this @beliefer , it was modified by accident and I have reverted it, PTAL again.
c79f9be
to
c82678b
Compare
@@ -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:")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is a chance to use checkError
with errorClass
. cc @MaxGekk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, if it is possible let's use checkError
but this one is from a nested non-Spark exception, isn't.
@@ -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")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@dengziming Please, resolve conflicts. |
0771238
to
4afd3ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
All GAs passed: https://github.com/dengziming/spark/actions/runs/6570868445/job/17859440831 |
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.