MrPowers commented on a change in pull request #31073:
URL: https://github.com/apache/spark/pull/31073#discussion_r554457442
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -2841,6 +2841,31 @@ object functions {
// DateTime functions
//////////////////////////////////////////////////////////////////////////////////////////////
+ /**
+ * Creates a datetime interval
+ *
+ * @param years Number of years
+ * @param months Number of months
+ * @param weeks Number of weeks
+ * @param days Number of days
+ * @param hours Number of hours
+ * @param mins Number of mins
+ * @param secs Number of secs
+ * @return A datetime interval
+ * @group datetime_funcs
+ * @since 3.2.0
+ */
+ def make_interval(
Review comment:
@zero323 - are you OK if I create a separate JIRA and do a separate pull
request to add this function to PySpark & R? Seems like @HyukjinKwon is open
to doing everything in one PR or having separate PRs. @jaceklaskowski prefers
one PR for language. Just let me know how you'd like me to proceed to keep
this moving forward, thanks!
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -2841,6 +2841,31 @@ object functions {
// DateTime functions
//////////////////////////////////////////////////////////////////////////////////////////////
+ /**
+ * Creates a datetime interval
+ *
+ * @param years Number of years
+ * @param months Number of months
+ * @param weeks Number of weeks
+ * @param days Number of days
+ * @param hours Number of hours
+ * @param mins Number of mins
+ * @param secs Number of secs
+ * @return A datetime interval
+ * @group datetime_funcs
+ * @since 3.2.0
+ */
+ def make_interval(
+ years: Column = lit(0),
Review comment:
@MaxGekk @HyukjinKwon - Here's where we currently stand on the default
arguments issue:
* Default arguments are not used by other functions in
`org.apache.spark.sql.functions`, so exposing a function with default param
values isn't consistent with what's been done in the past.
* The default arguments to `make_interval` make the function better for
Scala users because it allows for this nice syntax `make_interval(hours =
lit(2))`
* Java users can use the `make_interval` function that's defined with the
default arguments, [as illustrated in this
test](https://github.com/apache/spark/pull/31073/commits/c9492a99ffa8a3ab1380ebde21c1ea200d02c187)
as long as they supply all seven arguments
There are good arguments to use and to avoid default arguments with
`make_interval`. Can you please let me know your updated thoughts on if you
think we should use the default values or not? Thank you.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]