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

Function registerDataTypeInterval

src/DataTypes/DataTypeInterval.cpp:22–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22void registerDataTypeInterval(DataTypeFactory & factory)
23{
24 factory.registerSimpleDataType("IntervalNanosecond", [] { return DataTypePtr(std::make_shared<DataTypeInterval>(IntervalKind::Kind::Nanosecond)); }, DataTypeFactory::Case::Sensitive,
25 Documentation{
26 .description = "Represents an interval of nanoseconds; used as the result of arithmetic on dates/times. See the `IntervalDay` entry for full documentation.",
27 .syntax = "IntervalNanosecond",
28 .related = {"IntervalDay"},
29 });
30 factory.registerSimpleDataType("IntervalMicrosecond", [] { return DataTypePtr(std::make_shared<DataTypeInterval>(IntervalKind::Kind::Microsecond)); }, DataTypeFactory::Case::Sensitive,
31 Documentation{
32 .description = "Represents an interval of microseconds; used as the result of arithmetic on dates/times. See the `IntervalDay` entry for full documentation.",
33 .syntax = "IntervalMicrosecond",
34 .related = {"IntervalDay"},
35 });
36 factory.registerSimpleDataType("IntervalMillisecond", [] { return DataTypePtr(std::make_shared<DataTypeInterval>(IntervalKind::Kind::Millisecond)); }, DataTypeFactory::Case::Sensitive,
37 Documentation{
38 .description = "Represents an interval of milliseconds; used as the result of arithmetic on dates/times. See the `IntervalDay` entry for full documentation.",
39 .syntax = "IntervalMillisecond",
40 .related = {"IntervalDay"},
41 });
42 factory.registerSimpleDataType("IntervalSecond", [] { return DataTypePtr(std::make_shared<DataTypeInterval>(IntervalKind::Kind::Second)); }, DataTypeFactory::Case::Sensitive,
43 Documentation{
44 .description = "Represents an interval of seconds; used as the result of arithmetic on dates/times. See the `IntervalDay` entry for full documentation.",
45 .syntax = "IntervalSecond",
46 .related = {"IntervalDay"},
47 });
48 factory.registerSimpleDataType("IntervalMinute", [] { return DataTypePtr(std::make_shared<DataTypeInterval>(IntervalKind::Kind::Minute)); }, DataTypeFactory::Case::Sensitive,
49 Documentation{
50 .description = "Represents an interval of minutes; used as the result of arithmetic on dates/times. See the `IntervalDay` entry for full documentation.",
51 .syntax = "IntervalMinute",
52 .related = {"IntervalDay"},
53 });
54 factory.registerSimpleDataType("IntervalHour", [] { return DataTypePtr(std::make_shared<DataTypeInterval>(IntervalKind::Kind::Hour)); }, DataTypeFactory::Case::Sensitive,
55 Documentation{
56 .description = "Represents an interval of hours; used as the result of arithmetic on dates/times. See the `IntervalDay` entry for full documentation.",
57 .syntax = "IntervalHour",
58 .related = {"IntervalDay"},
59 });
60 factory.registerSimpleDataType("IntervalDay", [] { return DataTypePtr(std::make_shared<DataTypeInterval>(IntervalKind::Kind::Day)); }, DataTypeFactory::Case::Sensitive,
61 Documentation{
62 .description = R"DOCS_MD(
63The family of data types representing time and date intervals. The resulting types of the [INTERVAL](/sql-reference/operators#interval) operator.
64
65Structure:
66
67- Time interval as an unsigned integer value.
68- Type of an interval.
69
70Supported interval types:
71
72- `NANOSECOND`
73- `MICROSECOND`
74- `MILLISECOND`
75- `SECOND`
76- `MINUTE`
77- `HOUR`
78- `DAY`
79- `WEEK`

Callers 1

DataTypeFactoryMethod · 0.85

Calls 1

Tested by

no test coverage detected