Skip to content

Conversation

@MattBlissett
Copy link

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

This fixes the tables broken with unescaped `|` characters, and types broken with unescaped `<` characters.
Comment on lines 20 to 24
**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.
Copy link
Contributor

@zhangbutao zhangbutao Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Image

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. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we display the content like wiki doc:

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF
Image

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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we display content like wiki doc:

Image

@zhangbutao
Copy link
Contributor

@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 hugo server -D, then view and test the local page at http://localhost:1313/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants