How to write Insert into query for nested objects dataset
I need to work on a query that will fetch results of join between two temp datasets that are not profile enabled then use that resultset to insert into profile enabled dataset. There is minimal mention in the documentation which doesn't show nested objects.
E.g. Query I tried below did not work
Path of fields in Schema structure is like the below
_Tenant.ProfileAttributes.address.city
_Tenant.ProfileAttributes.role
_Tenant.Identity.customerID
The query that I tried is as below
INSERT INTO final_dataset
select struct
(
city as city,
role as role,
customerID as customerID
) _Tenant
From
(
select a._Tenant.ProfileAttributes.address.city as city
b._Tenant.ProfileAttributes.role as role
b._Tenant.Identity.customerID as customerID
from address a, profileDetails b
where a._Tenant.Identity.customerID = b._Tenant.Identity.customerID
)
any idea how to achieve the successful insertion.