MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / registerDataTypeNothing

Function registerDataTypeNothing

src/DataTypes/DataTypeNothing.cpp:26–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26void registerDataTypeNothing(DataTypeFactory & factory)
27{
28 factory.registerSimpleDataType("Nothing", [] { return DataTypePtr(std::make_shared<DataTypeNothing>()); }, DataTypeFactory::Case::Sensitive, Documentation{
29 .description = R"DOCS_MD(
30The only purpose of this data type is to represent cases where a value is not expected. So you can't create a `Nothing` type value.
31
32For example, literal [NULL](/sql-reference/syntax#null) has type of `Nullable(Nothing)`. See more about [Nullable](../../../sql-reference/data-types/nullable.md).
33
34The `Nothing` type can also used to denote empty arrays:
35
36```sql
37SELECT toTypeName(array())
38```
39
40```text
41┌─toTypeName(array())─┐
42│ Array(Nothing) │
43└─────────────────────┘
44```
45)DOCS_MD",
46 .syntax = "Nothing",
47 .examples = {},
48 .related = {},
49 });
50}
51
52}

Callers 1

DataTypeFactoryMethod · 0.85

Calls 1

Tested by

no test coverage detected