xinrong-meng commented on code in PR #39835:
URL: https://github.com/apache/spark/pull/39835#discussion_r1092801467
##########
python/pyspark/sql/connect/types.py:
##########
@@ -108,6 +109,17 @@ def pyspark_types_to_proto_types(data_type: DataType) ->
pb2.DataType:
elif isinstance(data_type, ArrayType):
ret.array.element_type.CopyFrom(pyspark_types_to_proto_types(data_type.elementType))
ret.array.contains_null = data_type.containsNull
+ elif isinstance(data_type, UserDefinedType):
+ json_value = data_type.jsonValue()
+ ret.udt.type = "udt"
+ if "class" in json_value:
+ # Scala/Java UDT
+ ret.udt.jvm_class = json_value["class"]
+ else:
+ # Python UDT
+ ret.udt.serialized_python_class = json_value["serializedClass"]
+ ret.udt.python_class = json_value["pyClass"]
Review Comment:
Out of curiosity, why should a Scala/Java UDT have "pyClass"?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]