Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ Returns an integer or a float-point number:

## Example

<!-- setup-sql
CREATE TABLE test_enhanced_round (rid INT, number INT) DISTRIBUTED BY HASH(rid) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_enhanced_round VALUES (1,1);
-->

```sql
select round_bankers(0.4);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ Note that unlike Snowflake's [common usage](https://docs.snowflake.com/en/sql-re

## Example

<!-- setup-sql
CREATE TABLE it (k0 INT) DISTRIBUTED BY HASH(k0) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO it VALUES (NULL),(1),(2),(3),(4),(5);
CREATE TABLE fn_test (ksint INT) DISTRIBUTED BY HASH(ksint) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO fn_test VALUES (1);
-->

When all input parameters are integers, return an integer:

```sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ ROUND_BANKERS(<x> [ , <d>])

## 举例

<!-- setup-sql
CREATE TABLE test_enhanced_round (rid INT, number INT) DISTRIBUTED BY HASH(rid) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_enhanced_round VALUES (1,1);
-->

```sql
select round_bankers(0.4);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ UNIFORM( <min> , <max> , <gen> )

## 举例

<!-- setup-sql
CREATE TABLE it (k0 INT) DISTRIBUTED BY HASH(k0) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO it VALUES (NULL),(1),(2),(3),(4),(5);
CREATE TABLE fn_test (ksint INT) DISTRIBUTED BY HASH(ksint) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO fn_test VALUES (1);
-->

输入参数全为整数时,返回整数:

```sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-section-order

SQL function docs must contain sections in this order%3A Description%2C Syntax%2C Parameters%2C Return Value%2C Example. Missing%3A Example. Owner%3A @zclllyybb

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-title-duplicate

Rendered SEO title is duplicated across indexable pages%3A "ROUND_BANKERS - Apache Doris". Add a version%2C locale%2C or page-specific qualifier. Owner%3A @zclllyybb

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-description-length

