v.23.9Improvement
Added scalar array operations for multiplication, division, and modulo
Added array operations for multiplying, dividing and modulo on scalar. Works in each way, for example5 * [5, 5]and[5, 5] * 5- both cases are possible. #54608 (Yarik Briukhovetskyi).
Why it matters
This feature allows users to perform element-wise arithmetic operations between arrays and scalar values seamlessly. It improves flexibility and expressiveness in queries by enabling operations likescalar * array and array * scalar, simplifying mathematical transformations on arrays.How to use it
Use arithmetic operators, /, and % directly between arrays and scalar values in SQL queries. For example:SELECT 5 [5, 5];
SELECT [5, 5] * 5;Both expressions perform element-wise operations between the scalar and each element of the array.