You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by za...@apache.org on 2025/11/07 18:08:54 UTC
(hive-site) branch main updated: HIVE-28425: Add documentation for CAST FORMAT function (#73)
This is an automated email from the ASF dual-hosted git repository.
zabetak pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hive-site.git
The following commit(s) were added to refs/heads/main by this push:
new b440c93 HIVE-28425: Add documentation for CAST FORMAT function (#73)
b440c93 is described below
commit b440c933c469147a5f869858a8bfe6924178490a
Author: Michael Akinyemi <43...@users.noreply.github.com>
AuthorDate: Fri Nov 7 13:08:49 2025 -0500
HIVE-28425: Add documentation for CAST FORMAT function (#73)
---
content/docs/latest/language/hive-udfs.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/docs/latest/language/hive-udfs.md b/content/docs/latest/language/hive-udfs.md
index d4d4188..3c95b29 100644
--- a/content/docs/latest/language/hive-udfs.md
+++ b/content/docs/latest/language/hive-udfs.md
@@ -267,8 +267,8 @@ The following built-in type conversion functions are supported in Hive.
| Return Type | Name(Signature) | Description | Source code |
| --- | --- | --- | --- |
| **binary** | ``` binary(string\|binary) ``` | Casts the parameter into a binary. | [GenericUDFBaseBinary](https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseBinary.java) |
-| **Expected "=" to follow "type"** | ``` cast(expr as <type>) ``` | Converts the results of the expression expr to \<type\>. For example, cast('1' as bigint) will convert the string '1' to its integral representation. A null is returned if the conversion does not succeed. If cast(expr as boolean) Hive returns true for a non-empty string. | [GenericUDFCastFormat](https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCastFormat.java) |
-
+| **Expected "=" to follow "type"** | ``` cast(expr as <type>) ``` | Converts the results of the expression expr to \<type\>. For example, cast('1' as bigint) will convert the string '1' to its integral representation. A null is returned if the conversion does not succeed. If cast(expr as boolean) Hive returns true for a non-empty string. | |
+| **string or datetime** | ``` CAST(expr AS <type> FORMAT <pattern>) ``` | Converts the expression to the specified <type> using the provided <pattern>. The <pattern> if present follows the SQL:2016 standard specification. Currently only conversions between datetime and string data types are supported. | [GenericUDFCastFormat](https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCastFormat.java) |
### Conditional Functions
The following built-in conditional functions are supported in Hive.