I am using the upsert_array_replace function in Data Prep mapping. I have correctly selected the source array in the calculated fields and want to replace a specific array in the target. However, the target contains multiple arrays, each identified by an array_id attribute.Is there a way to filter or match the array_id between the source and target arrays to identify the correct target array? how can I determine its position in the target array for replacement? Any guidance or examples would be greatly appreciated!
Views
Replies
Total Likes
my schema is simple: a list of arrays using array of objects.
example:
hotels: (array of objects)
{hotel_id:001, hotel_sqft:10000},
{hotel_id:002, hotel_sqft:20000},
and have 10's. of them for a single profile
source mapping: upsert_array_replace([hotel_id:002, hotel_sqft:25000]) //this is fine
target mapping:hotels[] //how do i pick the right array position / index so it can be replaced.
thanks for your quick response @nnakirikanti
yeah, we are doing both streaming and batch. For streaming we are using data operation: merge
@VijayBa5 i would suggest as best practice not use an array more than one level down but rather simply your schema/ data mode using class and relationship as much as possible, as in long run multiple array levels would have an impact.
@VijayBa5 Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Views
Likes
Replies