Merge pull request #11697 from CurtizJ/fix-with-fill

Fix 'ORDER BY ... WITH FILL' over const columns.
This commit is contained in:
alexey-milovidov 2020-06-18 06:38:24 +03:00 committed by GitHub
commit c9924b8aa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 2 deletions

View File

@ -107,8 +107,9 @@ void FillingTransform::transform(Chunk & chunk)
{
for (size_t pos : positions)
{
new_columns.push_back(old_columns[pos]);
new_mutable_columns.push_back(old_columns[pos]->cloneEmpty()->assumeMutable());
auto old_column = old_columns[pos]->convertToFullColumnIfConst();
new_columns.push_back(old_column);
new_mutable_columns.push_back(old_column->cloneEmpty()->assumeMutable());
}
};

View File

@ -0,0 +1,20 @@
2020-06-16 00:00:00
2020-06-16 00:30:00
2020-06-16 01:00:00
2020-06-16 01:30:00
2020-06-16 02:00:00
2020-06-16 02:30:00
2020-06-16 03:00:00
2020-06-16 03:30:00
2020-06-16 04:00:00
2020-06-16 04:30:00
2020-06-16 05:00:00
2020-06-16 05:30:00
2020-06-16 06:00:00
2020-06-16 06:30:00
2020-06-16 07:00:00
2020-06-16 07:30:00
2020-06-16 08:00:00
2020-06-16 08:30:00
2020-06-16 09:00:00
2020-06-16 09:30:00

View File

@ -0,0 +1,6 @@
WITH toDateTime('2020-06-16 03:00:00') AS date_time
SELECT date_time ORDER BY date_time ASC
WITH FILL
FROM toDateTime('2020-06-16 00:00:00')
TO toDateTime('2020-06-16 10:00:00')
STEP 1800;