v.19.17New Feature
Add Arrayfill and Arrayreversefill Functions, Which Replace Elements by Other Elements in Front/back of Them in the Array
AddarrayFillandarrayReverseFillfunctions, which replace elements by other elements in front/back of them in the array. #7380 (hcz)
Why it matters
These functions address the need to transform arrays by filling elements based on neighboring elements from either the beginning or the end, enabling more flexible array manipulation and data transformation in ClickHouse queries.How to use it
UsearrayFill to replace elements in an array with elements from the front side of the array, and arrayReverseFill to do so from the back side. Call these functions in your SQL queries by passing the target array as an argument, for example:SELECT arrayFill(your_array) FROM your_table;
SELECT arrayReverseFill(your_array) FROM your_table;