mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Undo renaming and make review changes
This commit is contained in:
parent
4c9cc50781
commit
a75151e80b
@ -60,7 +60,7 @@ SELECT groupArray(y) FROM t_null_big
|
||||
|
||||
`groupArray` does not include `NULL` in the resulting array.
|
||||
|
||||
You can use [COALESCE](../../sql-reference/functions/null-functions.md#coalesce) to change NULL into a value that makes sense in your use case. For example: `avg(COALESCE(column, 0))` with use the column value in the aggregation or zero if NULL:
|
||||
You can use [COALESCE](../../sql-reference/functions/functions-for-nulls.md#coalesce) to change NULL into a value that makes sense in your use case. For example: `avg(COALESCE(column, 0))` with use the column value in the aggregation or zero if NULL:
|
||||
|
||||
``` sql
|
||||
SELECT
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
slug: /en/sql-reference/functions/null-functions
|
||||
slug: /en/sql-reference/functions/functions-for-nulls
|
||||
sidebar_position: 135
|
||||
sidebar_label: Nullable
|
||||
---
|
||||
@ -56,7 +56,7 @@ Result:
|
||||
|
||||
## isNullable
|
||||
|
||||
Returns `1` if a column allows null values, `0` otherwise.
|
||||
Returns `1` if a column is [Nullable](../data-types/nullable.md) (i.e allows `NULL` values), `0` otherwise.
|
||||
|
||||
**Syntax**
|
||||
|
||||
@ -78,18 +78,18 @@ isNullable(x)
|
||||
Query:
|
||||
|
||||
``` sql
|
||||
CREATE TABLE example_table (nullable_column Nullable(UInt32), ordinary_column UInt32) ENGINE = Log;
|
||||
INSERT INTO example_table (nullable_column, ordinary_column) VALUES (1,1), (2, 2), (3,3);
|
||||
SELECT isNullable(nullable_column), isNullable(ordinary_column) FROM example_table;
|
||||
CREATE TABLE tab (ordinary_col UInt32, nullable_col Nullable(UInt32)) ENGINE = Log;
|
||||
INSERT INTO tab (ordinary_col, nullable_col) VALUES (1,1), (2, 2), (3,3);
|
||||
SELECT isNullable(ordinary_col), isNullable(nullable_col) FROM tab;
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
``` text
|
||||
┌─isNullable(nullable_column)─┬─isNullable(ordinary_column)─┐
|
||||
1. │ 1 │ 0 │
|
||||
2. │ 1 │ 0 │
|
||||
3. │ 1 │ 0 │
|
||||
┌───isNullable(ordinary_col)──┬───isNullable(nullable_col)──┐
|
||||
1. │ 0 │ 1 │
|
||||
2. │ 0 │ 1 │
|
||||
3. │ 0 │ 1 │
|
||||
└─────────────────────────────┴─────────────────────────────┘
|
||||
```
|
||||
|
||||
@ -144,7 +144,7 @@ This function will consider two `NULL` values as identical and will return `true
|
||||
equals behavior where comparing two `NULL` values would return `NULL`.
|
||||
|
||||
:::note
|
||||
This function can only be used as part of a JOIN ON section of a query. The function is unimplemented for any other use.
|
||||
This function is an internal function used by the implementation of JOIN ON. Please do not use it manually in queries.
|
||||
:::
|
||||
|
||||
**Syntax**
|
@ -15,7 +15,7 @@ If there is a `WHERE` clause, it must contain an expression with the `UInt8` typ
|
||||
There is a filtering optimization called [PREWHERE](../../../sql-reference/statements/select/prewhere.md).
|
||||
:::
|
||||
|
||||
If you need to test a value for [NULL](../../../sql-reference/syntax.md#null-literal), use [IS NULL](../../operators/index.md#operator-is-null) and [IS NOT NULL](../../operators/index.md#is-not-null) operators or [isNull](../../../sql-reference/functions/null-functions.md#isnull) and [isNotNull](../../../sql-reference/functions/null-functions.md#isnotnull) functions.
|
||||
If you need to test a value for [NULL](../../../sql-reference/syntax.md#null-literal), use [IS NULL](../../operators/index.md#operator-is-null) and [IS NOT NULL](../../operators/index.md#is-not-null) operators or [isNull](../../../sql-reference/functions/functions-for-nulls.md#isnull) and [isNotNull](../../../sql-reference/functions/functions-for-nulls.md#isnotnull) functions.
|
||||
Otherwise an expression with `NULL` never passes.
|
||||
|
||||
**Example**
|
||||
|
@ -212,7 +212,7 @@ SELECT nullIf(1, 2);
|
||||
|
||||
## assumeNotNull {#assumenotnull}
|
||||
|
||||
Приводит значение типа [Nullable](../../sql-reference/functions/null-functions.md) к не `Nullable`, если значение не `NULL`.
|
||||
Приводит значение типа [Nullable](../../sql-reference/functions/functions-for-nulls.md) к не `Nullable`, если значение не `NULL`.
|
||||
|
||||
``` sql
|
||||
assumeNotNull(x)
|
||||
|
@ -14,7 +14,7 @@ ClickHouse использует в выражении индексы, если
|
||||
:::note Примечание
|
||||
Существует оптимизация фильтрации под названием [PREWHERE](prewhere.md).
|
||||
:::
|
||||
Если в секции необходимо проверить [NULL](../../../sql-reference/syntax.md#null-literal), то используйте операторы [IS NULL](../../operators/index.md#operator-is-null) и [IS NOT NULL](../../operators/index.md#is-not-null), а также соответствующие функции [isNull](../../../sql-reference/functions/null-functions.md#isnull) и [isNotNull](../../../sql-reference/functions/null-functions.md#isnotnull). В противном случае выражение будет считаться всегда не выполненным.
|
||||
Если в секции необходимо проверить [NULL](../../../sql-reference/syntax.md#null-literal), то используйте операторы [IS NULL](../../operators/index.md#operator-is-null) и [IS NOT NULL](../../operators/index.md#is-not-null), а также соответствующие функции [isNull](../../../sql-reference/functions/functions-for-nulls.md#isnull) и [isNotNull](../../../sql-reference/functions/functions-for-nulls.md#isnotnull). В противном случае выражение будет считаться всегда не выполненным.
|
||||
|
||||
**Пример**
|
||||
|
||||
|
@ -181,7 +181,7 @@ SELECT coalesce(mail, phone, CAST(icq,'Nullable(String)')) FROM aBook
|
||||
|
||||
## assumeNotNull {#assumenotnull}
|
||||
|
||||
将[可为空](../../sql-reference/functions/null-functions.md)类型的值转换为非`Nullable`类型的值。
|
||||
将[可为空](../../sql-reference/functions/functions-for-nulls.md)类型的值转换为非`Nullable`类型的值。
|
||||
|
||||
assumeNotNull(x)
|
||||
|
||||
|
@ -15,7 +15,7 @@ sidebar_label: WHERE
|
||||
有一个叫做过滤优化 [prewhere](../../../sql-reference/statements/select/prewhere.md) 的东西.
|
||||
:::
|
||||
|
||||
如果需要测试一个 [NULL](../../../sql-reference/syntax.md#null-literal) 值,请使用 [IS NULL](../../operators/index.md#operator-is-null) and [IS NOT NULL](../../operators/index.md#is-not-null) 运算符或 [isNull](../../../sql-reference/functions/null-functions.md#isnull) 和 [isNotNull](../../../sql-reference/functions/null-functions.md#isnotnull) 函数。否则带有 NULL 的表达式永远不会通过。
|
||||
如果需要测试一个 [NULL](../../../sql-reference/syntax.md#null-literal) 值,请使用 [IS NULL](../../operators/index.md#operator-is-null) and [IS NOT NULL](../../operators/index.md#is-not-null) 运算符或 [isNull](../../../sql-reference/functions/functions-for-nulls.md#isnull) 和 [isNotNull](../../../sql-reference/functions/functions-for-nulls.md#isnotnull) 函数。否则带有 NULL 的表达式永远不会通过。
|
||||
|
||||
**示例**
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user