Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

create a ksql table with a struct as the element type of an ARRAY

avatar
Contributor

Hey i need help to create a ksql table with A STRUCT as the element type of an ARRAY. Has everyone an idea. 

Input Stream:

 

 

{
  "GTIN": "4066136261834",
  "PRODUCT_SKU": "UC_55.08_W08_900_black",
  "SIZE_NAME": "34",
  "CALC_SALES_PRICE": 199.90,
  "SALES_PRICE": 199.90
}
{
  "GTIN": "4066136261846",
  "PRODUCT_SKU": "UC_55.08_W08_900_black",
  "SIZE_NAME": "36",
  "CALC_SALES_PRICE": 199.90,
  "SALES_PRICE": 199.90
}

 

 

 

The expected result of the KTable should be:

 

 

{
   "PRODUCT_SKU":"UC_55.08_W08_900_black",
   "variants":[
         {
            "GTIN":"4066136261834",
            "SIZE_NAME":"34",
            "CALC_SALES_PRICE":199.90,
            "SALES_PRICE":199.90
         },
         {
            "GTIN":"4066136261846",
            "SIZE_NAME":"36",
            "CALC_SALES_PRICE":199.90,
            "SALES_PRICE":199.90
         }
   ]
}

 

 

0 REPLIES 0