uros-b commented on code in PR #57476:
URL: https://github.com/apache/spark/pull/57476#discussion_r3700463848
##########
sql/api/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -6027,6 +6027,50 @@ object functions {
*/
def round(e: Column, scale: Column): Column = Column.fn("round", e, scale)
+ /**
+ * Truncates the value of `e` toward zero to 0 decimal places.
+ *
+ * @param e
+ * the value to truncate. A column that evaluates to a numeric.
+ * @group math_funcs
+ * @since 4.3.0
+ * @return
+ * Returns a column of the same type as the input.
+ */
+ def truncate(e: Column): Column = truncate(e, 0)
+
+ /**
+ * Truncates the value of `e` toward zero to `scale` decimal places when
`scale` is greater than
+ * or equal to 0, or to the left of the decimal point when `scale` is less
than 0.
+ *
+ * @param e
+ * the value to truncate. A column that evaluates to a numeric.
+ * @param scale
+ * the number of decimal places to keep. A column that evaluates to an
integral. Must be a
+ * constant.
+ * @group math_funcs
+ * @since 4.3.0
+ * @return
+ * Returns a column of the same type as the input.
+ */
+ def truncate(e: Column, scale: Int): Column = Column.fn("truncate", e,
lit(scale))
+
+ /**
+ * Truncates the value of `e` toward zero to `scale` decimal places when
`scale` is greater than
+ * or equal to 0, or to the left of the decimal point when `scale` is less
than 0.
+ *
+ * @param e
+ * the value to truncate. A column that evaluates to a numeric.
+ * @param scale
+ * the number of decimal places to keep. A column that evaluates to an
integral. Must be a
+ * constant.
+ * @group math_funcs
+ * @since 4.3.0
+ * @return
Review Comment:
here (and above), `@return` is placed after `@since`; whereas Spark's
convention puts `@param` and `@return` before `@group` and `@since`.
--
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]