Conversation
This fixes the tables broken with unescaped `|` characters, and types broken with unescaped `<` characters.
| **Bug for expression caching when UDF nested in UDF or function** | ||
|
|
||
| When [hive.cache.expr.evaluation]({{< ref "#hive-cache-expr-evaluation" >}}) is set to true (which is the default) a UDF can give incorrect results if it is nested in another UDF or a Hive function. This bug affects releases 0.12.0, 0.13.0, and 0.13.1. Release 0.14.0 fixed the bug ([HIVE-7314](https://issues.apache.org/jira/browse/HIVE-7314)). | ||
|
|
||
| The problem relates to the UDF's implementation of the getDisplayString method, as [discussed](http://mail-archives.apache.org/mod_mbox/hive-user/201407.mbox/%3cCAEWg7THU-Pr1Dfv_A8VS3Uz5t3ZyJvL0f-bebg4Zb3hXkK-CGQ@mail.gmail.com%3e) in the Hive user mailing list. |
There was a problem hiding this comment.
Please remove these outdated remarks. I think it's completely unnecessary to keep them on the new web documentation.
Leaving them in the deprecated wiki documentation (https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF) is sufficient.

| 4. select extract(month from interval '1-3' year to month) results in 3. | ||
| 5. select extract(minute from interval '3 12:20:30' day to second) results in 20. | ||
| | | ||
| | int | extract(field FROM source) | Retrieve fields such as days or hours from source (as of Hive [2.2.0](https://issues.apache.org/jira/browse/HIVE-14579)). Source must be a date, timestamp, interval or a string that can be converted into either a date or timestamp. Supported fields include: day, dayofweek, hour, minute, month, quarter, second, week and year. Examples: ① select extract(month from "2016-10-20") results in 10. ② select extract(hour from "2016-10-20 05:06:07") results in 5. ③ select extract(dayofweek from "2016-10-20 05:06:07") results in 5. ④ select extract(month from interval '1-3' year to month) results in 3. ⑤ select extract(minute from interval '3 12:20:30' day to second) results in 20. | |
There was a problem hiding this comment.
Can we display the content like wiki doc:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF

You can run hive-site using: hugo server -D, then test your PR.
|
|
||
| | **Return Type** | **Name(Signature)** | **Description** | | ||
| | --- | --- | --- | | ||
| | string | quote(String text) | Returns the quoted string (Includes escape character for any single quotes [HIVE-4.0.0](https://issues.apache.org/jira/browse/HIVE-21134)) <table><tr><th>Input</th><th>Output</th></tr><tr><td>NULL</td><td>NULL</td></tr><tr><td>DONT</td><td>'DONT'</td></tr><tr><td>DON'T</td><td>'DON\'T</td></tr></table> |
|
@MattBlissett Thank you for your contribution. I think this PR still needs further optimization. You can refer to the display format of the Hive wiki https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF. You can run the hive-site locally using the command |

This fixes the tables broken with unescaped
|characters, and types broken with unescaped<characters.