<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Parsing nested JSOn in HIVE in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Parsing-nested-JSOn-in-HIVE/m-p/403636#M252138</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/123988"&gt;@Rich_Learner&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To resolve the issue where the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;ttype&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;column returns&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;NULL&amp;nbsp;&lt;/EM&gt;and subclasses'&amp;nbsp; values aren't being parsed correctly, follow these steps:&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;1. Case Sensitivity in JSON Paths&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;The JSON keys&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Type&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;ProductCOde&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;use uppercase letters. Correct the paths in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;get_json_object&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to match the exact case:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;'$.Type'&amp;nbsp;&lt;/EM&gt;instead of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;'$.type'.&lt;/EM&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Ensure&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;'$.ProductCOde'&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;matches the case in the JSON (if it's a typo, adjust accordingly).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;2. Properly Handle Nested Arrays&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;Avoid flattening both the outer&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;products&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;array and inner&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Offer&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;array into the same lateral view. Use separate lateral views for each array level.&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Corrected Code&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;WITH product AS (&lt;BR /&gt;SELECT&lt;BR /&gt;xml_data,&lt;BR /&gt;GET_JSON_OBJECT(xml_data, '$.Customer.CustomerId') AS applicationid,&lt;BR /&gt;-- Extract products array as a JSON string&lt;BR /&gt;GET_JSON_OBJECT(xml_data, '$.Customer.products') AS products_json&lt;BR /&gt;FROM Custome_info&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;-- Explode the products array&lt;BR /&gt;exploded_products AS (&lt;BR /&gt;SELECT&lt;BR /&gt;applicationid,&lt;BR /&gt;product_item&lt;BR /&gt;FROM product&lt;BR /&gt;LATERAL VIEW OUTER EXPLODE(&lt;BR /&gt;SPLIT(&lt;BR /&gt;REGEXP_REPLACE(&lt;BR /&gt;REGEXP_REPLACE(products_json, '^\\[|\\]$', ''), -- Remove outer brackets&lt;BR /&gt;'\\}\\,\\{', '\\}\\;\\{' -- Split products&lt;BR /&gt;),&lt;BR /&gt;';'&lt;BR /&gt;)&lt;BR /&gt;) p AS product_item&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;-- Explode the Offer array within each product&lt;BR /&gt;exploded_offers AS (&lt;BR /&gt;SELECT&lt;BR /&gt;applicationid,&lt;BR /&gt;GET_JSON_OBJECT(product_item, '$.ProductCOde') AS ProductCode,&lt;BR /&gt;GET_JSON_OBJECT(product_item, '$.Type') AS ttype,&lt;BR /&gt;offer_item&lt;BR /&gt;FROM exploded_products&lt;BR /&gt;LATERAL VIEW OUTER EXPLODE(&lt;BR /&gt;SPLIT(&lt;BR /&gt;REGEXP_REPLACE(&lt;BR /&gt;REGEXP_REPLACE(&lt;BR /&gt;GET_JSON_OBJECT(product_item, '$.Offer'),&lt;BR /&gt;'^\\[|\\]$', '' -- Remove inner Offer brackets&lt;BR /&gt;),&lt;BR /&gt;'\\}\\,\\{', '\\}\\;\\{' -- Split Offer items&lt;BR /&gt;),&lt;BR /&gt;';'&lt;BR /&gt;)&lt;BR /&gt;) o AS offer_item&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;-- Combine results (products and their offers)&lt;BR /&gt;SELECT&lt;BR /&gt;applicationid,&lt;BR /&gt;COALESCE(&lt;BR /&gt;GET_JSON_OBJECT(offer_item, '$.ProductCOde'), -- Offer-level ProductCode&lt;BR /&gt;ProductCode -- Product-level ProductCode&lt;BR /&gt;) AS ProductCode,&lt;BR /&gt;COALESCE(&lt;BR /&gt;GET_JSON_OBJECT(offer_item, '$.Type'), -- Offer-level Type&lt;BR /&gt;ttype -- Product-level Type&lt;BR /&gt;) AS ttype&lt;BR /&gt;FROM exploded_offers;&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Explanation&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Case Sensitivity Fix&lt;/STRONG&gt;: Using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;'$.Type'&amp;nbsp;&lt;/EM&gt;ensures the correct extraction of the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Type&amp;nbsp;&lt;/EM&gt;field from the JSON.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Nested Array Handling&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;First, explode the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;products&amp;nbsp;&lt;/EM&gt;array to get individual product objects.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Then, explode the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Offer&amp;nbsp;&lt;/EM&gt;array within each product to access sub-offer details.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Combined Results&lt;/STRONG&gt;: Use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;COALESCE&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to merge product-level and offer-level values into a single output, ensuring both levels are represented.&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Expected Output&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;LI-SPOILER&gt;ApplicationID | ProductCode | ttype&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | ABC&amp;nbsp; | C1&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | A1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| CBA&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | A2&amp;nbsp; &amp;nbsp; &amp;nbsp; | DBA&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | A3&amp;nbsp; &amp;nbsp; &amp;nbsp; | BBA&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | XYZ&amp;nbsp; &amp;nbsp; | C2&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | B1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| BBA&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | B2&amp;nbsp; &amp;nbsp; &amp;nbsp; | BBA&lt;/LI-SPOILER&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;&lt;FONT size="4"&gt;Happy hadooping&amp;nbsp;&lt;/FONT&gt;&lt;/H3&gt;</description>
    <pubDate>Wed, 05 Mar 2025 18:30:33 GMT</pubDate>
    <dc:creator>Shelton</dc:creator>
    <dc:date>2025-03-05T18:30:33Z</dc:date>
    <item>
      <title>Parsing nested JSOn in HIVE</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Parsing-nested-JSOn-in-HIVE/m-p/402584#M251714</link>
      <description>&lt;P&gt;I have a table with one column as JSON file. I am using lateral explode to parse values.The code is working fine for classes except for one where subclasses have similar variable name :&lt;/P&gt;&lt;P&gt;Json:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"Customer": {&lt;BR /&gt;"CustomerId": "19900101",&lt;BR /&gt;"appl": [&lt;BR /&gt;{&lt;BR /&gt;***Some values&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;"products": [&lt;BR /&gt;{&lt;BR /&gt;"ProductCOde": ABC,&lt;BR /&gt;"Type": C1,&lt;BR /&gt;"Offer": 16575.0,&lt;BR /&gt;&lt;BR /&gt;"Offer": [&lt;BR /&gt;{&lt;BR /&gt;"ProductCOde": A1,&lt;BR /&gt;"Offer": 2000.0&lt;BR /&gt;"Type": CBA,&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;"ProductCOde": A2,&lt;BR /&gt;"Offer": 2000.0&lt;BR /&gt;"Type": DBA,&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;"ProductCOde": A3,&lt;BR /&gt;"Offer": 3000.0&lt;BR /&gt;"Type": BBA,&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;"ProductCOde": XYZ,&lt;BR /&gt;"Type": C2,&lt;BR /&gt;"Offer": 2001,&lt;BR /&gt;&lt;BR /&gt;"Offer": [&lt;BR /&gt;{&lt;BR /&gt;"ProductCOde": B1,&lt;BR /&gt;"Offer": 2000.0&lt;BR /&gt;"Type": BBA,&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;"ProductCOde": B2,&lt;BR /&gt;"Offer": 2000.0&lt;BR /&gt;"Type": BBA,&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;with product as (&lt;BR /&gt;select&lt;BR /&gt;xml_data,&lt;BR /&gt;get_json_object(xml_data,'$.customer.customerid')as applicationid,&lt;BR /&gt;&lt;BR /&gt;regexp_replace(regexp_replace(get_json_object(xml_data, '$.customer.products'), '\\[|\\]', ''), '\\}\\,\\{', '\\}\\;\\{') AS product_JSOn&lt;BR /&gt;from Custome_info&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;select&lt;BR /&gt;&lt;BR /&gt;applicationid,&lt;BR /&gt;&lt;BR /&gt;get_json_object(prod_item,'$.ProductCOde') as ProductCOde,&lt;BR /&gt;&lt;BR /&gt;get_json_object(prod_item,'$.type') as ttype&lt;/P&gt;&lt;P&gt;from product&lt;BR /&gt;LATERAL VIEW OUTER EXPLODE(split(product_JSOn, ';')) p AS prod_item;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Output&lt;BR /&gt;ApplicationID ProductCode ttype&lt;BR /&gt;19900101 ABC NULL&lt;BR /&gt;19900101 A1 NULL&lt;BR /&gt;19900101 A2 NULL&lt;BR /&gt;19900101 B1 NULL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to figure why values of subclasses are populating here&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 15:41:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Parsing-nested-JSOn-in-HIVE/m-p/402584#M251714</guid>
      <dc:creator>Rich_Learner</dc:creator>
      <dc:date>2025-02-19T15:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing nested JSOn in HIVE</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Parsing-nested-JSOn-in-HIVE/m-p/403636#M252138</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/123988"&gt;@Rich_Learner&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To resolve the issue where the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;ttype&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;column returns&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;NULL&amp;nbsp;&lt;/EM&gt;and subclasses'&amp;nbsp; values aren't being parsed correctly, follow these steps:&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;1. Case Sensitivity in JSON Paths&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;The JSON keys&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Type&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;ProductCOde&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;use uppercase letters. Correct the paths in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;get_json_object&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to match the exact case:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;'$.Type'&amp;nbsp;&lt;/EM&gt;instead of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;'$.type'.&lt;/EM&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Ensure&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;'$.ProductCOde'&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;matches the case in the JSON (if it's a typo, adjust accordingly).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;2. Properly Handle Nested Arrays&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;Avoid flattening both the outer&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;products&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;array and inner&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Offer&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;array into the same lateral view. Use separate lateral views for each array level.&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Corrected Code&lt;BR /&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;WITH product AS (&lt;BR /&gt;SELECT&lt;BR /&gt;xml_data,&lt;BR /&gt;GET_JSON_OBJECT(xml_data, '$.Customer.CustomerId') AS applicationid,&lt;BR /&gt;-- Extract products array as a JSON string&lt;BR /&gt;GET_JSON_OBJECT(xml_data, '$.Customer.products') AS products_json&lt;BR /&gt;FROM Custome_info&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;-- Explode the products array&lt;BR /&gt;exploded_products AS (&lt;BR /&gt;SELECT&lt;BR /&gt;applicationid,&lt;BR /&gt;product_item&lt;BR /&gt;FROM product&lt;BR /&gt;LATERAL VIEW OUTER EXPLODE(&lt;BR /&gt;SPLIT(&lt;BR /&gt;REGEXP_REPLACE(&lt;BR /&gt;REGEXP_REPLACE(products_json, '^\\[|\\]$', ''), -- Remove outer brackets&lt;BR /&gt;'\\}\\,\\{', '\\}\\;\\{' -- Split products&lt;BR /&gt;),&lt;BR /&gt;';'&lt;BR /&gt;)&lt;BR /&gt;) p AS product_item&lt;BR /&gt;),&lt;/P&gt;&lt;P&gt;-- Explode the Offer array within each product&lt;BR /&gt;exploded_offers AS (&lt;BR /&gt;SELECT&lt;BR /&gt;applicationid,&lt;BR /&gt;GET_JSON_OBJECT(product_item, '$.ProductCOde') AS ProductCode,&lt;BR /&gt;GET_JSON_OBJECT(product_item, '$.Type') AS ttype,&lt;BR /&gt;offer_item&lt;BR /&gt;FROM exploded_products&lt;BR /&gt;LATERAL VIEW OUTER EXPLODE(&lt;BR /&gt;SPLIT(&lt;BR /&gt;REGEXP_REPLACE(&lt;BR /&gt;REGEXP_REPLACE(&lt;BR /&gt;GET_JSON_OBJECT(product_item, '$.Offer'),&lt;BR /&gt;'^\\[|\\]$', '' -- Remove inner Offer brackets&lt;BR /&gt;),&lt;BR /&gt;'\\}\\,\\{', '\\}\\;\\{' -- Split Offer items&lt;BR /&gt;),&lt;BR /&gt;';'&lt;BR /&gt;)&lt;BR /&gt;) o AS offer_item&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;-- Combine results (products and their offers)&lt;BR /&gt;SELECT&lt;BR /&gt;applicationid,&lt;BR /&gt;COALESCE(&lt;BR /&gt;GET_JSON_OBJECT(offer_item, '$.ProductCOde'), -- Offer-level ProductCode&lt;BR /&gt;ProductCode -- Product-level ProductCode&lt;BR /&gt;) AS ProductCode,&lt;BR /&gt;COALESCE(&lt;BR /&gt;GET_JSON_OBJECT(offer_item, '$.Type'), -- Offer-level Type&lt;BR /&gt;ttype -- Product-level Type&lt;BR /&gt;) AS ttype&lt;BR /&gt;FROM exploded_offers;&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Explanation&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Case Sensitivity Fix&lt;/STRONG&gt;: Using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;'$.Type'&amp;nbsp;&lt;/EM&gt;ensures the correct extraction of the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Type&amp;nbsp;&lt;/EM&gt;field from the JSON.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Nested Array Handling&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;First, explode the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;products&amp;nbsp;&lt;/EM&gt;array to get individual product objects.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Then, explode the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Offer&amp;nbsp;&lt;/EM&gt;array within each product to access sub-offer details.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Combined Results&lt;/STRONG&gt;: Use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;COALESCE&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to merge product-level and offer-level values into a single output, ensuring both levels are represented.&lt;/P&gt;&lt;H3&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Expected Output&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;LI-SPOILER&gt;ApplicationID | ProductCode | ttype&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | ABC&amp;nbsp; | C1&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | A1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| CBA&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | A2&amp;nbsp; &amp;nbsp; &amp;nbsp; | DBA&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | A3&amp;nbsp; &amp;nbsp; &amp;nbsp; | BBA&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | XYZ&amp;nbsp; &amp;nbsp; | C2&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | B1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| BBA&lt;BR /&gt;19900101&amp;nbsp; &amp;nbsp; &amp;nbsp; | B2&amp;nbsp; &amp;nbsp; &amp;nbsp; | BBA&lt;/LI-SPOILER&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;&lt;FONT size="4"&gt;Happy hadooping&amp;nbsp;&lt;/FONT&gt;&lt;/H3&gt;</description>
      <pubDate>Wed, 05 Mar 2025 18:30:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Parsing-nested-JSOn-in-HIVE/m-p/403636#M252138</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2025-03-05T18:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing nested JSOn in HIVE</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Parsing-nested-JSOn-in-HIVE/m-p/405471#M252476</link>
      <description>&lt;P&gt;Thanks for the help and sorry for late reply&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/20288"&gt;@Shelton&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the output here but the values for parent class are not getting populated, they are displayed as NULL&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rich_Learner_0-1743780546240.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/44802iCA047C37972747A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rich_Learner_0-1743780546240.png" alt="Rich_Learner_0-1743780546240.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 15:29:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Parsing-nested-JSOn-in-HIVE/m-p/405471#M252476</guid>
      <dc:creator>Rich_Learner</dc:creator>
      <dc:date>2025-04-04T15:29:16Z</dc:date>
    </item>
  </channel>
</rss>

