Mapping metadata array


Hi all,

I have a 2-dimensional array:

AFL% show(fvNorm);  
{i} schema
{0} 'fvNorm<value:double> [patch_id=0:268729:0:1024; feature=0:1023:0:1024]'

In order to map some metadata to the above array i created a one dimensional metadata array:

AFL% show(patch_index);
{i} schema
{0} 'patch_index<patchname:string ,image:string ,coordinates:string > [patch_id=0:268729:0:1000000]'

The fvNorm’s patch_id dimension indices were created from the patch_index’ array patch_id dimension indices. So, e.g. the attribute values at patch_id 5 in the patch_index array hold metadata of the patch_id 5 in fvNorm array.

Can you tell me the most efficient way to retrieve all values in the fvNorm array that meet a certain criterion defined in the patch_index array?
Example: Retrieve a subarray where values in fvNorm belong to patch_ids mapped to the image ‘ws1’. Image to patch_id has a 1-to-n relationship.

I would have solved it in the following way:


However this solution does not seem very efficient since all the 268’000 x 1024 values from fvNorm are now joined with the corresponding values from the patch_index, before doing the filtering. Is there any more efficient way?

Thank you!


I think you are quite close. But consider placing the filter inside the join:

  image = 'ws1'

This is a common pattern.