Hi Pradeep,
You can Create a Individual profile class schema with the attributes required along with a field with data type "Segment Membership Details". From the source you can compose your data in the required format and ingest into the dataset. You can even try with Query services also to compose the data using Map function. But it is too hard as the segments you are thinking is dynamic in nature.
"segmentmembership": {
"external":{
"segment1":{
"status":"existing",
"lastqualificationtime":"2023-05-30T10:00:00.000Z"
},
"segment2":{
"status":"existing",
"lastqualificationtime":"2023-05-30T10:00:00.000Z"
},
"segment3":{
"status":"existing",
"lastqualificationtime":"2023-05-30T10:00:00.000Z"
},
"segment4":{
"status":"existing",
"lastqualificationtime":"2023-05-30T10:00:00.000Z"
},
"segment5":{
"status":"exiting",
"lastqualificationtime":"2023-05-30T10:00:00.000Z"
}
}
}
sample SQL on how to use the map function.
select map('externalSegments',
map('segment1',
struct (
'existing' as status,
'2023-05-30T10:00:00.000Z' as lastqualificationtime
)
,
'segment2',
struct (
'existing' as status,
'2023-05-30T10:00:00.000Z' as lastqualificationtime
)
)
)
Regards,
Vinod