Check if one list object is contained in another list object

Four Stars

Check if one list object is contained in another list object

Ciao All,

 

Basically this is the scenario:

I have one input file which is do like that (first column is int, second string and 3rd list object):

ID |          Name        |         Foods

1   |        John           | [Pizza, Pasta, Fruits]

2   |        Jack           | [Kebab, Fruits,]

 

Then, i have one second file like that:

 

Restaurant Name | Available Food

Restaurant 1        | [Kebab, Vegan, Fruits]

Restaurant 2        | [Kebab, Pizza]

Restaurant 3        | [Vegetables, Pizza, Pasta, Fruits, Kebab, Vegan]

 

I would like to underastand which restaurants "satisfy" the food request which is expressed in the 3rd column of the first file.

So in that case for example.

John - - -  > only satisfied by Restaurant 3 , because the food requested by john is included in the available food of this restaurant (subset);

While Jack could eat in Restaurant 1 or Restaurant 3.

 

Please note thast the list of object are un-ordered..i would avoid to do lot of join......

thanks!

 

Four Stars

Re: Check if one list object is contained in another list object

please note that i am not good in java custom expression...so a good help would be very very appreciated

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog