diff --git a/velox/docs/functions/spark/string.rst b/velox/docs/functions/spark/string.rst index 5639a679542d..7afbba00cef4 100644 --- a/velox/docs/functions/spark/string.rst +++ b/velox/docs/functions/spark/string.rst @@ -342,6 +342,16 @@ String Functions SELECT substring_index('aaaaa', 'aa', 5); -- "aaaaa" SELECT substring_index('aaaaa', 'aa', -5); -- "aaaaa" +.. spark:function:: to_pretty_string(x) -> varchar + + Returns pretty string for ``x``. All scalar types are supported. + Adjusts the timestamp input to the given time zone if set through ``session_timezone`` config. + The result is different from that of casting ``x`` as string in the following aspects. + + - It prints null input as "NULL" rather than producing null output. + + - It prints binary values using the hex format. + .. spark:function:: translate(string, match, replace) -> varchar Returns a new translated string. It translates the character in ``string`` by a diff --git a/velox/functions/lib/RegistrationHelpers.h b/velox/functions/lib/RegistrationHelpers.h index b5f05d91180e..72184c976e37 100644 --- a/velox/functions/lib/RegistrationHelpers.h +++ b/velox/functions/lib/RegistrationHelpers.h @@ -78,6 +78,13 @@ void registerUnaryFloatingPoint(const std::vector& aliases) { registerFunction(aliases); } +template