dbms: implemented method getExtremes for ColumnTuple [#METR-18474].

This commit is contained in:
Alexey Milovidov 2015-10-16 23:32:44 +03:00
parent d5e8f3e427
commit 1eaa3cb309
3 changed files with 21 additions and 1 deletions

View File

@ -233,7 +233,13 @@ public:
void getExtremes(Field & min, Field & max) const override
{
throw Exception("Method getExtremes is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
size_t tuple_size = columns.size();
min = Array(tuple_size);
max = Array(tuple_size);
for (size_t i = 0; i < tuple_size; ++i)
columns[i]->getExtremes(min.get<Array &>()[i], max.get<Array &>()[i]);
}

View File

@ -0,0 +1,13 @@
0 (0,'2015-01-01')
1 (1,'2015-01-02')
2 (2,'2015-01-03')
3 (3,'2015-01-04')
4 (4,'2015-01-05')
5 (5,'2015-01-06')
6 (6,'2015-01-07')
7 (7,'2015-01-08')
8 (8,'2015-01-09')
9 (9,'2015-01-10')
0 (0,'2015-01-01')
9 (9,'2015-01-10')

View File

@ -0,0 +1 @@
SELECT number, (number, toDate('2015-01-01') + number) FROM system.numbers LIMIT 10 SETTINGS extremes = 1;