SEO description should be 80-160 characters; current length is 28. Owner%3A @zclllyybb
{
"title": "ROUND_BANKERS",
"language": "zh-CN",
Expand Down Expand Up @@ -31,7 +31,7 @@
- 对于数值 3.5,由于 5 前面的数字 3 是奇数,因此结果将舍入为 4。

- 对于数值 2.51,因为 5 后面的数字不是 0,所以直接进位,结果为 3。

Check notice on line 34 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-parameters-table

Parameters section must be a Markdown table with Parameter and Description columns. Owner%3A @zclllyybb
## 语法

```sql
Expand Down Expand Up @@ -59,6 +59,11 @@

## 举例

<!-- setup-sql
CREATE TABLE test_enhanced_round (rid INT, number INT) DISTRIBUTED BY HASH(rid) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_enhanced_round VALUES (1,1);
-->

```sql
select round_bankers(0.4);
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-title-duplicate

Rendered SEO title is duplicated across indexable pages%3A "ROUND_BANKERS - Apache Doris". Add a version%2C locale%2C or page-specific qualifier. Owner%3A @zclllyybb

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-description-length

SEO description should be 80-160 characters; current length is 28. Owner%3A @zclllyybb
{
"title": "ROUND_BANKERS",
"language": "zh-CN",
Expand Down Expand Up @@ -59,6 +59,11 @@

## 举例

<!-- setup-sql
CREATE TABLE test_enhanced_round (rid INT, number INT) DISTRIBUTED BY HASH(rid) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_enhanced_round VALUES (1,1);
-->

```sql
select round_bankers(0.4);
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-title-duplicate

Rendered SEO title is duplicated across indexable pages%3A "ROUND_BANKERS - Apache Doris". Add a version%2C locale%2C or page-specific qualifier. Owner%3A @zclllyybb

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-description-length

SEO description should be 80-160 characters; current length is 28. Owner%3A @zclllyybb
{
"title": "ROUND_BANKERS",
"language": "zh-CN",
Expand Down Expand Up @@ -59,6 +59,11 @@

## 举例

<!-- setup-sql
CREATE TABLE test_enhanced_round (rid INT, number INT) DISTRIBUTED BY HASH(rid) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_enhanced_round VALUES (1,1);
-->

```sql
select round_bankers(0.4);
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/numeric-functions/uniform.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-description-length

SEO description should be 80-160 characters; current length is 27. Owner%3A @zclllyybb
{
"title": "UNIFORM",
"language": "zh-CN",
Expand Down Expand Up @@ -28,10 +28,17 @@

返回在 `[<min>, <max>]` 范围内的随机数。如果 `<min>` 和 `<max>` 均为整数,则返回值类型为 `BIGINT`,否则返回值类型为 `DOUBLE`。

注意与 Snowflake 的[常见用法](https://docs.snowflake.com/en/sql-reference/functions/uniform)不同,由于 Doris 中 RANDOM 的函数返回值默认为 0-1 之间的浮点数,因此如果使用 `RANDOM()` 作为随机种子,应当附加乘数使其结果一个整数范围内分布。详情见示例。

Check notice on line 31 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/numeric-functions/uniform.md

View workflow job for this annotation

GitHub Actions / Build Check

link-external-report-only

External link is report-only and was not fetched%3A https%3A//docs.snowflake.com/en/sql-reference/functions/uniform. Owner%3A @zclllyybb

## 举例

<!-- setup-sql
CREATE TABLE it (k0 INT) DISTRIBUTED BY HASH(k0) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO it VALUES (NULL),(1),(2),(3),(4),(5);
CREATE TABLE fn_test (ksint INT) DISTRIBUTED BY HASH(ksint) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO fn_test VALUES (1);
-->

输入参数全为整数时,返回整数:

```sql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in versioned_docs/version-2.1/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-title-duplicate

Rendered SEO title is duplicated across indexable pages%3A "ROUND_BANKERS - Apache Doris". Add a version%2C locale%2C or page-specific qualifier. Owner%3A @zclllyybb
{
"title": "ROUND_BANKERS",
"language": "en",
Expand Down Expand Up @@ -59,6 +59,11 @@

## Example

<!-- setup-sql
CREATE TABLE test_enhanced_round (rid INT, number INT) DISTRIBUTED BY HASH(rid) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_enhanced_round VALUES (1,1);
-->

```sql
select round_bankers(0.4);
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

i18n-sync-locale-candidate

Japanese docs are report-only. Generate a candidate translation from the changed files and merge it only after human review. Owner%3A @zclllyybb

Check warning on line 1 in versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-title-duplicate

Rendered SEO title is duplicated across indexable pages%3A "ROUND_BANKERS - Apache Doris". Add a version%2C locale%2C or page-specific qualifier. Owner%3A @zclllyybb
{
"title": "ROUND_BANKERS",
"language": "en",
Expand Down Expand Up @@ -59,6 +59,11 @@

## Example

<!-- setup-sql
CREATE TABLE test_enhanced_round (rid INT, number INT) DISTRIBUTED BY HASH(rid) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_enhanced_round VALUES (1,1);
-->

```sql
select round_bankers(0.4);
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

i18n-sync-locale-candidate

Japanese docs are report-only. Generate a candidate translation from the changed files and merge it only after human review. Owner%3A @zclllyybb

Check warning on line 1 in versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/numeric-functions/round-bankers.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-title-duplicate

Rendered SEO title is duplicated across indexable pages%3A "ROUND_BANKERS - Apache Doris". Add a version%2C locale%2C or page-specific qualifier. Owner%3A @zclllyybb
{
"title": "ROUND_BANKERS",
"language": "en",
Expand Down Expand Up @@ -59,6 +59,11 @@

## Example

<!-- setup-sql
CREATE TABLE test_enhanced_round (rid INT, number INT) DISTRIBUTED BY HASH(rid) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO test_enhanced_round VALUES (1,1);
-->

```sql
select round_bankers(0.4);
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/numeric-functions/uniform.md

View workflow job for this annotation

GitHub Actions / Build Check

i18n-sync-locale-candidate

Japanese docs are report-only. Generate a candidate translation from the changed files and merge it only after human review. Owner%3A @zclllyybb
{
"title": "UNIFORM",
"language": "en",
Expand Down Expand Up @@ -28,10 +28,17 @@

Return a random number within `[<min>, <max>]`. If both `<min>` and `<max>` are integers, the return value type is `BIGINT`, otherwise it is `DOUBLE`.

Note that unlike Snowflake's [common usage](https://docs.snowflake.com/en/sql-reference/functions/uniform), because the RANDOM function in Doris returns a floating-point number between 0 and 1 by default, if you use `RANDOM()` as a random seed, you should attach a multiplier to make the result distributed within an integer range. See the examples for details.

Check notice on line 31 in versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/numeric-functions/uniform.md

View workflow job for this annotation

GitHub Actions / Build Check

link-external-report-only

External link is report-only and was not fetched%3A https%3A//docs.snowflake.com/en/sql-reference/functions/uniform. Owner%3A @zclllyybb

## Example

<!-- setup-sql
CREATE TABLE it (k0 INT) DISTRIBUTED BY HASH(k0) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO it VALUES (NULL),(1),(2),(3),(4),(5);
CREATE TABLE fn_test (ksint INT) DISTRIBUTED BY HASH(ksint) BUCKETS 1 PROPERTIES("replication_num"="1");
INSERT INTO fn_test VALUES (1);
-->

When all input parameters are integers, return an integer:

```sql
Expand Down
Loading