mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Incorporate feedback
This commit is contained in:
parent
652b5e0649
commit
f3bf8388b6
@ -7,28 +7,34 @@ Contains information about normal and aggregate functions.
|
||||
|
||||
Columns:
|
||||
|
||||
- `name`(`String`) – The name of the function.
|
||||
- `is_aggregate`(`UInt8`) — Whether the function is aggregate.
|
||||
- `name` ([String](../../sql-reference/datatypes/string.md)) – The name of the function.
|
||||
- `is_aggregate` ([UInt8](../../sql-reference/datatypes/int-uint.md)) — Whether the function is an aggregate function.
|
||||
- `is_deterministic` ([Nullable](../../sql-reference/data-types/nullable.md)([UInt8](../../sql-reference/data-types/int-uint.md))) - Whether the function is deterministic.
|
||||
- `case_insensitive`, ([UInt8](../../sql-reference/datatypes/int-uint.md)) - Whether the function name can be used case-insensitively.
|
||||
- `alias_to`, ([String](../../sql-reference/datatypes/string.md)) - The original function name, if the function name is an alias.
|
||||
- `create_query`, ([String](../../sql-reference/datatypes/enum.md)) - Unused.
|
||||
- `origin`, ([Enum8](../../sql-reference/datatypes/string.md)) - Unused.
|
||||
- `description`, ([String](../../sql-reference/datatypes/string.md)) - A high-level description what the function does.
|
||||
- `syntax`, ([String](../../sql-reference/datatypes/string.md)) - Signature of the function.
|
||||
- `arguments`, ([String](../../sql-reference/datatypes/string.md)) - What arguments does the function take.
|
||||
- `returned_value`, ([String](../../sql-reference/datatypes/string.md)) - What does the function return.
|
||||
- `examples`, ([String](../../sql-reference/datatypes/string.md)) - Example usage of the function.
|
||||
- `categories`, ([String](../../sql-reference/datatypes/string.md)) - The category of the function.
|
||||
|
||||
**Example**
|
||||
|
||||
```sql
|
||||
SELECT * FROM system.functions LIMIT 10;
|
||||
SELECT name, is_aggregate, is_deterministic, case_insensitive, alias_to FROM system.functions LIMIT 5;
|
||||
```
|
||||
|
||||
```text
|
||||
┌─name──────────────────┬─is_aggregate─┬─case_insensitive─┬─alias_to─┬─create_query─┬─origin─┐
|
||||
│ logTrace │ 0 │ 0 │ │ │ System │
|
||||
│ aes_decrypt_mysql │ 0 │ 0 │ │ │ System │
|
||||
│ aes_encrypt_mysql │ 0 │ 0 │ │ │ System │
|
||||
│ decrypt │ 0 │ 0 │ │ │ System │
|
||||
│ encrypt │ 0 │ 0 │ │ │ System │
|
||||
│ toBool │ 0 │ 0 │ │ │ System │
|
||||
│ windowID │ 0 │ 0 │ │ │ System │
|
||||
│ hopStart │ 0 │ 0 │ │ │ System │
|
||||
│ hop │ 0 │ 0 │ │ │ System │
|
||||
│ snowflakeToDateTime64 │ 0 │ 0 │ │ │ System │
|
||||
└───────────────────────┴──────────────┴──────────────────┴──────────┴──────────────┴────────┘
|
||||
┌─name─────────────────────┬─is_aggregate─┬─is_deterministic─┬─case_insensitive─┬─alias_to─┐
|
||||
│ BLAKE3 │ 0 │ 1 │ 0 │ │
|
||||
│ sipHash128Reference │ 0 │ 1 │ 0 │ │
|
||||
│ mapExtractKeyLike │ 0 │ 1 │ 0 │ │
|
||||
│ sipHash128ReferenceKeyed │ 0 │ 1 │ 0 │ │
|
||||
│ mapPartialSort │ 0 │ 1 │ 0 │ │
|
||||
└──────────────────────────┴──────────────┴──────────────────┴──────────────────┴──────────┘
|
||||
|
||||
10 rows in set. Elapsed: 0.002 sec.
|
||||
5 rows in set. Elapsed: 0.002 sec.
|
||||
```
|
||||
|
@ -16,6 +16,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int DICTIONARIES_WAS_NOT_LOADED;
|
||||
extern const int FUNCTION_NOT_ALLOWED;
|
||||
extern const int NOT_IMPLEMENTED;
|
||||
extern const int SUPPORT_IS_DISABLED;
|
||||
};
|
||||
|
||||
enum class FunctionOrigin : Int8
|
||||
{
|
||||
SYSTEM = 0,
|
||||
@ -134,10 +142,18 @@ void StorageSystemFunctions::fillData(MutableColumns & res_columns, ContextPtr c
|
||||
{
|
||||
is_deterministic = functions_factory.tryGet(function_name, context)->isDeterministic();
|
||||
}
|
||||
catch (...)
|
||||
catch (const Exception & e)
|
||||
{
|
||||
/// Some functions throw because they need special configuration or setup before use.
|
||||
/// Ignore the exception and simply show is_deterministic = NULL.
|
||||
if (e.code() == ErrorCodes::DICTIONARIES_WAS_NOT_LOADED
|
||||
|| e.code() == ErrorCodes::FUNCTION_NOT_ALLOWED
|
||||
|| e.code() == ErrorCodes::NOT_IMPLEMENTED
|
||||
|| e.code() == ErrorCodes::SUPPORT_IS_DISABLED)
|
||||
{
|
||||
/// Ignore exception, show is_deterministic = NULL.
|
||||
}
|
||||
else
|
||||
throw;
|
||||
}
|
||||
|
||||
fillRow(res_columns, function_name, 0, is_deterministic, "", FunctionOrigin::SYSTEM, functions_factory);
|
||||
|
Loading…
Reference in New Issue
Block a user