fixed Nullable, tests added

This commit is contained in:
Yakov Olkhovskiy 2022-04-08 10:52:10 -04:00
parent 64dcddc6e3
commit 87c2b3e2cf
3 changed files with 60 additions and 2 deletions

View File

@ -122,7 +122,7 @@ void insertFromFillingRow(MutableColumns & filling_columns, MutableColumns & int
{
Columns columns = interpolate_block.getColumns();
for (size_t i = 0; i < size; ++i)
interpolate_columns[i]->insertFrom(*columns[i], 0);
interpolate_columns[i]->insertFrom(*columns[i]->convertToFullColumnIfConst(), 0);
}
else
for (const auto & interpolate_column : interpolate_columns)

View File

@ -190,3 +190,51 @@ original 7
10.5 14
11 15
11.5 16
0 \N
0.5 \N
1 original \N
1.5 \N
2 \N
2.5 \N
3 \N
3.5 \N
4 original \N
4.5 \N
5 \N
5.5 \N
6 \N
6.5 \N
7 original \N
7.5 \N
8 \N
8.5 \N
9 \N
9.5 \N
10 \N
10.5 \N
11 \N
11.5 \N
0 \N
0.5 \N
1 original \N
1.5 \N
2 \N
2.5 \N
3 \N
3.5 \N
4 original \N
4.5 \N
5 \N
5.5 \N
6 \N
6.5 \N
7 original \N
7.5 \N
8 \N
8.5 \N
9 \N
9.5 \N
10 \N
10.5 \N
11 \N
11.5 \N

View File

@ -59,4 +59,14 @@ SELECT n, source, inter FROM (
SELECT n, any(source), sum(inter) AS inter_s FROM (
SELECT toFloat32(number % 10) AS n, 'original' AS source, number AS inter FROM numbers(10) WHERE (number % 3) = 1
) GROUP BY n
ORDER BY n ASC WITH FILL FROM 0 TO 11.51 STEP 0.5 INTERPOLATE ( inter_s AS inter_s + 1 );
ORDER BY n ASC WITH FILL FROM 0 TO 11.51 STEP 0.5 INTERPOLATE ( inter_s AS inter_s + 1 );
# Test INTERPOLATE with Nullable in result
SELECT n, source, inter + NULL AS inter_p FROM (
SELECT toFloat32(number % 10) AS n, 'original' AS source, number AS inter FROM numbers(10) WHERE (number % 3) = 1
) ORDER BY n ASC WITH FILL FROM 0 TO 11.51 STEP 0.5 INTERPOLATE ( inter_p AS inter_p + 1 );
# Test INTERPOLATE with Nullable in source
SELECT n, source, inter AS inter_p FROM (
SELECT toFloat32(number % 10) AS n, 'original' AS source, number + NULL AS inter FROM numbers(10) WHERE (number % 3) = 1
) ORDER BY n ASC WITH FILL FROM 0 TO 11.51 STEP 0.5 INTERPOLATE ( inter_p AS inter_p + 1 );