v.19.17New Feature
Implement Arraycompact Function #7328 (memo)
Why it matters
ThearrayCompact 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 newarrayCompact 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.