Merge branch 'master' of github.com:yandex/ClickHouse into minor-changes-in-debian-scripts

This commit is contained in:
Alexey Milovidov 2020-08-02 01:04:56 +03:00
commit 32e52d1e28
61 changed files with 361 additions and 381 deletions

2
.gitmodules vendored
View File

@ -10,7 +10,7 @@
url = https://github.com/lz4/lz4.git
[submodule "contrib/librdkafka"]
path = contrib/librdkafka
url = https://github.com/edenhill/librdkafka.git
url = https://github.com/ClickHouse-Extras/librdkafka.git
[submodule "contrib/cctz"]
path = contrib/cctz
url = https://github.com/ClickHouse-Extras/cctz.git

2
contrib/librdkafka vendored

@ -1 +1 @@
Subproject commit b0d91bd74abb5f0e1ee972d326a317ad610f6300
Subproject commit 2090cbf56b715247ec2be7f768707a7ab1bf7ede

View File

@ -42,7 +42,8 @@ namespace
AttributeUnderlyingType getAttributeUnderlyingType(const std::string & type)
{
static const std::unordered_map<std::string, AttributeUnderlyingType> dictionary{
static const std::unordered_map<std::string, AttributeUnderlyingType> dictionary
{
{"UInt8", AttributeUnderlyingType::utUInt8},
{"UInt16", AttributeUnderlyingType::utUInt16},
{"UInt32", AttributeUnderlyingType::utUInt32},
@ -56,13 +57,20 @@ AttributeUnderlyingType getAttributeUnderlyingType(const std::string & type)
{"Float64", AttributeUnderlyingType::utFloat64},
{"String", AttributeUnderlyingType::utString},
{"Date", AttributeUnderlyingType::utUInt16},
{"DateTime", AttributeUnderlyingType::utUInt32},
};
const auto it = dictionary.find(type);
if (it != std::end(dictionary))
return it->second;
/// Can contain arbitrary scale and timezone parameters.
if (type.find("DateTime64") == 0)
return AttributeUnderlyingType::utUInt64;
/// Can contain arbitrary timezone as parameter.
if (type.find("DateTime") == 0)
return AttributeUnderlyingType::utUInt32;
if (type.find("Decimal") == 0)
{
size_t start = strlen("Decimal");

View File

@ -664,13 +664,6 @@ inline void writeDateText(const LocalDate & date, WriteBuffer & buf)
template <char delimiter = '-'>
inline void writeDateText(DayNum date, WriteBuffer & buf)
{
if (unlikely(!date))
{
static const char s[] = {'0', '0', '0', '0', delimiter, '0', '0', delimiter, '0', '0'};
buf.write(s, sizeof(s));
return;
}
writeDateText<delimiter>(LocalDate(date), buf);
}
@ -727,18 +720,6 @@ inline void writeDateTimeText(const LocalDateTime & datetime, WriteBuffer & buf)
template <char date_delimeter = '-', char time_delimeter = ':', char between_date_time_delimiter = ' '>
inline void writeDateTimeText(time_t datetime, WriteBuffer & buf, const DateLUTImpl & date_lut = DateLUT::instance())
{
if (unlikely(!datetime))
{
static const char s[] =
{
'0', '0', '0', '0', date_delimeter, '0', '0', date_delimeter, '0', '0',
between_date_time_delimiter,
'0', '0', time_delimeter, '0', '0', time_delimeter, '0', '0'
};
buf.write(s, sizeof(s));
return;
}
const auto & values = date_lut.getValues(datetime);
writeDateTimeText<date_delimeter, time_delimeter, between_date_time_delimiter>(
LocalDateTime(values.year, values.month, values.day_of_month,
@ -751,21 +732,7 @@ inline void writeDateTimeText(DateTime64 datetime64, UInt32 scale, WriteBuffer &
{
static constexpr UInt32 MaxScale = DecimalUtils::maxPrecision<DateTime64>();
scale = scale > MaxScale ? MaxScale : scale;
if (unlikely(!datetime64))
{
static const char s[] =
{
'0', '0', '0', '0', date_delimeter, '0', '0', date_delimeter, '0', '0',
between_date_time_delimiter,
'0', '0', time_delimeter, '0', '0', time_delimeter, '0', '0',
fractional_time_delimiter,
// Exactly MaxScale zeros
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'
};
buf.write(s, sizeof(s) - (MaxScale - scale)
+ (scale == 0 ? -1 : 0)); // if scale is zero, also remove the fractional_time_delimiter.
return;
}
auto c = DecimalUtils::split(datetime64, scale);
const auto & values = date_lut.getValues(c.whole);
writeDateTimeText<date_delimeter, time_delimeter, between_date_time_delimiter>(

View File

@ -138,15 +138,15 @@ TEST_P(DateTimeToStringParamTestDateTime64, writeDateText)
ASSERT_NO_FATAL_FAILURE(test(GetParam()));
}
static const Int32 NON_ZERO_TIME_T = 10 * 365 * 3600 * 24 + 123456;
static const Int32 NON_ZERO_TIME_T = 10 * 365 * 3600 * 24 + 123456; /// NOTE This arithmetic is obviously wrong but it's ok for test.
INSTANTIATE_TEST_SUITE_P(DateTimeToString, DateTimeToStringParamTestDayNum,
::testing::ValuesIn(std::initializer_list<DateTimeToStringParamTestCase<DayNum>>
{
{
"Zero DayNum has special representation of all zeroes despite pointing to 1970-01-01",
"Zero DayNum pointing to 1970-01-01",
DayNum(0),
"0000-00-00"
"1970-01-01"
},
{
"Non-Zero DayNum",
@ -170,9 +170,9 @@ INSTANTIATE_TEST_SUITE_P(DateTimeToString, DateTimeToStringParamTestTimeT,
::testing::ValuesIn(std::initializer_list<DateTimeToStringParamTestCase<time_t>>
{
{
"Zero time_t has special representation of all-zeroes despite pointing to 1970-01-01 00:00:00",
"Zero time_t pointing to 1970-01-01 00:00:00 in UTC",
time_t(0),
"0000-00-00 00:00:00"
"1970-01-01 00:00:00"
},
{
"Non-Zero time_t is a valid date/time",
@ -196,12 +196,12 @@ INSTANTIATE_TEST_SUITE_P(DateTimeToString, DateTimeToStringParamTestDateTime64,
{
"Zero DateTime64 with scale 0 string representation matches one of zero time_t",
DateTime64WithScale{0, 0},
"0000-00-00 00:00:00"
"1970-01-01 00:00:00"
},
{
"Zero DateTime64 with scale 3 string representation matches one of zero time_t with subsecond part",
DateTime64WithScale{0, 3},
"0000-00-00 00:00:00.000"
"1970-01-01 00:00:00.000"
},
{
"Non-Zero DateTime64 with scale 0",

View File

@ -384,7 +384,8 @@ bool ReadBufferFromKafkaConsumer::poll()
{
messages = std::move(new_messages);
current = messages.begin();
LOG_TRACE(log, "Polled batch of {} messages. Offset position: {}", messages.size(), consumer->get_offsets_position(consumer->get_assignment()));
LOG_TRACE(log, "Polled batch of {} messages. Offsets position: {}",
messages.size(), consumer->get_offsets_position(consumer->get_assignment()));
break;
}
}
@ -416,7 +417,7 @@ size_t ReadBufferFromKafkaConsumer::filterMessageErrors()
return false;
});
size_t skipped = std::distance(messages.end(), new_end);
size_t skipped = std::distance(new_end, messages.end());
if (skipped)
{
LOG_ERROR(log, "There were {} messages with an error", skipped);

View File

@ -42,4 +42,4 @@ def test_null_value(started_cluster):
# Check, that empty null_value interprets as default value
assert query("select dictGetUInt64('cache', 'UInt64_', toUInt64(12121212))") == "0\n"
assert query("select dictGetDateTime('cache', 'DateTime_', toUInt64(12121212))") == "0000-00-00 00:00:00\n"
assert query("select toTimeZone(dictGetDateTime('cache', 'DateTime_', toUInt64(12121212)), 'UTC')") == "1970-01-01 00:00:00\n"

View File

@ -1,4 +1,4 @@
0 0 0 0 0000-00-00 0000-00-00 50 13874 980694578 980694579 50 13874 980694578 980694579 0 0 4761183170873013810 2007-12-27 1970-01-02 06:51:14 0
1 1 1 1 1970-01-02 0000-00-00 48 57392 4083802160 4083802161 48 -8144 -211165136 -211165135 1.5 1.5 10577349846663553072 2037-06-02 1970-01-02 09:50:24 0
2 2 2 2 0000-00-00 1970-01-02 69 35909 1447922757 1447922758 69 -29627 1447922757 1447922758 3 3 18198135717204167749 1978-08-08 1970-01-02 03:52:21 1
0 0 0 0 1970-01-01 1970-01-01 50 13874 980694578 980694579 50 13874 980694578 980694579 0 0 4761183170873013810 2007-12-27 1970-01-02 06:51:14 0
1 1 1 1 1970-01-02 1970-01-01 48 57392 4083802160 4083802161 48 -8144 -211165136 -211165135 1.5 1.5 10577349846663553072 2037-06-02 1970-01-02 09:50:24 0
2 2 2 2 1970-01-01 1970-01-02 69 35909 1447922757 1447922758 69 -29627 1447922757 1447922758 3 3 18198135717204167749 1978-08-08 1970-01-02 03:52:21 1
3 3 3 3 1990-01-03 1990-01-03 250 1274 1029309690 1029309691 -6 1274 1029309690 1029309691 4.5 4.5 9624464864560415994 1973-06-28 1970-01-02 03:21:14 2
1 0 0 0 0 0000-00-00 1970-01-01 0000-00-00 1970-01-01 50 13874 980694578 980694579 50 13874 980694578 980694579 0 0 4761183170873013810 2007-12-27 1970-01-02 06:51:14 0
2 1 1 1 1 1970-01-02 1970-01-02 0000-00-00 1970-01-01 48 57392 4083802160 4083802161 48 -8144 -211165136 -211165135 1.5 1.5 10577349846663553072 2037-06-02 1970-01-02 09:50:24 0
3 2 2 2 2 0000-00-00 1970-01-01 1970-01-02 1970-01-02 69 35909 1447922757 1447922758 69 -29627 1447922757 1447922758 3 3 18198135717204167749 1978-08-08 1970-01-02 03:52:21 1
4 3 3 3 3 1990-01-03 1990-01-03 1990-01-03 1990-01-03 250 1274 1029309690 1029309691 -6 1274 1029309690 1029309691 4.5 4.5 9624464864560415994 1973-06-28 1970-01-02 03:21:14 2

View File

@ -33,14 +33,14 @@ def get_last_exception(dictionary_name):
def get_loading_start_time(dictionary_name):
s = instance.query("SELECT loading_start_time FROM system.dictionaries WHERE name='" + dictionary_name + "'").rstrip("\n")
if s == "0000-00-00 00:00:00":
s = instance.query("SELECT toTimeZone(loading_start_time, 'UTC') FROM system.dictionaries WHERE name='" + dictionary_name + "'").rstrip("\n")
if s == "1970-01-01 00:00:00":
return None
return time.strptime(s, "%Y-%m-%d %H:%M:%S")
def get_last_successful_update_time(dictionary_name):
s = instance.query("SELECT last_successful_update_time FROM system.dictionaries WHERE name='" + dictionary_name + "'").rstrip("\n")
if s == "0000-00-00 00:00:00":
s = instance.query("SELECT toTimeZone(last_successful_update_time, 'UTC') FROM system.dictionaries WHERE name='" + dictionary_name + "'").rstrip("\n")
if s == "1970-01-01 00:00:00":
return None
return time.strptime(s, "%Y-%m-%d %H:%M:%S")

View File

@ -65,7 +65,7 @@ def test_insertion_sync(started_cluster):
INSERT INTO distributed_table(val) VALUES (100500)''')
expected = TSV('''
0000-00-00 100500
1970-01-01 100500
2000-01-01 100500
2000-01-01 100500''')
assert TSV(node2.query('SELECT date, val FROM local_table WHERE val = 100500 ORDER BY date')) == expected

View File

@ -213,15 +213,15 @@ def test_mysql_explain(mysql_client, server_address):
-e "EXPLAIN PLAN SELECT 1;"
'''.format(host=server_address, port=server_port), demux=True)
assert code == 0
# EXPLAIN PIPELINE graph=1 SELECT 1
code, (stdout, stderr) = mysql_client.exec_run('''
mysql --protocol tcp -h {host} -P {port} default -u default --password=123
-e "EXPLAIN PIPELINE graph=1 SELECT 1;"
'''.format(host=server_address, port=server_port), demux=True)
assert code == 0
def test_mysql_federated(mysql_server, server_address):
# For some reason it occasionally fails without retries.
retries = 100
@ -455,7 +455,7 @@ def test_types(server_address):
('Float32_NaN_column', float('nan')),
('Float64_Inf_column', float('-inf')),
('Date_column', datetime.date(2019, 12, 8)),
('Date_min_column', '0000-00-00'),
('Date_min_column', datetime.date(1970, 1, 1)),
('Date_after_min_column', datetime.date(1970, 1, 2)),
('DateTime_column', datetime.datetime(2019, 12, 8, 8, 24, 3)),
]

View File

@ -664,7 +664,8 @@ def test_kafka_issue11308(kafka_cluster):
FROM test.kafka;
''')
time.sleep(9)
while int(instance.query('SELECT count() FROM test.persistent_kafka')) < 3:
time.sleep(1)
result = instance.query('SELECT * FROM test.persistent_kafka ORDER BY time;')
@ -1119,7 +1120,7 @@ def test_kafka_virtual_columns(kafka_cluster):
result = ''
while True:
result += instance.query('SELECT _key, key, _topic, value, _offset, _partition, _timestamp FROM test.kafka', ignore_error=True)
result += instance.query('''SELECT _key, key, _topic, value, _offset, _partition, _timestamp = 0 ? '0000-00-00 00:00:00' : toString(_timestamp) AS _timestamp FROM test.kafka''', ignore_error=True)
if kafka_check_result(result, False, 'test_kafka_virtual1.reference'):
break
@ -1138,11 +1139,11 @@ def test_kafka_virtual_columns_with_materialized_view(kafka_cluster):
kafka_group_name = 'virt2',
kafka_format = 'JSONEachRow',
kafka_row_delimiter = '\\n';
CREATE TABLE test.view (key UInt64, value UInt64, kafka_key String, topic String, offset UInt64, partition UInt64, timestamp Nullable(DateTime))
CREATE TABLE test.view (key UInt64, value UInt64, kafka_key String, topic String, offset UInt64, partition UInt64, timestamp Nullable(DateTime('UTC')))
ENGINE = MergeTree()
ORDER BY key;
CREATE MATERIALIZED VIEW test.consumer TO test.view AS
SELECT *, _key as kafka_key, _topic as topic, _offset as offset, _partition as partition, _timestamp as timestamp FROM test.kafka;
SELECT *, _key as kafka_key, _topic as topic, _offset as offset, _partition as partition, _timestamp = 0 ? '0000-00-00 00:00:00' : toString(_timestamp) as timestamp FROM test.kafka;
''')
messages = []
@ -1406,7 +1407,7 @@ def test_kafka_produce_key_timestamp(kafka_cluster):
instance.query('''
DROP TABLE IF EXISTS test.view;
DROP TABLE IF EXISTS test.consumer;
CREATE TABLE test.kafka_writer (key UInt64, value UInt64, _key String, _timestamp DateTime)
CREATE TABLE test.kafka_writer (key UInt64, value UInt64, _key String, _timestamp DateTime('UTC'))
ENGINE = Kafka
SETTINGS kafka_broker_list = 'kafka1:19092',
kafka_topic_list = 'insert3',
@ -1414,7 +1415,7 @@ def test_kafka_produce_key_timestamp(kafka_cluster):
kafka_format = 'TSV',
kafka_row_delimiter = '\\n';
CREATE TABLE test.kafka (key UInt64, value UInt64, inserted_key String, inserted_timestamp DateTime)
CREATE TABLE test.kafka (key UInt64, value UInt64, inserted_key String, inserted_timestamp DateTime('UTC'))
ENGINE = Kafka
SETTINGS kafka_broker_list = 'kafka1:19092',
kafka_topic_list = 'insert3',
@ -1431,7 +1432,8 @@ def test_kafka_produce_key_timestamp(kafka_cluster):
instance.query("INSERT INTO test.kafka_writer VALUES ({},{},'{}',toDateTime({})),({},{},'{}',toDateTime({}))".format(3,3,'k3',1577836803,4,4,'k4',1577836804))
instance.query("INSERT INTO test.kafka_writer VALUES ({},{},'{}',toDateTime({}))".format(5,5,'k5',1577836805))
time.sleep(10)
while int(instance.query("SELECT count() FROM test.view")) < 5:
time.sleep(1)
result = instance.query("SELECT * FROM test.view ORDER BY value", ignore_error=True)
@ -1535,7 +1537,9 @@ def test_kafka_flush_by_block_size(kafka_cluster):
messages.append(json.dumps({'key': 0, 'value': 0}))
kafka_produce('flush_by_block_size', messages)
time.sleep(1)
# Wait for Kafka engine to consume this data
while 1 != int(instance.query("SELECT count() FROM system.parts WHERE database = 'test' AND table = 'view' AND name = 'all_1_1_0'")):
time.sleep(1)
# TODO: due to https://github.com/ClickHouse/ClickHouse/issues/11216
# second flush happens earlier than expected, so we have 2 parts here instead of one
@ -1615,7 +1619,7 @@ def test_kafka_rebalance(kafka_cluster):
_key String,
_offset UInt64,
_partition UInt64,
_timestamp Nullable(DateTime),
_timestamp Nullable(DateTime('UTC')),
_consumed_by LowCardinality(String)
)
ENGINE = MergeTree()
@ -1835,7 +1839,7 @@ def test_commits_of_unprocessed_messages_on_drop(kafka_cluster):
_key String,
_offset UInt64,
_partition UInt64,
_timestamp Nullable(DateTime),
_timestamp Nullable(DateTime('UTC')),
_consumed_by LowCardinality(String)
)
ENGINE = MergeTree()
@ -2033,7 +2037,7 @@ def test_premature_flush_on_eof(kafka_cluster):
_key String,
_offset UInt64,
_partition UInt64,
_timestamp Nullable(DateTime),
_timestamp Nullable(DateTime('UTC')),
_consumed_by LowCardinality(String)
)
ENGINE = MergeTree()

View File

@ -1,50 +1,50 @@
0 virt2 0 0 0 0000-00-00 00:00:00
1 virt2 1 1 0 0000-00-00 00:00:00
2 virt2 2 2 0 0000-00-00 00:00:00
3 virt2 3 3 0 0000-00-00 00:00:00
4 virt2 4 4 0 0000-00-00 00:00:00
5 virt2 5 5 0 0000-00-00 00:00:00
6 virt2 6 6 0 0000-00-00 00:00:00
7 virt2 7 7 0 0000-00-00 00:00:00
8 virt2 8 8 0 0000-00-00 00:00:00
9 virt2 9 9 0 0000-00-00 00:00:00
10 virt2 10 10 0 0000-00-00 00:00:00
11 virt2 11 11 0 0000-00-00 00:00:00
12 virt2 12 12 0 0000-00-00 00:00:00
13 virt2 13 13 0 0000-00-00 00:00:00
14 virt2 14 14 0 0000-00-00 00:00:00
15 virt2 15 15 0 0000-00-00 00:00:00
16 virt2 16 16 0 0000-00-00 00:00:00
17 virt2 17 17 0 0000-00-00 00:00:00
18 virt2 18 18 0 0000-00-00 00:00:00
19 virt2 19 19 0 0000-00-00 00:00:00
20 virt2 20 20 0 0000-00-00 00:00:00
21 virt2 21 21 0 0000-00-00 00:00:00
22 virt2 22 22 0 0000-00-00 00:00:00
23 virt2 23 23 0 0000-00-00 00:00:00
24 virt2 24 24 0 0000-00-00 00:00:00
25 virt2 25 25 0 0000-00-00 00:00:00
26 virt2 26 26 0 0000-00-00 00:00:00
27 virt2 27 27 0 0000-00-00 00:00:00
28 virt2 28 28 0 0000-00-00 00:00:00
29 virt2 29 29 0 0000-00-00 00:00:00
30 virt2 30 30 0 0000-00-00 00:00:00
31 virt2 31 31 0 0000-00-00 00:00:00
32 virt2 32 32 0 0000-00-00 00:00:00
33 virt2 33 33 0 0000-00-00 00:00:00
34 virt2 34 34 0 0000-00-00 00:00:00
35 virt2 35 35 0 0000-00-00 00:00:00
36 virt2 36 36 0 0000-00-00 00:00:00
37 virt2 37 37 0 0000-00-00 00:00:00
38 virt2 38 38 0 0000-00-00 00:00:00
39 virt2 39 39 0 0000-00-00 00:00:00
40 virt2 40 40 0 0000-00-00 00:00:00
41 virt2 41 41 0 0000-00-00 00:00:00
42 virt2 42 42 0 0000-00-00 00:00:00
43 virt2 43 43 0 0000-00-00 00:00:00
44 virt2 44 44 0 0000-00-00 00:00:00
45 virt2 45 45 0 0000-00-00 00:00:00
46 virt2 46 46 0 0000-00-00 00:00:00
47 virt2 47 47 0 0000-00-00 00:00:00
48 virt2 48 48 0 0000-00-00 00:00:00
49 virt2 49 49 0 0000-00-00 00:00:00
0 virt2 0 0 0 1970-01-01 00:00:00
1 virt2 1 1 0 1970-01-01 00:00:00
2 virt2 2 2 0 1970-01-01 00:00:00
3 virt2 3 3 0 1970-01-01 00:00:00
4 virt2 4 4 0 1970-01-01 00:00:00
5 virt2 5 5 0 1970-01-01 00:00:00
6 virt2 6 6 0 1970-01-01 00:00:00
7 virt2 7 7 0 1970-01-01 00:00:00
8 virt2 8 8 0 1970-01-01 00:00:00
9 virt2 9 9 0 1970-01-01 00:00:00
10 virt2 10 10 0 1970-01-01 00:00:00
11 virt2 11 11 0 1970-01-01 00:00:00
12 virt2 12 12 0 1970-01-01 00:00:00
13 virt2 13 13 0 1970-01-01 00:00:00
14 virt2 14 14 0 1970-01-01 00:00:00
15 virt2 15 15 0 1970-01-01 00:00:00
16 virt2 16 16 0 1970-01-01 00:00:00
17 virt2 17 17 0 1970-01-01 00:00:00
18 virt2 18 18 0 1970-01-01 00:00:00
19 virt2 19 19 0 1970-01-01 00:00:00
20 virt2 20 20 0 1970-01-01 00:00:00
21 virt2 21 21 0 1970-01-01 00:00:00
22 virt2 22 22 0 1970-01-01 00:00:00
23 virt2 23 23 0 1970-01-01 00:00:00
24 virt2 24 24 0 1970-01-01 00:00:00
25 virt2 25 25 0 1970-01-01 00:00:00
26 virt2 26 26 0 1970-01-01 00:00:00
27 virt2 27 27 0 1970-01-01 00:00:00
28 virt2 28 28 0 1970-01-01 00:00:00
29 virt2 29 29 0 1970-01-01 00:00:00
30 virt2 30 30 0 1970-01-01 00:00:00
31 virt2 31 31 0 1970-01-01 00:00:00
32 virt2 32 32 0 1970-01-01 00:00:00
33 virt2 33 33 0 1970-01-01 00:00:00
34 virt2 34 34 0 1970-01-01 00:00:00
35 virt2 35 35 0 1970-01-01 00:00:00
36 virt2 36 36 0 1970-01-01 00:00:00
37 virt2 37 37 0 1970-01-01 00:00:00
38 virt2 38 38 0 1970-01-01 00:00:00
39 virt2 39 39 0 1970-01-01 00:00:00
40 virt2 40 40 0 1970-01-01 00:00:00
41 virt2 41 41 0 1970-01-01 00:00:00
42 virt2 42 42 0 1970-01-01 00:00:00
43 virt2 43 43 0 1970-01-01 00:00:00
44 virt2 44 44 0 1970-01-01 00:00:00
45 virt2 45 45 0 1970-01-01 00:00:00
46 virt2 46 46 0 1970-01-01 00:00:00
47 virt2 47 47 0 1970-01-01 00:00:00
48 virt2 48 48 0 1970-01-01 00:00:00
49 virt2 49 49 0 1970-01-01 00:00:00

View File

@ -19,7 +19,7 @@ n.s Array(String)
n.d Array(Date)
CREATE TABLE default.alter_00061\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = MergeTree(d, k, 8192)
2015-01-01 7 39 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03']
2015-01-01 8 40 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 8 40 [1,2,3] ['12','13','14'] ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 10 42 [] [] []
d Date
k UInt64
@ -31,7 +31,7 @@ s String DEFAULT \'0\'
CREATE TABLE default.alter_00061\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date),\n `s` String DEFAULT \'0\'\n)\nENGINE = MergeTree(d, k, 8192)
2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] ['2000-01-01','2000-01-01','2000-01-03'] 100500
2015-01-01 7 39 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03'] 0
2015-01-01 8 40 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00'] 0
2015-01-01 8 40 [1,2,3] ['12','13','14'] ['1970-01-01','1970-01-01','1970-01-01'] 0
2015-01-01 10 42 [] [] [] 0
d Date
k UInt64
@ -52,13 +52,13 @@ n.s Array(String)
s UInt32 DEFAULT \'0\'
n.d Array(Date)
CREATE TABLE default.alter_00061\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\',\n `n.d` Array(Date)\n)\nENGINE = MergeTree(d, k, 8192)
2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] 100500 ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 7 39 [10,20,30] ['120','130','140'] 0 ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 8 40 [1,2,3] ['12','13','14'] 0 ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] 100500 ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 7 39 [10,20,30] ['120','130','140'] 0 ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 8 40 [1,2,3] ['12','13','14'] 0 ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 10 42 [] [] 0 []
2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] 100500 ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 7 39 [10,20,30] ['120','130','140'] 0 ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 8 40 [1,2,3] ['12','13','14'] 0 ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] 100500 ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 7 39 [10,20,30] ['120','130','140'] 0 ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 8 40 [1,2,3] ['12','13','14'] 0 ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 10 42 [] [] 0 []
d Date
k UInt64

View File

@ -10,207 +10,207 @@ CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32
d Date
k UInt64
i32 Int32
dt DateTime
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
dt DateTime(\'UTC\')
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\')\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
dt DateTime(\'UTC\')
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\')\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 9 41 1992-01-01 08:00:00
2015-01-01 10 42 0000-00-00 00:00:00
2015-01-01 10 42 1970-01-01 00:00:00
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14']
2015-01-01 9 41 1992-01-01 08:00:00 [] []
2015-01-01 10 42 0000-00-00 00:00:00 [] []
2015-01-01 10 42 1970-01-01 00:00:00 [] []
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
n.d Array(Date)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
n.d Array(Date)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03']
2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 9 41 1992-01-01 08:00:00 [] [] []
2015-01-01 10 42 0000-00-00 00:00:00 [] [] []
2015-01-01 10 42 1970-01-01 00:00:00 [] [] []
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
n.d Array(Date)
s String DEFAULT \'0\'
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date),\n `s` String DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date),\n `s` String DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
n.d Array(Date)
s String DEFAULT \'0\'
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date),\n `s` String DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `n.d` Array(Date),\n `s` String DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] ['2000-01-01','2000-01-01','2000-01-03'] 100500
2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03'] 0
2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00'] 0
2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['1970-01-01','1970-01-01','1970-01-01'] 0
2015-01-01 9 41 1992-01-01 08:00:00 [] [] [] 0
2015-01-01 10 42 0000-00-00 00:00:00 [] [] [] 0
2015-01-01 10 42 1970-01-01 00:00:00 [] [] [] 0
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
s Int64 DEFAULT \'0\'
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` Int64 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` Int64 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
s Int64 DEFAULT \'0\'
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` Int64 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` Int64 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] 100500
2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] 0
2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 0
2015-01-01 9 41 1992-01-01 08:00:00 [] [] 0
2015-01-01 10 42 0000-00-00 00:00:00 [] [] 0
2015-01-01 10 42 1970-01-01 00:00:00 [] [] 0
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
s UInt32 DEFAULT \'0\'
n.d Array(Date)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\',\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\',\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.ui8 Array(UInt8)
n.s Array(String)
s UInt32 DEFAULT \'0\'
n.d Array(Date)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\',\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] 100500 ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] 0 ['0000-00-00','0000-00-00','0000-00-00']
2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 0 ['0000-00-00','0000-00-00','0000-00-00']
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.ui8` Array(UInt8),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\',\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] 100500 ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] 0 ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 0 ['1970-01-01','1970-01-01','1970-01-01']
2015-01-01 9 41 1992-01-01 08:00:00 [] [] 0 []
2015-01-01 10 42 0000-00-00 00:00:00 [] [] 0 []
2015-01-01 10 42 1970-01-01 00:00:00 [] [] 0 []
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.s Array(String)
s UInt32 DEFAULT \'0\'
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
n.s Array(String)
s UInt32 DEFAULT \'0\'
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `n.s` Array(String),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 13:26:50 ['asd','qwe','qwe'] 100500
2015-01-01 7 39 2014-07-14 13:26:50 ['120','130','140'] 0
2015-01-01 8 40 2012-12-12 12:12:12 ['12','13','14'] 0
2015-01-01 9 41 1992-01-01 08:00:00 [] 0
2015-01-01 10 42 0000-00-00 00:00:00 [] 0
2015-01-01 10 42 1970-01-01 00:00:00 [] 0
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
s UInt32 DEFAULT \'0\'
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
s UInt32 DEFAULT \'0\'
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 13:26:50 100500
2015-01-01 7 39 2014-07-14 13:26:50 0
2015-01-01 8 40 2012-12-12 12:12:12 0
2015-01-01 9 41 1992-01-01 08:00:00 0
2015-01-01 10 42 0000-00-00 00:00:00 0
2015-01-01 10 42 1970-01-01 00:00:00 0
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
s UInt32 DEFAULT \'0\'
n.s Array(String)
n.d Array(Date)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\',\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\',\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
s UInt32 DEFAULT \'0\'
n.s Array(String)
n.d Array(Date)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\',\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\',\n `n.s` Array(String),\n `n.d` Array(Date)\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 13:26:50 100500 [] []
2015-01-01 7 39 2014-07-14 13:26:50 0 [] []
2015-01-01 8 40 2012-12-12 12:12:12 0 [] []
2015-01-01 9 41 1992-01-01 08:00:00 0 [] []
2015-01-01 10 42 0000-00-00 00:00:00 0 [] []
2015-01-01 10 42 1970-01-01 00:00:00 0 [] []
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
s UInt32 DEFAULT \'0\'
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt DateTime
dt DateTime(\'UTC\')
s UInt32 DEFAULT \'0\'
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime,\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` DateTime(\'UTC\'),\n `s` UInt32 DEFAULT \'0\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 13:26:50 100500
2015-01-01 7 39 2014-07-14 13:26:50 0
2015-01-01 8 40 2012-12-12 12:12:12 0
2015-01-01 9 41 1992-01-01 08:00:00 0
2015-01-01 10 42 0000-00-00 00:00:00 0
2015-01-01 10 42 1970-01-01 00:00:00 0
d Date
k UInt64
i32 Int32
dt Date
s DateTime DEFAULT \'0000-00-00 00:00:00\'
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` Date,\n `s` DateTime DEFAULT \'0000-00-00 00:00:00\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
s DateTime(\'UTC\') DEFAULT \'1970-01-01 00:00:00\'
CREATE TABLE test.replicated_alter1\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` Date,\n `s` DateTime(\'UTC\') DEFAULT \'1970-01-01 00:00:00\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r1\', d, k, 8192)
d Date
k UInt64
i32 Int32
dt Date
s DateTime DEFAULT \'0000-00-00 00:00:00\'
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` Date,\n `s` DateTime DEFAULT \'0000-00-00 00:00:00\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 1970-01-02 06:55:00
2015-01-01 7 39 2014-07-14 0000-00-00 00:00:00
2015-01-01 8 40 2012-12-12 0000-00-00 00:00:00
2015-01-01 9 41 1992-01-01 0000-00-00 00:00:00
2015-01-01 10 42 0000-00-00 0000-00-00 00:00:00
s DateTime(\'UTC\') DEFAULT \'1970-01-01 00:00:00\'
CREATE TABLE test.replicated_alter2\n(\n `d` Date,\n `k` UInt64,\n `i32` Int32,\n `dt` Date,\n `s` DateTime(\'UTC\') DEFAULT \'1970-01-01 00:00:00\'\n)\nENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/alter\', \'r2\', d, k, 8192)
2015-01-01 6 38 2014-07-15 1970-01-02 03:55:00
2015-01-01 7 39 2014-07-14 1970-01-01 00:00:00
2015-01-01 8 40 2012-12-12 1970-01-01 00:00:00
2015-01-01 9 41 1992-01-01 1970-01-01 00:00:00
2015-01-01 10 42 1970-01-01 1970-01-01 00:00:00

View File

@ -14,7 +14,7 @@ DESC TABLE test.replicated_alter2;
SHOW CREATE TABLE test.replicated_alter2;
SELECT * FROM test.replicated_alter1 ORDER BY k;
ALTER TABLE test.replicated_alter1 ADD COLUMN dt DateTime;
ALTER TABLE test.replicated_alter1 ADD COLUMN dt DateTime('UTC');
INSERT INTO test.replicated_alter1 VALUES ('2015-01-01', 9, 41, '1992-01-01 08:00:00');
DESC TABLE test.replicated_alter1;
@ -98,7 +98,7 @@ DESC TABLE test.replicated_alter2;
SHOW CREATE TABLE test.replicated_alter2;
SELECT * FROM test.replicated_alter1 ORDER BY k;
ALTER TABLE test.replicated_alter1 MODIFY COLUMN dt Date, MODIFY COLUMN s DateTime DEFAULT '0000-00-00 00:00:00';
ALTER TABLE test.replicated_alter1 MODIFY COLUMN dt Date, MODIFY COLUMN s DateTime('UTC') DEFAULT '1970-01-01 00:00:00';
DESC TABLE test.replicated_alter1;
SHOW CREATE TABLE test.replicated_alter1;

View File

@ -1,5 +1,5 @@
2014-01-02 0 0 0000-00-00 00:00:00 2014-01-02 03:04:06
1 2014-01-02 03:04:06
2014-01-02 0 0 1970-01-01 03:00:00 2014-01-02 03:04:06
1 2014-01-02 07:04:06
0
0
0

View File

@ -6,8 +6,8 @@ DROP TABLE IF EXISTS test_table;
DROP TABLE IF EXISTS test_view;
DROP TABLE IF EXISTS test_view_filtered;
CREATE TABLE test_table (EventDate Date, CounterID UInt32, UserID UInt64, EventTime DateTime, UTCEventTime DateTime) ENGINE = MergeTree(EventDate, CounterID, 8192);
CREATE MATERIALIZED VIEW test_view (Rows UInt64, MaxHitTime DateTime) ENGINE = Memory AS SELECT count() AS Rows, max(UTCEventTime) AS MaxHitTime FROM test_table;
CREATE TABLE test_table (EventDate Date, CounterID UInt32, UserID UInt64, EventTime DateTime('Europe/Moscow'), UTCEventTime DateTime('UTC')) ENGINE = MergeTree(EventDate, CounterID, 8192);
CREATE MATERIALIZED VIEW test_view (Rows UInt64, MaxHitTime DateTime('Europe/Moscow')) ENGINE = Memory AS SELECT count() AS Rows, max(UTCEventTime) AS MaxHitTime FROM test_table;
CREATE MATERIALIZED VIEW test_view_filtered (EventDate Date, CounterID UInt32) ENGINE = Memory POPULATE AS SELECT CounterID, EventDate FROM test_table WHERE EventDate < '2013-01-01';
INSERT INTO test_table (EventDate, UTCEventTime) VALUES ('2014-01-02', '2014-01-02 03:04:06');

View File

@ -1,14 +1,14 @@
[1,2]
[0]
[4,5,6]
[''] ['0000-00-00'] ['0000-00-00 00:00:00']
[0] [''] ['0000-00-00 00:00:00'] ['0000-00-00']
[''] ['1970-01-01'] ['1970-01-01 03:00:00']
[0] [''] ['1970-01-01 00:00:00'] ['1970-01-01']
[0] ['0'] ['2015-01-01 00:00:00'] ['2015-01-01']
[0,1] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01'] ['2015-01-01','2015-01-02']
[0] ['0'] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02'] ['2015-01-01','2015-01-02','2015-01-03']
[0] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02','2015-01-01 00:00:03'] ['0000-00-00']
[0,1] ['0'] ['0000-00-00 00:00:00'] ['2015-01-01']
[0] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02','2015-01-01 00:00:03'] ['1970-01-01']
[0,1] ['0'] ['1970-01-01 00:00:00'] ['2015-01-01']
[0] [''] ['2015-01-01 00:00:00'] ['2015-01-01','2015-01-02']
[0] ['0'] ['2015-01-01 00:00:00','2015-01-01 00:00:01'] ['2015-01-01','2015-01-02','2015-01-03']
[0,1] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02'] ['0000-00-00']
[0,1] [''] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02'] ['1970-01-01']
[0] ['0'] ['2015-01-01 00:00:00','2015-01-01 00:00:01','2015-01-01 00:00:02','2015-01-01 00:00:03'] ['2015-01-01']

View File

@ -1,8 +1,8 @@
SELECT emptyArrayToSingle(arrayFilter(x -> x != 99, arrayJoin([[1, 2], [99], [4, 5, 6]])));
SELECT emptyArrayToSingle(emptyArrayString()), emptyArrayToSingle(emptyArrayDate()), emptyArrayToSingle(emptyArrayDateTime());
SELECT
emptyArrayToSingle(range(number % 3)),
emptyArrayToSingle(arrayMap(x -> toString(x), range(number % 2))),
emptyArrayToSingle(arrayMap(x -> toDateTime('2015-01-01 00:00:00') + x, range(number % 5))),
SELECT
emptyArrayToSingle(range(number % 3)),
emptyArrayToSingle(arrayMap(x -> toString(x), range(number % 2))),
emptyArrayToSingle(arrayMap(x -> toDateTime('2015-01-01 00:00:00', 'UTC') + x, range(number % 5))),
emptyArrayToSingle(arrayMap(x -> toDate('2015-01-01') + x, range(number % 4))) FROM system.numbers LIMIT 10;

View File

@ -1,5 +1,5 @@
-- Ensure ALIAS columns are not selected by asterisk
0000-00-00 0 ['zero','one','two'] ['zero','one','two'] ['zero','one','two']
1970-01-01 0 ['zero','one','two'] ['zero','one','two'] ['zero','one','two']
-- select DEFAULT and ALIAS arrays
['zero','one','two'] ['zero','one','two'] ['zero','one','two'] ['zero','one','two'] ['0','1','2'] ['0','1','2'] ['0','1','2']
-- select DEFAULT and ALIAS nested columns

View File

@ -1,5 +1,5 @@
0000-00-00 00:00:00
0000-00-00 00:00:00
0000-00-00 00:00:00 Hello, world abc
1970-01-01 00:00:00
1970-01-01 00:00:00
1970-01-01 00:00:00 Hello, world abc
custom-service-log 2013-01-01 00:00:00 +0400 multiline\ntext can contain \0 symbol
0000-00-00 00:00:00 def
1970-01-01 00:00:00 def

View File

@ -4,7 +4,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS tskv";
$CLICKHOUSE_CLIENT --query="CREATE TABLE tskv (tskv_format String, timestamp DateTime, timezone String, text String, binary_data String) ENGINE = Memory";
$CLICKHOUSE_CLIENT --query="CREATE TABLE tskv (tskv_format String, timestamp DateTime('UTC'), timezone String, text String, binary_data String) ENGINE = Memory";
echo -n 'tskv tskv_format=custom-service-log timestamp=2013-01-01 00:00:00 timezone=+0400 text=multiline\ntext binary_data=can contain \0 symbol
binary_data=abc text=Hello, world

View File

@ -1 +1 @@
[] [] (0,'','0000-00-00 00:00:00','0000-00-00')
[] [] (0,'','1970-01-01 00:00:00','1970-01-01')

View File

@ -1 +1 @@
SELECT defaultValueOfArgumentType([1, 2, 3]), defaultValueOfArgumentType([[[1]]]), defaultValueOfArgumentType((1, 'Hello', now(), today()));
SELECT defaultValueOfArgumentType([1, 2, 3]), defaultValueOfArgumentType([[[1]]]), defaultValueOfArgumentType((1, 'Hello', toTimeZone(now(), 'UTC'), today()));

View File

@ -1,7 +1,7 @@
1 [['Hello','World'],['Goodbye'],[]]
1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'0000-00-00'))
1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'1970-01-01'))
0 [] ('Hello',['World',NULL],(123,'2000-01-01'))
1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'0000-00-00'))
1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'1970-01-01'))
0 [] ('Hello',['World',NULL],(123,'2000-01-01'))
1 [['Hello','World'],['Goodbye'],[]] ('Hello',['World',NULL],(123,'2000-01-01'))
1 [['Hello','World'],['Goodbye'],[]] ('Hello',['World',NULL],(123,'2000-01-01'))

View File

@ -1,4 +1,4 @@
0000-00-00 00:00:00
1970-01-01 00:00:00
0
0

View File

@ -9,7 +9,7 @@ $CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS Nullable)" 2>/dev/null || true;
$CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS Tuple)" 2>/dev/null || true;
$CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS FixedString)" 2>/dev/null || true;
$CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS Enum)" 2>/dev/null || true;
$CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS DateTime)";
$CLICKHOUSE_CLIENT --query="SELECT CAST(0 AS DateTime('UTC'))";
echo

View File

@ -13,12 +13,12 @@
11 Feb 2018 06:40:50 +0300 2018-02-11 03:40:50 2018-02-11 03:40:50
17 Apr 2 1:2:3 2000-04-17 01:02:03 2000-04-17 01:02:03
19700102 01:00:00 1970-01-02 01:00:00 1970-01-02 01:00:00
1970010201:00:00 ᴺᵁᴸᴸ 0000-00-00 00:00:00
1970010201:00:00 ᴺᵁᴸᴸ 1970-01-01 00:00:00
19700102010203 1970-01-02 01:02:03 1970-01-02 01:02:03
19700102010203Z 1970-01-02 01:02:03 1970-01-02 01:02:03
1970/01/02 010203Z 1970-01-02 01:02:03 1970-01-02 01:02:03
20 2000-01-20 00:00:00 2000-01-20 00:00:00
201 ᴺᵁᴸᴸ 0000-00-00 00:00:00
201 ᴺᵁᴸᴸ 1970-01-01 00:00:00
20160101 2016-01-01 00:00:00 2016-01-01 00:00:00
2016-01-01 2016-01-01 00:00:00 2016-01-01 00:00:00
201601-01 2016-01-01 01:00:00 2016-01-01 01:00:00
@ -34,7 +34,7 @@
2017/01/01 2017-01-01 00:00:00 2017-01-01 00:00:00
201701 02 010203 UTC+0300 2017-01-01 22:02:03 2017-01-01 22:02:03
2017-01-02 03:04:05 2017-01-02 03:04:05 2017-01-02 03:04:05
2017-01-0203:04:05 ᴺᵁᴸᴸ 0000-00-00 00:00:00
2017-01-0203:04:05 ᴺᵁᴸᴸ 1970-01-01 00:00:00
2017-01-02 03:04:05+0 2017-01-02 03:04:05 2017-01-02 03:04:05
2017-01-02 03:04:05+00 2017-01-02 03:04:05 2017-01-02 03:04:05
2017-01-02 03:04:05+0000 2017-01-02 03:04:05 2017-01-02 03:04:05
@ -58,13 +58,13 @@
2017-01 03:04:05 MSD Jun 2017-05-31 23:04:05 2017-05-31 23:04:05
2017-01 03:04 MSD Jun 2017-05-31 23:04:00 2017-05-31 23:04:00
2017/01/31 2017-01-31 00:00:00 2017-01-31 00:00:00
2017/01/32 ᴺᵁᴸᴸ 0000-00-00 00:00:00
2017/01/32 ᴺᵁᴸᴸ 1970-01-01 00:00:00
2017-01 MSD Jun 2017-05-31 20:00:00 2017-05-31 20:00:00
201701 MSD Jun 2017-05-31 20:00:00 2017-05-31 20:00:00
2017 25 1:2:3 ᴺᵁᴸᴸ 0000-00-00 00:00:00
2017 25 1:2:3 ᴺᵁᴸᴸ 1970-01-01 00:00:00
2017 25 Apr 1:2:3 2017-04-01 01:02:03 2017-04-01 01:02:03
2017 Apr 01 11:22:33 2017-04-01 11:22:33 2017-04-01 11:22:33
2017 Apr 02 01/02/03 UTC+0300 ᴺᵁᴸᴸ 0000-00-00 00:00:00
2017 Apr 02 01/02/03 UTC+0300 ᴺᵁᴸᴸ 1970-01-01 00:00:00
2017 Apr 02 010203 UTC+0300 2017-04-01 22:02:03 2017-04-01 22:02:03
2017 Apr 02 01:2:3 UTC+0300 2017-04-01 22:02:03 2017-04-01 22:02:03
2017 Apr 02 1:02:3 2017-04-02 01:02:03 2017-04-02 01:02:03
@ -74,8 +74,8 @@
2017 Apr 02 1:2:3 2017-04-02 01:02:03 2017-04-02 01:02:03
2017 Apr 02 1:2:33 2017-04-02 01:02:33 2017-04-02 01:02:33
2017 Apr 02 1:2:3 MSK 2017-04-01 22:02:03 2017-04-01 22:02:03
2017 Apr 02 1:2:3 MSK 2017 ᴺᵁᴸᴸ 0000-00-00 00:00:00
2017 Apr 02 1:2:3 MSK 2018 ᴺᵁᴸᴸ 0000-00-00 00:00:00
2017 Apr 02 1:2:3 MSK 2017 ᴺᵁᴸᴸ 1970-01-01 00:00:00
2017 Apr 02 1:2:3 MSK 2018 ᴺᵁᴸᴸ 1970-01-01 00:00:00
2017 Apr 02 1:2:3 UTC+0000 2017-04-02 01:02:03 2017-04-02 01:02:03
2017 Apr 02 1:2:3 UTC+0300 2017-04-01 22:02:03 2017-04-01 22:02:03
2017 Apr 02 1:2:3 UTC+0400 2017-04-01 21:02:03 2017-04-01 21:02:03
@ -90,17 +90,17 @@
25 Jan 2017 1:2:3 Z 2017-01-25 01:02:03 2017-01-25 01:02:03
25 Jan 2017 1:2:3 Z +0300 2017-01-24 22:02:03 2017-01-24 22:02:03
25 Jan 2017 1:2:3 Z+03:00 2017-01-24 22:02:03 2017-01-24 22:02:03
25 Jan 2017 1:2:3 Z +0300 OM ᴺᵁᴸᴸ 0000-00-00 00:00:00
25 Jan 2017 1:2:3 Z +0300 OM ᴺᵁᴸᴸ 1970-01-01 00:00:00
25 Jan 2017 1:2:3 Z +03:00 PM 2017-01-25 10:02:03 2017-01-25 10:02:03
25 Jan 2017 1:2:3 Z +0300 PM 2017-01-25 10:02:03 2017-01-25 10:02:03
25 Jan 2017 1:2:3 Z+03:00 PM 2017-01-25 10:02:03 2017-01-25 10:02:03
25 Jan 2017 1:2:3 Z +03:30 PM 2017-01-25 09:32:03 2017-01-25 09:32:03
25 Jan 2017 1:2:3Z Mo ᴺᵁᴸᴸ 0000-00-00 00:00:00
25 Jan 2017 1:2:3Z Mo ᴺᵁᴸᴸ 1970-01-01 00:00:00
25 Jan 2017 1:2:3Z Mon 2017-01-25 01:02:03 2017-01-25 01:02:03
25 Jan 2017 1:2:3Z Moo ᴺᵁᴸᴸ 0000-00-00 00:00:00
25 Jan 2017 1:2:3Z Moo ᴺᵁᴸᴸ 1970-01-01 00:00:00
25 Jan 2017 1:2:3 Z PM 2017-01-25 13:02:03 2017-01-25 13:02:03
25 Jan 2017 1:2:3Z PM 2017-01-25 13:02:03 2017-01-25 13:02:03
25 Jan 2017 1:2:3 Z PM +03:00 2017-01-25 10:02:03 2017-01-25 10:02:03
Jun, 11 Feb 2018 06:40:50 +0300 ᴺᵁᴸᴸ 0000-00-00 00:00:00
Jun, 11 Feb 2018 06:40:50 +0300 ᴺᵁᴸᴸ 1970-01-01 00:00:00
Sun 11 Feb 2018 06:40:50 +0300 2018-02-11 03:40:50 2018-02-11 03:40:50
Sun, 11 Feb 2018 06:40:50 +0300 2018-02-11 03:40:50 2018-02-11 03:40:50

View File

@ -21,14 +21,14 @@ abc
123
123a
-123
0000-00-00
0000-00-00
1970-01-01
1970-01-01
2018-01-02
2018-01-02
2018-01-02
2018-01-02
0000-00-00
0000-00-00
1970-01-01
1970-01-01
\N
\N
2018-01-02
@ -37,11 +37,11 @@ abc
2018-01-02
\N
\N
0000-00-00 00:00:00
0000-00-00 00:00:00
1970-01-01 00:00:00
1970-01-01 00:00:00
2018-01-02 01:02:03
2018-01-02 01:02:03
0000-00-00 00:00:00
1970-01-01 00:00:00
\N
\N
2018-01-02 01:02:03

View File

@ -6,6 +6,6 @@ SELECT CAST(arrayJoin(['', 'abc', '123', '123a', '-123']) AS Nullable(String));
SELECT toDateOrZero(arrayJoin(['', '2018', '2018-01-02', '2018-1-2', '2018-01-2', '2018-1-02', '2018-ab-cd', '2018-01-02a']));
SELECT toDateOrNull(arrayJoin(['', '2018', '2018-01-02', '2018-1-2', '2018-01-2', '2018-1-02', '2018-ab-cd', '2018-01-02a']));
SELECT toDateTimeOrZero(arrayJoin(['', '2018', '2018-01-02 01:02:03', '2018-01-02T01:02:03', '2018-01-02 01:02:03 abc']));
SELECT toDateTimeOrZero(arrayJoin(['', '2018', '2018-01-02 01:02:03', '2018-01-02T01:02:03', '2018-01-02 01:02:03 abc']), 'UTC');
SELECT toDateTimeOrNull(arrayJoin(['', '2018', '2018-01-02 01:02:03', '2018-01-02T01:02:03', '2018-01-02 01:02:03 abc']));

View File

@ -2,7 +2,7 @@
1
1
1
t_00693 Memory 1 [] 0000-00-00 00:00:00 [] [] Memory \N \N
t_00693 Memory 1 [] 1970-01-01 00:00:00 [] [] Memory \N \N
1
1
1

View File

@ -5,7 +5,7 @@ SELECT (SELECT count() FROM system.tables SETTINGS max_block_size = 100) = (SELE
DROP TEMPORARY TABLE IF EXISTS t_00693;
CREATE TEMPORARY TABLE t_00693 (x UInt8);
SELECT database, name, engine, is_temporary, data_paths, metadata_path, metadata_modification_time, dependencies_database,
SELECT database, name, engine, is_temporary, data_paths, metadata_path, toTimeZone(metadata_modification_time, 'UTC'), dependencies_database,
dependencies_table, create_table_query, engine_full, partition_key, sorting_key, primary_key, sampling_key, storage_policy,
total_rows, total_bytes FROM system.tables WHERE is_temporary AND name='t_00693';

View File

@ -87,10 +87,10 @@ value vs value
0 1 1 UInt64 UInt32 UInt64
0 1 1 UInt64 UInt64 UInt64
0 1 1 UInt64 Decimal(38, 0) Decimal(38, 0)
0000-00-00 1970-01-02 1970-01-02 Date Date Date
1970-01-01 1970-01-02 1970-01-02 Date Date Date
2000-01-01 2000-01-01 00:00:01 2000-01-01 00:00:01 Date DateTime(\'Europe/Moscow\') DateTime
2000-01-01 00:00:00 2000-01-02 2000-01-02 00:00:00 DateTime(\'Europe/Moscow\') Date DateTime
0000-00-00 00:00:00 1970-01-01 03:00:01 1970-01-01 03:00:01 DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\')
1970-01-01 03:00:00 1970-01-01 03:00:01 1970-01-01 03:00:01 DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\')
00000000-0000-0000-0000-000000000000 00000000-0000-0001-0000-000000000000 00000000-0000-0001-0000-000000000000 UUID UUID UUID
column vs value
0 1 1 Int8 Int8 Int8
@ -161,8 +161,8 @@ column vs value
0 1 1 UInt64 UInt16 UInt64
0 1 1 UInt64 UInt32 UInt64
0 1 1 UInt64 UInt64 UInt64
0000-00-00 1970-01-02 1970-01-02 Date Date Date
1970-01-01 1970-01-02 1970-01-02 Date Date Date
2000-01-01 2000-01-01 00:00:01 2000-01-01 00:00:01 Date DateTime(\'Europe/Moscow\') DateTime
2000-01-01 00:00:00 2000-01-02 2000-01-02 00:00:00 DateTime(\'Europe/Moscow\') Date DateTime
0000-00-00 00:00:00 1970-01-01 03:00:01 1970-01-01 03:00:01 DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\')
1970-01-01 03:00:00 1970-01-01 03:00:01 1970-01-01 03:00:01 DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\') DateTime(\'Europe/Moscow\')
00000000-0000-0000-0000-000000000000 00000000-0000-0001-0000-000000000000 00000000-0000-0001-0000-000000000000 UUID UUID UUID

View File

@ -1,5 +1,5 @@
"2","0000-00-00 00:00:00","0000-00-00 00:00:00"
"4","0000-00-00 00:00:00","0000-00-00 00:00:00"
"2","1970-01-01 00:00:00","1970-01-01 00:00:00"
"4","1970-01-01 00:00:00","1970-01-01 00:00:00"
"2016-01-01 00:00:00","2016-01-01 00:00:00","2016-01-01 02:00:00"
"2016-01-02 00:00:00","2016-01-02 01:00:00","2016-01-02 23:00:00"
"2016-01-03 00:00:00","2016-01-03 04:00:00","2016-01-03 04:00:00"

View File

@ -3,20 +3,20 @@ DROP TABLE IF EXISTS datetime_table;
-- Create a table with DateTime column, but not used in partition key
CREATE TABLE datetime_table
(
t DateTime,
t DateTime('UTC'),
name String,
value UInt32
) ENGINE = MergeTree()
ORDER BY (t, name)
PARTITION BY value;
INSERT INTO datetime_table VALUES (toDateTime('2016-01-01 00:00:00'),'name1',2);
INSERT INTO datetime_table VALUES (toDateTime('2016-01-02 00:00:00'),'name2',2);
INSERT INTO datetime_table VALUES (toDateTime('2016-01-03 00:00:00'),'name1',4);
INSERT INTO datetime_table VALUES ('2016-01-01 00:00:00','name1',2);
INSERT INTO datetime_table VALUES ('2016-01-02 00:00:00','name2',2);
INSERT INTO datetime_table VALUES ('2016-01-03 00:00:00','name1',4);
-- min_time and max_time are not filled
SELECT partition, MIN(min_time) as min_time, MAX(max_time) as max_time
SELECT partition, toTimeZone(MIN(min_time), 'UTC') as min_time, toTimeZone(MAX(max_time), 'UTC') as max_time
FROM system.parts
WHERE database = currentDatabase() and table = 'datetime_table' AND active = 1
GROUP BY partition
@ -28,22 +28,22 @@ DROP TABLE IF EXISTS datetime_table;
-- Create a table with DateTime column, this time used in partition key
CREATE TABLE datetime_table
(
t DateTime,
t DateTime('UTC'),
name String,
value UInt32
) ENGINE = MergeTree()
ORDER BY (t, name)
PARTITION BY toStartOfDay(t);
INSERT INTO datetime_table VALUES (toDateTime('2016-01-01 00:00:00'),'name1',2);
INSERT INTO datetime_table VALUES (toDateTime('2016-01-01 02:00:00'),'name1',3);
INSERT INTO datetime_table VALUES (toDateTime('2016-01-02 01:00:00'),'name2',2);
INSERT INTO datetime_table VALUES (toDateTime('2016-01-02 23:00:00'),'name2',5);
INSERT INTO datetime_table VALUES (toDateTime('2016-01-03 04:00:00'),'name1',4);
INSERT INTO datetime_table VALUES ('2016-01-01 00:00:00','name1',2);
INSERT INTO datetime_table VALUES ('2016-01-01 02:00:00','name1',3);
INSERT INTO datetime_table VALUES ('2016-01-02 01:00:00','name2',2);
INSERT INTO datetime_table VALUES ('2016-01-02 23:00:00','name2',5);
INSERT INTO datetime_table VALUES ('2016-01-03 04:00:00','name1',4);
-- min_time and max_time are now filled
SELECT partition, MIN(min_time) as min_time, MAX(max_time) as max_time
SELECT partition, toTimeZone(MIN(min_time), 'UTC') as min_time, toTimeZone(MAX(max_time), 'UTC') as max_time
FROM system.parts
WHERE database = currentDatabase() and table = 'datetime_table' AND active = 1
GROUP BY partition
@ -55,7 +55,7 @@ DROP TABLE IF EXISTS datetime_table;
-- Create a table with DateTime column, this time used in partition key, but not at the first level
CREATE TABLE datetime_table
(
t DateTime,
t DateTime('UTC'),
name String,
value UInt32
) ENGINE = MergeTree()

View File

@ -9,7 +9,7 @@
│ D │ d │ 2018-01-01 │ D │ 2018-01-01 │
└───┴───┴────────────┴───┴────────────┘
┌─a─┬──────────b─┬─c─┬──────────d─┐
│ a │ 2018-01-01 │ │ 0000-00-00
│ a │ 2018-01-01 │ │ 1970-01-01
│ b │ 2018-01-01 │ B │ 2018-01-01 │
│ c │ 2018-01-01 │ C │ 2018-01-01 │
└───┴────────────┴───┴────────────┘

View File

@ -1,18 +1,18 @@
1 1970-01-01 00:00:01 1 0 0000-00-00 00:00:00 0
1 1970-01-01 00:00:01 1 0 1970-01-01 00:00:00 0
1 1970-01-01 00:00:02 2 2 1970-01-01 00:00:02 1
1 1970-01-01 00:00:03 3 2 1970-01-01 00:00:02 1
1 1970-01-01 00:00:04 4 4 1970-01-01 00:00:04 1
1 1970-01-01 00:00:05 5 4 1970-01-01 00:00:04 1
2 1970-01-01 00:00:01 1 0 0000-00-00 00:00:00 0
2 1970-01-01 00:00:02 2 0 0000-00-00 00:00:00 0
2 1970-01-01 00:00:01 1 0 1970-01-01 00:00:00 0
2 1970-01-01 00:00:02 2 0 1970-01-01 00:00:00 0
2 1970-01-01 00:00:03 3 3 1970-01-01 00:00:03 2
2 1970-01-01 00:00:04 4 3 1970-01-01 00:00:03 2
2 1970-01-01 00:00:05 5 3 1970-01-01 00:00:03 2
3 1970-01-01 00:00:01 1 0 0000-00-00 00:00:00 0
3 1970-01-01 00:00:02 2 0 0000-00-00 00:00:00 0
3 1970-01-01 00:00:03 3 0 0000-00-00 00:00:00 0
3 1970-01-01 00:00:04 4 0 0000-00-00 00:00:00 0
3 1970-01-01 00:00:05 5 0 0000-00-00 00:00:00 0
3 1970-01-01 00:00:01 1 0 1970-01-01 00:00:00 0
3 1970-01-01 00:00:02 2 0 1970-01-01 00:00:00 0
3 1970-01-01 00:00:03 3 0 1970-01-01 00:00:00 0
3 1970-01-01 00:00:04 4 0 1970-01-01 00:00:00 0
3 1970-01-01 00:00:05 5 0 1970-01-01 00:00:00 0
1 1970-01-01 00:00:02 2 2 1970-01-01 00:00:02 1
1 1970-01-01 00:00:03 3 2 1970-01-01 00:00:02 1
1 1970-01-01 00:00:04 4 4 1970-01-01 00:00:04 1

View File

@ -1,4 +1,4 @@
0000-00-00 1 1970
1970-01-01 1 1970
1970-01-02 1 1970
1970-01-03 1 1970
1970-01-04 1 1970

View File

@ -5,7 +5,7 @@ n: "456", s1: as"df\'gh, s2: '', s3: "zx\ncv\tbn m", s4: "qwe,rty", d: 2016-01-0
n: "789", s1: zx\ncv\tbn m, s2: 'qwe,rty', s3: "as\"df'gh", s4: "", d: 2016-01-04, n: 789 ;
n: "9876543210", s1: , s2: 'zx\ncv\tbn m', s3: "qwe,rty", s4: "as""df'gh", d: 2016-01-03, n: 9876543210
------
n: "0", s1: , s2: '', s3: "", s4: "", d: 0000-00-00, n: 0
n: "0", s1: , s2: '', s3: "", s4: "", d: 1970-01-01, n: 0
------
n: "123", s1: , s2: '', s3: "", s4: "", d: 2016-01-01, n: 123
------

View File

@ -13,9 +13,9 @@
2019-04-18 2 Line13
2019-04-18 1
2019-04-18 2
0000-00-00 1 Line16
0000-00-00 2 Line17
1970-01-01 1 Line16
1970-01-01 2 Line17
2019-04-18 0 Line18
2019-04-18 0 Line19
0000-00-00 0
0000-00-00 0
1970-01-01 0
1970-01-01 0

View File

@ -13,9 +13,9 @@
2019-04-18 2 Line13
2019-04-18 1
2019-04-18 2
0000-00-00 1 Line16
0000-00-00 2 Line17
1970-01-01 1 Line16
1970-01-01 2 Line17
2019-04-18 0 Line18
2019-04-18 0 Line19
0000-00-00 0
0000-00-00 0
1970-01-01 0
1970-01-01 0

View File

@ -1,19 +1,19 @@
"0","0000-00-00",0,0
"0","1970-01-01",0,0
"1","1970-01-02",1,0
"2","1970-01-03",4,0
"3","1970-01-04",9,0
"4","1970-01-05",16,0
"0","0000-00-00",0,0
"0","1970-01-01",0,0
"1","1970-01-02",1,0
"2","1970-01-03",4,0
"3","1970-01-04",9,0
"4","1970-01-05",16,0
"0","0000-00-00",0,0
"0","1970-01-01",0,0
"1","1970-01-02",1,0
"2","1970-01-03",4,0
"3","1970-01-04",9,0
"4","1970-01-05",16,0
"0","0000-00-00",0,0
"0","1970-01-01",0,0
"1","1970-01-02",1,0
"2","1970-01-03",4,0
"3","1970-01-04",9,0

View File

@ -1,5 +1,5 @@
2015-12-01 0 0
2015-12-02 1 1
0000-00-00 0 2
0000-00-00 0 3
0000-00-00 0 4
1970-01-01 0 2
1970-01-01 0 3
1970-01-01 0 4

View File

@ -1 +1 @@
0000-00-00 1 bar_n_1 1
1970-01-01 1 bar_n_1 1

View File

@ -1,16 +1,16 @@
-- unmerged state
1 0000-00-00 00:00:00 0000-00-00 00:00:00 18446744073709551615 0
1 0000-00-00 00:00:00 2000-01-01 10:00:00 7200 0
1 0000-00-00 00:00:00 2000-01-01 11:10:00 600 0
1 2000-01-01 08:00:00 0000-00-00 00:00:00 18446744073709551615 0
1 2000-01-01 11:00:00 0000-00-00 00:00:00 18446744073709551615 3600
2 0000-00-00 00:00:00 0000-00-00 00:00:00 18446744073709551615 0
2 0000-00-00 00:00:00 2000-01-01 10:00:00 7200 0
2 0000-00-00 00:00:00 2000-01-01 11:10:00 600 0
2 0000-00-00 00:00:00 2001-01-01 11:10:02 1 0
2 2000-01-01 08:00:00 0000-00-00 00:00:00 18446744073709551615 0
2 2000-01-01 11:00:00 0000-00-00 00:00:00 18446744073709551615 3600
2 2001-01-01 11:10:01 0000-00-00 00:00:00 18446744073709551615 31622401
1 1970-01-01 00:00:00 1970-01-01 00:00:00 18446744073709551615 0
1 1970-01-01 00:00:00 2000-01-01 10:00:00 7200 0
1 1970-01-01 00:00:00 2000-01-01 11:10:00 600 0
1 2000-01-01 08:00:00 1970-01-01 00:00:00 18446744073709551615 0
1 2000-01-01 11:00:00 1970-01-01 00:00:00 18446744073709551615 3600
2 1970-01-01 00:00:00 1970-01-01 00:00:00 18446744073709551615 0
2 1970-01-01 00:00:00 2000-01-01 10:00:00 7200 0
2 1970-01-01 00:00:00 2000-01-01 11:10:00 600 0
2 1970-01-01 00:00:00 2001-01-01 11:10:02 1 0
2 2000-01-01 08:00:00 1970-01-01 00:00:00 18446744073709551615 0
2 2000-01-01 11:00:00 1970-01-01 00:00:00 18446744073709551615 3600
2 2001-01-01 11:10:01 1970-01-01 00:00:00 18446744073709551615 31622401
-- merged state
1 2000-01-01 11:00:00 2000-01-01 11:10:00 600 3600
2 2001-01-01 11:10:01 2001-01-01 11:10:02 1 31622401

View File

@ -15,8 +15,8 @@ CREATE TABLE target_table Engine=SummingMergeTree() ORDER BY id
AS
SELECT
number as id,
maxState( toDateTime(0) ) as latest_login_time,
maxState( toDateTime(0) ) as latest_checkout_time,
maxState( toDateTime(0, 'UTC') ) as latest_login_time,
maxState( toDateTime(0, 'UTC') ) as latest_checkout_time,
minState( toUInt64(-1) ) as fastest_session,
maxState( toUInt64(0) ) as biggest_inactivity_period
FROM numbers(50000)
@ -26,7 +26,7 @@ GROUP BY id;
CREATE TABLE logins (
id UInt64,
ts DateTime
ts DateTime('UTC')
) Engine=MergeTree ORDER BY id;
@ -37,7 +37,7 @@ AS
SELECT
id,
maxState( ts ) as latest_login_time,
maxState( toDateTime(0) ) as latest_checkout_time,
maxState( toDateTime(0, 'UTC') ) as latest_checkout_time,
minState( toUInt64(-1) ) as fastest_session,
if(max(current_latest_checkout_time) > 0, maxState(toUInt64(ts - current_latest_checkout_time)), maxState( toUInt64(0) ) ) as biggest_inactivity_period
FROM logins
@ -60,14 +60,14 @@ AS
-- the same for second pipeline
CREATE TABLE checkouts (
id UInt64,
ts DateTime
ts DateTime('UTC')
) Engine=MergeTree ORDER BY id;
CREATE MATERIALIZED VIEW mv_checkouts2target TO target_table
AS
SELECT
id,
maxState( toDateTime(0) ) as latest_login_time,
maxState( toDateTime(0, 'UTC') ) as latest_login_time,
maxState( ts ) as latest_checkout_time,
if(max(current_latest_login_time) > 0, minState( toUInt64(ts - current_latest_login_time)), minState( toUInt64(-1) ) ) as fastest_session,
maxState( toUInt64(0) ) as biggest_inactivity_period

View File

@ -1,4 +1,4 @@
Q1 2106-02-07 Hello
Q2 0000-00-00 World
Q2 1970-01-01 World
Q1 2106-02-07 Hello
Q2 0000-00-00 World
Q2 1970-01-01 World

View File

@ -1 +1 @@
0 0000-00-00 00:00:00
0 1970-01-01 00:00:00

View File

@ -12,7 +12,7 @@ LIFETIME(0)
LAYOUT(hashed());
SELECT dictGetInt32('system.dict1', 'element_count', toUInt64(dict_key)) AS join_key,
dictGetDateTime('system.dict1', 'loading_start_time', toUInt64(dict_key)) AS datetime
toTimeZone(dictGetDateTime('system.dict1', 'loading_start_time', toUInt64(dict_key)), 'UTC') AS datetime
FROM (select 1 AS dict_key) js1
LEFT JOIN (SELECT toInt32(2) AS join_key) js2
USING (join_key)

View File

@ -9,5 +9,5 @@
0 1
0 1
0 1
0 0000-00-00
0 0000-00-00 00:00:00
0 1970-01-01
0 1970-01-01 00:00:00

View File

@ -13,6 +13,6 @@ select * from (select 0 as k, toDecimal64(1, 0) as v) t1 asof join (select 0 as
select * from (select 0 as k, toDecimal128(1, 0) as v) t1 asof join (select 0 as k, toDecimal128(0, 0) as v) t2 using(k, v);
select * from (select 0 as k, toDate(0) as v) t1 asof join (select 0 as k, toDate(0) as v) t2 using(k, v);
select * from (select 0 as k, toDateTime(0) as v) t1 asof join (select 0 as k, toDateTime(0) as v) t2 using(k, v);
select * from (select 0 as k, toDateTime(0, 'UTC') as v) t1 asof join (select 0 as k, toDateTime(0, 'UTC') as v) t2 using(k, v);
select * from (select 0 as k, 'x' as v) t1 asof join (select 0 as k, 'x' as v) t2 using(k, v); -- { serverError 169 }

View File

@ -1,31 +1,31 @@
0 300 0000-00-00 00:00:00 N1
0 300 0000-00-00 00:00:00 N1
0 300 0000-00-00 00:00:00 N1
0 300 0000-00-00 00:00:00 N1
0 300 0000-00-00 00:00:00 N1
0 300 0000-00-00 00:00:00 N1
0 200 0000-00-00 00:00:00 C2
0 0 0000-00-00 00:00:00 C3
0 0 0000-00-00 00:00:00 C3
0 0 0000-00-00 00:00:00 N1
0 0 0000-00-00 00:00:00 N1
0 0 0000-00-00 00:00:00 N1
0 0 0000-00-00 00:00:00 N1
0 0 0000-00-00 00:00:00 N1
0 300 1970-01-01 00:00:00 N1
0 300 1970-01-01 00:00:00 N1
0 300 1970-01-01 00:00:00 N1
0 300 1970-01-01 00:00:00 N1
0 300 1970-01-01 00:00:00 N1
0 300 1970-01-01 00:00:00 N1
0 200 1970-01-01 00:00:00 C2
0 0 1970-01-01 00:00:00 C3
0 0 1970-01-01 00:00:00 C3
0 0 1970-01-01 00:00:00 N1
0 0 1970-01-01 00:00:00 N1
0 0 1970-01-01 00:00:00 N1
0 0 1970-01-01 00:00:00 N1
0 0 1970-01-01 00:00:00 N1
0 210 2020-02-16 05:22:04 N1
0 210 2020-02-16 05:22:04 N1
0 270 2020-02-16 05:22:04 N1
0 270 2020-02-16 05:22:04 N1
0 380 0000-00-00 00:00:00 N1
0 380 0000-00-00 00:00:00 N1
0 280 0000-00-00 00:00:00 C2
0 0 0000-00-00 00:00:00 N1
0 380 1970-01-01 00:00:00 N1
0 380 1970-01-01 00:00:00 N1
0 280 1970-01-01 00:00:00 C2
0 0 1970-01-01 00:00:00 N1
0 190 2020-02-16 05:22:05 N1
0 160 2020-02-14 05:22:13 N1
0 230 2020-02-14 05:22:13 N1
0 130 2020-02-14 05:22:14 N1
0 300 0000-00-00 00:00:00 N1
0 300 0000-00-00 00:00:00 N1
0 0 0000-00-00 00:00:00 C2
0 0 0000-00-00 00:00:00 N1
0 0 0000-00-00 00:00:00 N1
0 300 1970-01-01 00:00:00 N1
0 300 1970-01-01 00:00:00 N1
0 0 1970-01-01 00:00:00 C2
0 0 1970-01-01 00:00:00 N1
0 0 1970-01-01 00:00:00 N1

View File

@ -13,18 +13,18 @@ CREATE TABLE test_dict_db.table1
`col5` String,
`col6` Nullable(Float64),
`col7` Nullable(Float64),
`col8` Nullable(DateTime),
`col8` Nullable(DateTime('UTC')),
`col9` Nullable(String),
`col10` Nullable(String),
`col11` Nullable(String),
`col12` Nullable(String),
`col13` Nullable(Int32),
`col14` Nullable(DateTime),
`col15` Nullable(DateTime),
`col16` Nullable(DateTime),
`col17` Nullable(DateTime),
`col18` Nullable(DateTime),
`col19` Nullable(DateTime),
`col14` Nullable(DateTime('UTC')),
`col15` Nullable(DateTime('UTC')),
`col16` Nullable(DateTime('UTC')),
`col17` Nullable(DateTime('UTC')),
`col18` Nullable(DateTime('UTC')),
`col19` Nullable(DateTime('UTC')),
`col20` Nullable(String)
)
ENGINE = MergeTree
@ -41,18 +41,18 @@ CREATE DICTIONARY test_dict_db.table1_dict
col5 String,
col6 Float64,
col7 Float64,
col8 DateTime,
col8 DateTime('UTC'),
col9 String,
col10 String,
col11 String,
col12 String,
col13 Int32,
col14 DateTime,
col15 DateTime,
col16 DateTime,
col17 DateTime,
col18 DateTime,
col19 DateTime,
col14 DateTime('UTC'),
col15 DateTime('UTC'),
col16 DateTime('UTC'),
col17 DateTime('UTC'),
col18 DateTime('UTC'),
col19 DateTime('UTC'),
col20 String
)
PRIMARY KEY col1,col2,col3,col4,col5
@ -77,18 +77,18 @@ CREATE TABLE test_dict_db.table1
`col5` String,
`col6` Float64,
`col7` Float64,
`col8` DateTime,
`col8` DateTime('UTC'),
`col9` String,
`col10` String,
`col11` String,
`col12` String,
`col13` Int32,
`col14` DateTime,
`col15` DateTime,
`col16` DateTime,
`col17` DateTime,
`col18` DateTime,
`col19` DateTime,
`col14` DateTime('UTC'),
`col15` DateTime('UTC'),
`col16` DateTime('UTC'),
`col17` DateTime('UTC'),
`col18` DateTime('UTC'),
`col19` DateTime('UTC'),
`col20` String
)
ENGINE = MergeTree

View File

@ -3,7 +3,7 @@ orNull
\N
orZero
2020-05-14 03:37:03.253
0000-00-00 00:00:00.000
1970-01-01 00:00:00.000
non-const
2020-05-14 03:37:03.253
Timezones

View File

@ -1,2 +1,2 @@
2 2000-01-11 01:02:03 2000-02-13 04:05:06 [] [] []
0 0000-00-00 00:00:00 0000-00-00 00:00:00 [] [] []
0 1970-01-01 00:00:00 1970-01-01 00:00:00 [] [] []

View File

@ -5,5 +5,5 @@ INSERT INTO ttl VALUES ('2000-01-01 01:02:03'), ('2000-02-03 04:05:06');
SELECT rows, delete_ttl_info_min, delete_ttl_info_max, move_ttl_info.expression, move_ttl_info.min, move_ttl_info.max FROM system.parts WHERE database = currentDatabase() AND table = 'ttl';
SYSTEM START MERGES ttl;
OPTIMIZE TABLE ttl FINAL;
SELECT rows, delete_ttl_info_min, delete_ttl_info_max, move_ttl_info.expression, move_ttl_info.min, move_ttl_info.max FROM system.parts WHERE database = currentDatabase() AND table = 'ttl' AND active;
SELECT rows, toTimeZone(delete_ttl_info_min, 'UTC'), toTimeZone(delete_ttl_info_max, 'UTC'), move_ttl_info.expression, move_ttl_info.min, move_ttl_info.max FROM system.parts WHERE database = currentDatabase() AND table = 'ttl' AND active;
DROP TABLE ttl;

View File

@ -1,6 +1,6 @@
\N
0000-00-00 00:00:00
1970-01-01 00:00:00
\N
0000-00-00 00:00:00.000
1970-01-01 00:00:00
\N
0000-00-00 00:00:00
1970-01-01 00:00:00

View File

@ -1,12 +1,12 @@
SELECT parseDateTimeBestEffort('<Empty>'); -- { serverError 6 }
SELECT parseDateTimeBestEffortOrNull('<Empty>');
SELECT parseDateTimeBestEffortOrZero('<Empty>');
SELECT parseDateTimeBestEffortOrZero('<Empty>', 'UTC');
SELECT parseDateTime64BestEffort('<Empty>'); -- { serverError 6 }
SELECT parseDateTime64BestEffortOrNull('<Empty>');
SELECT parseDateTime64BestEffortOrZero('<Empty>');
SELECT parseDateTime64BestEffortOrZero('<Empty>', 0, 'UTC');
SET date_time_input_format = 'best_effort';
SELECT toDateTime('<Empty>'); -- { serverError 41 }
SELECT toDateTimeOrNull('<Empty>');
SELECT toDateTimeOrZero('<Empty>');
SELECT toDateTimeOrZero('<Empty>', 'UTC');

View File

@ -1,21 +1,21 @@
1970-01-11 1970-01-02 original
0000-00-00 1970-01-03
0000-00-00 1970-01-04
1970-01-01 1970-01-03
1970-01-01 1970-01-04
1970-02-10 1970-01-05 original
0000-00-00 1970-01-06
0000-00-00 1970-01-07
1970-01-01 1970-01-06
1970-01-01 1970-01-07
1970-03-12 1970-01-08 original
===============
1970-01-11 1970-01-02 original
1970-01-16 0000-00-00
1970-01-21 0000-00-00
1970-01-26 0000-00-00
1970-01-31 0000-00-00
1970-02-05 0000-00-00
1970-01-16 1970-01-01
1970-01-21 1970-01-01
1970-01-26 1970-01-01
1970-01-31 1970-01-01
1970-02-05 1970-01-01
1970-02-10 1970-01-05 original
1970-02-15 0000-00-00
1970-02-20 0000-00-00
1970-02-25 0000-00-00
1970-03-02 0000-00-00
1970-03-07 0000-00-00
1970-02-15 1970-01-01
1970-02-20 1970-01-01
1970-02-25 1970-01-01
1970-03-02 1970-01-01
1970-03-07 1970-01-01
1970-03-12 1970-01-08 original

View File

@ -1,4 +1,4 @@
2020-07-10
2020-07-11
0000-00-00
1970-01-01