-
Notifications
You must be signed in to change notification settings - Fork 28.8k
[SPARK-53544][PYTHON] Support complex types on observations #52321
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
base: master
Are you sure you want to change the base?
[SPARK-53544][PYTHON] Support complex types on observations #52321
Conversation
cc @heyihong |
@@ -436,11 +442,48 @@ def _to_value( | |||
assert dataType is None or isinstance(dataType, DayTimeIntervalType) | |||
return DayTimeIntervalType().fromInternal(literal.day_time_interval) | |||
elif literal.HasField("array"): | |||
elementType = proto_schema_to_pyspark_data_type(literal.array.element_type) | |||
if literal.array.HasField("data_type"): |
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.
Curious when does data_type exist and when does it not?
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.
For example of Array
, data_type
was added and element_type
was deprecated.
but the creator of the message may follow it or may not, so this should be able to handle both cases.
Same for Map
and Struct
.
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.
To minimize changes, it is not necessary to support these new data type fields. They are still under development and not fully stabilized yet. Currently, the new data type fields are only used in the requests from the Spark Connect Scala Client.
If we really want to support them, I think we need to consider:
- How can we enable the new data type fields in the responses while maintaining backward compatibility?
- How is this code path tested?
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.
Sure, I'll revert the changes and leave it to you.
What changes were proposed in this pull request?
Supports complex types on observations.
Why are the changes needed?
The observations didn't support complex types.
For example:
Does this PR introduce any user-facing change?
Yes, complex types are available on observations.
How was this patch tested?
Added the related tests.
Was this patch authored or co-authored using generative AI tooling?
No.