I have a field that contains an array of numbers. I am converting the field to string values so that I can translate them to their text values with gsub. All of this works great, except that for one value which I "delete" from the array, it leaves behind an empty array value. How can I get rid of this?
Any chance you can school me on what's going on here? Looks like event.set targets a field, event.get grabs the current values and then reject...does something?
Yes, event.get fetches the current value of the [user][groups] field. reject is a method of the Ruby Array class, which returns a new array that contains only those array entries for which the script block returns false. That is, it rejects entries for which the script block returns true, and x.empty? returns true for empty strings.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.