Added a test from Kodieg #2680

This commit is contained in:
Alexey Milovidov 2018-11-24 06:20:05 +03:00
parent 73e3a7b662
commit fc9c7680b0
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1 @@
[1,2,3,1,3] 2 [1,3]

View File

@ -0,0 +1,4 @@
SELECT
[1, 2, 3, 1, 3] AS a,
indexOf(arrayReverse(arraySlice(a, 1, -1)), 3) AS offset_from_right,
arraySlice(a, multiIf(offset_from_right = 0, 1, (length(a) - offset_from_right) + 1));