zabetak commented on code in PR #73:
URL: https://github.com/apache/hive-site/pull/73#discussion_r2498259772


##########
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 date** | ``` CAST( <column> AS <type> FORMAT <pattern>) ``` | 
Converts a datetime value to string or string-type value to datetime based on 
the format pattern specified. | 
[GenericUDFCastFormat](https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFCastFormat.java)
 |

Review Comment:
   * Datetime is a broader category so let's use this term for the the return 
type as well.
   * Change <column> to expr since the latter is more general and more uniform 
with the regular cast documentation above
   
   For the description, I would suggest the following:
   
   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.



-- 
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]

Reply via email to