mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Update tests
This commit is contained in:
parent
74f5e36b03
commit
a31d8a4f5b
@ -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");
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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');
|
||||
|
@ -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']
|
||||
|
@ -4,5 +4,5 @@ SELECT emptyArrayToSingle(emptyArrayString()), emptyArrayToSingle(emptyArrayDate
|
||||
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))),
|
||||
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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1 +1 @@
|
||||
[] [] (0,'','0000-00-00 00:00:00','0000-00-00')
|
||||
[] [] (0,'','1970-01-01 00:00:00','1970-01-01')
|
||||
|
@ -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()));
|
||||
|
@ -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'))
|
||||
|
@ -1,4 +1,4 @@
|
||||
0000-00-00 00:00:00
|
||||
1970-01-01 00:00:00
|
||||
|
||||
0
|
||||
0
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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']));
|
||||
|
||||
|
@ -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
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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()
|
||||
|
@ -9,7 +9,7 @@
|
||||
│ D │ d │ 2018-01-01 │ D │ 2018-01-01 │
|
||||
└───┴───┴────────────┴───┴────────────┘
|
||||
┌─[1ma[0m─┬──────────[1mb[0m─┬─[1mc[0m─┬──────────[1md[0m─┐
|
||||
│ 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 │
|
||||
└───┴────────────┴───┴────────────┘
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
------
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1 +1 @@
|
||||
0000-00-00 1 bar_n_1 1
|
||||
1970-01-01 1 bar_n_1 1
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1 +1 @@
|
||||
0 0000-00-00 00:00:00
|
||||
0 1970-01-01 00:00:00
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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 }
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 [] [] []
|
||||
|
@ -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;
|
||||
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;
|
||||
|
@ -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
|
||||
|
@ -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');
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user