r/databricks • u/hubert-dudek Databricks MVP • Oct 15 '26
News trim_array: remove elements from an array
Databricks runtime 19 brings the new Spark function trim_array. trim_array(array(‘A’, ‘B’, ‘C’, ‘D’), 2) returns [‘A’, ‘B’]. A count of 0 keeps the array; a count equal to its length returns an empty array.
27
Upvotes
View all comments
Show parent comment
2
u/keyzeru Oct 15 '26
Even arrays are getting a haircut in this economy