I have a really large array that have I computed with Apache Madlib and I would like to apply an operation to each single array in that 2d array.
I have found code that can help me unnest it from this related answer. However, the code is miserably slow on this really large 2d array (150,000+ 1d float arrays). While unnest()
only takes a few seconds to run, even after waiting for several minutes the code has not completed.
Surely, there must be a faster way to unnest the large 2d array into smaller 1d arrays? Bonus point if that solution uses Apache Madlib. I did find one lead buried in the documentation called deconstruct_2d_array
, however, when I try to call that function on the matrix, it fails with the following error:
ERROR: Function "deconstruct_2d_array(double precision[])": Invalid type conversion. Internal composite type has more elements than backend composite type.