Skip to content

[doc](sql-functions) Add gamma function documentation - #4140

Open
RH211-sys wants to merge 1 commit into
apache:masterfrom
RH211-sys:add-gamma-function-doc
Open

RH211-sys wants to merge 1 commit into
apache:masterfrom
RH211-sys:add-gamma-function-doc

Conversation

@RH211-sys

Copy link
Copy Markdown

Versions

  • dev
  • 4.x
  • 3.x
  • 2.1 or older (not covered by version/language sync gate)

gamma is a new function on the master branch only, so there is no released version to document yet.

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built
  • Updated required version and language counterparts, or explained why not
  • If only one language changed, confirmed whether source/translation counterparts need sync

Every example block on the page is the real output of the function, captured from a build of the dev
branch, and both language versions are added in this PR, so no counterpart sync is outstanding. The
function itself is covered by the regression test and the BE unit test in the Doris PR.

Summary

Document the gamma scalar function, which is being added to the Doris frontend and backend:

  • docs/sql-manual/sql-functions/scalar-functions/numeric-functions/gamma.md (English)
  • i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/gamma.md (Chinese)
  • the numeric-functions/gamma entry in sidebars.ts

The page covers the definition (gamma(n) is (n - 1)! for a positive integer n, gamma(0.5) is
sqrt(pi)), the special values the implementation produces (NULL at 0, at every negative integer
and at negative infinity; NaN for a NaN input; Infinity for positive infinity and above the double
overflow threshold), and nine examples in both languages. Every example block is the real output of
the function, taken from a build of the dev branch, so the values match what a reader gets,
including the double-precision representation 24.000000000000004 for gamma(5).

## Versions

- [x] dev
- [ ] 4.x
- [ ] 3.x
- [ ] 2.1

## Languages

- [x] Chinese
- [x] English

## Docs Checklist

- [ ] Checked by AI
- [ ] Test Cases Built

## Summary

Document the `gamma` scalar function, which is being added to the Doris
frontend and backend:

- `docs/sql-manual/sql-functions/scalar-functions/numeric-functions/gamma.md` (English)
- `i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/numeric-functions/gamma.md` (Chinese)
- the `numeric-functions/gamma` entry in `sidebars.ts`

The page covers the definition (`gamma(n)` is `(n - 1)!` for a positive integer `n`, `gamma(0.5)`
is `sqrt(pi)`), the special values the implementation produces (NULL at `0`, at every negative
integer and at negative infinity; NaN for a NaN input; Infinity for positive infinity and above
the double overflow threshold), and nine examples in both languages. Every example block is the
real output of the function, taken from a build of the dev branch, so the values match what a
reader gets, including the double-precision representation `24.000000000000004` for `gamma(5)`.

Related Doris PR: added once the Doris pull request is opened; that pull request links back to
this documentation PR.
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.

1 participant