HyukjinKwon opened a new pull request #34625:
URL: https://github.com/apache/spark/pull/34625


   ### What changes were proposed in this pull request?
   
   This PR adds the support of `DayTimeIntervalType` to Py4J. Namely, it will 
automatically convert `datetime.timedelta` to `java.util.Duration` that is 
mapped to `DayTimeIntervalType` in Scala/Java.
   
   This PR is dependent on https://github.com/apache/spark/pull/34614
   
   ### Why are the changes needed?
   
   To complete ANSI interval type supports in PySpark.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, after this changes, users can use `datetime.timedelta` as an arguments 
in PySpark APIs. For example,
   
   ```python
   import datetime
   from pyspark.sql.functions import lit
   spark.range(1).select(lit(datetime.timedelta(days=1, hours=12, 
milliseconds=123))).show()
   ```
   
   ### How was this patch tested?
   
   Manually tested, and unittest was added.


-- 
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]

Reply via email to