Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20163#discussion_r159805825
--- Diff: python/pyspark/sql/udf.py ---
@@ -26,6 +26,28 @@
def _wrap_function(sc, func, returnType):
+ def coerce_to_str(v):
+ import datetime
+ if type(v) == datetime.date or type(v) == datetime.datetime:
+ return str(v)
--- End diff --
I think it's weird that we have a cast here alone ... Can't we register a
custom Pyrolite unpickler? Does it make the things more complicated?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]