v.19.17New Feature

Implement Arraycompact Function #7328 (memo)

Implement arrayCompact function #7328 (Memo)
arrayCompact function implemented to remove default/zero elements from arrays.

Why it matters

The arrayCompact function is designed to clean arrays by removing elements that are considered 'default' or 'zero' values (e.g., zeros, empty strings, NULL). This helps users efficiently filter out unwanted placeholder or meaningless values from array data, improving data quality and downstream processing.

How to use it

Users can apply the new arrayCompact function in SQL queries by passing an array as an argument. For example:

SELECT arrayCompact([0, 1, 0, 2, 3])


This will return an array with all zero elements removed. The function works with arrays of different data types and filters out their corresponding 'zero' or 'empty' elements.