zhengruifeng commented on code in PR #41505:
URL: https://github.com/apache/spark/pull/41505#discussion_r1225015644
##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -3393,6 +3421,81 @@ object functions {
*/
def upper(e: Column): Column = Column.fn("upper", e)
+ /**
+ * Converts the input `e` to a binary value based on the supplied `f`. The
`f` can be a
+ * case-insensitive string literal of "hex", "utf-8", "utf8", or "base64".
By default, the
+ * binary format for conversion is "hex" if `fmt` is omitted. The function
returns NULL if at
+ * least one of the input parameters is NULL.
+ *
+ * @group string_funcs
+ * @since 3.5.0
+ */
+ def to_binary(e: Column, f: Column): Column = Column.fn("to_binary", e, f)
+
+ /**
+ * Converts the input `e` to a binary value based on the format "hex". The
function returns NULL
+ * if at least one of the input parameters is NULL.
+ *
+ * @group string_funcs
+ * @since 3.5.0
+ */
+ def to_binary(e: Column): Column = Column.fn("to_binary", e)
+
+ // format: off
Review Comment:
I think we should not use `// format: off`
##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -3393,6 +3421,81 @@ object functions {
*/
def upper(e: Column): Column = Column.fn("upper", e)
+ /**
+ * Converts the input `e` to a binary value based on the supplied `f`. The
`f` can be a
+ * case-insensitive string literal of "hex", "utf-8", "utf8", or "base64".
By default, the
+ * binary format for conversion is "hex" if `fmt` is omitted. The function
returns NULL if at
+ * least one of the input parameters is NULL.
+ *
+ * @group string_funcs
+ * @since 3.5.0
+ */
+ def to_binary(e: Column, f: Column): Column = Column.fn("to_binary", e, f)
+
+ /**
+ * Converts the input `e` to a binary value based on the format "hex". The
function returns NULL
+ * if at least one of the input parameters is NULL.
+ *
+ * @group string_funcs
+ * @since 3.5.0
+ */
+ def to_binary(e: Column): Column = Column.fn("to_binary", e)
+
+ // format: off
+ /**
+ * Convert `e` to a string based on the `format`.
+ * Throws an exception if the conversion fails. The format can consist of
the following
+ * characters, case insensitive:
+ * '0' or '9': Specifies an expected digit between 0 and 9. A sequence of
0 or 9 in the format
+ * string matches a sequence of digits in the input value, generating a
result string of the
+ * same length as the corresponding sequence in the format string. The
result string is
+ * left-padded with zeros if the 0/9 sequence comprises more digits than
the matching part of
+ * the decimal value, starts with 0, and is before the decimal point.
Otherwise, it is
+ * padded with spaces.
+ * '.' or 'D': Specifies the position of the decimal point (optional, only
allowed once).
+ * ',' or 'G': Specifies the position of the grouping (thousands)
separator (,). There must be
+ * a 0 or 9 to the left and right of each grouping separator.
+ * '$': Specifies the location of the $ currency sign. This character may
only be specified
+ * once.
+ * 'S' or 'MI': Specifies the position of a '-' or '+' sign (optional,
only allowed once at
+ * the beginning or end of the format string). Note that 'S' prints '+'
for positive values
+ * but 'MI' prints a space.
+ * 'PR': Only allowed at the end of the format string; specifies that the
result string will be
+ * wrapped by angle brackets if the input value is negative.
+ *
+ * @group string_funcs
+ * @since 3.5.0
+ */
+ // format: on
+ def to_char(e: Column, format: Column): Column = Column.fn("to_char", e,
format)
+
+ // format: off
Review Comment:
ditto
--
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]