How to use query with nested struct function
I am facing error with this query while trying to use nested struct functions
ErrorCode: 58000 Batch query execution gets : [failed reason ErrorCode: 58000 Batch query execution gets : [Errors(Some(INGEST-1205-400),Some(List()),Some(The field: _XYZ does not exist in the target schema. Remove the field and try again.))]]
INSERT INTO recently_viewed_products
SELECT STRUCT(THIRD_ID,struct(struct(struct(PROD_ID as PROD_ID)PRODUCTDETAIL)PRODUCTS)COMMERCE)_XYZ,
PAGE_VIEWS_VALUE,
LINK_CLICKS_VALUE,
timestamp,
POIEXITS_VALUE,
POIENTRIES_VALUE,
_id
FROM (
SELECT *
FROM (
SELECT _XYZ.THIRD_ID THIRD_ID,
_XYZ.COMMERCE.PRODUCTS.PRODUCTDETAIL.PROD_ID PROD_ID,
web.webPageDetails.pageViews.value PAGE_VIEWS_VALUE,
web.webInteraction.linkClicks.value LINK_CLICKS_VALUE,
timestamp,
placeContext.POIinteraction.poiExits.value POIEXITS_VALUE,
placeContext.POIinteraction.poiEntries.value POIENTRIES_VALUE,
_id,
ROW_NUMBER() OVER (PARTITION BY _XYZ.THIRD_ID ORDER BY TIMESTAMP DESC) RW_NUM
FROM web_data
) AS subquery
WHERE RW_NUM < 6
);