<?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>topic Re: facing format issue while converting one type nested json to other brand new json schema in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33595#M24566</link>
    <description>&lt;P&gt;@&lt;A href="https://community.databricks.com/s/profile/0053f000000WW82AAG" alt="https://community.databricks.com/s/profile/0053f000000WW82AAG" target="_blank"&gt;HubertDudek&lt;/A&gt;&amp;nbsp;, @werners&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to resolve the above one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Thu, 09 Dec 2021 06:20:23 GMT</pubDate>
    <dc:creator>SailajaB</dc:creator>
    <dc:date>2021-12-09T06:20:23Z</dc:date>
    <item>
      <title>facing format issue while converting one type nested json to other brand new json schema</title>
      <link>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33591#M24562</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are writing our flatten json dataframe to user defined nested schema json using pysprk in Databricks.But we are not getting the expected format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expecting : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{"ID":"aaa",c_id":[{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"1"},{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"2"},{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"3"}]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But Getting :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{"ID":"aaa",c_id":{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"1"}},&lt;/P&gt;&lt;P&gt;{"ID":"aaa",c_id":{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"2"}},&lt;/P&gt;&lt;P&gt;{"ID":"aaa",c_id":{"con":null,"createdate":"2015-10-09T00:00:00Z","data":null,"id":"3"}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried with group_by and collect list but not getting in expected format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone please help us is there any way to achieve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 05:50:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33591#M24562</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-12-08T05:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: facing format issue while converting one type nested json to other brand new json schema</title>
      <link>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33592#M24563</link>
      <description>&lt;P&gt;I don't know what your code is, so you should probably share it.&lt;/P&gt;&lt;P&gt;And also the starting json&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 08:43:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33592#M24563</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-12-08T08:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: facing format issue while converting one type nested json to other brand new json schema</title>
      <link>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33593#M24564</link>
      <description>&lt;P&gt;as @wereners said you need to share the code. If it is dataframe to json probably you need to use StructType - Array to get that list but without code is hard to help.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 10:24:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33593#M24564</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2021-12-08T10:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: facing format issue while converting one type nested json to other brand new json schema</title>
      <link>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33594#M24565</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the reply..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I am sharing the code piece &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df_global_op=df_global.withColumn("Definitions",struct((df_global.id).alias("ID"),\&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;struct((df_global.a).alias("con"),\&lt;/P&gt;&lt;P&gt; (df_global.b).alias("createdate"),\&lt;/P&gt;&lt;P&gt; (df_global.c).alias("data"),\&lt;/P&gt;&lt;P&gt; (df_global.d).alias("id")).\&lt;/P&gt;&lt;P&gt; alias("c_id"))).\&lt;/P&gt;&lt;P&gt;drop(*global_fields).select("Definitions.*").distinct().write.\&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;format("json").\&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;option("ignoreNullFields", "false").\&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;save("/mnt/test/op/12-08-2021")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please be noted df_global is a flatten df of input json.. Here we are deriving output json on top of flatten one based on requested schema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 12:17:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33594#M24565</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-12-08T12:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: facing format issue while converting one type nested json to other brand new json schema</title>
      <link>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33595#M24566</link>
      <description>&lt;P&gt;@&lt;A href="https://community.databricks.com/s/profile/0053f000000WW82AAG" alt="https://community.databricks.com/s/profile/0053f000000WW82AAG" target="_blank"&gt;HubertDudek&lt;/A&gt;&amp;nbsp;, @werners&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to resolve the above one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 06:20:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/facing-format-issue-while-converting-one-type-nested-json-to/m-p/33595#M24566</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-12-09T06:20:23Z</dc:date>
    </item>
  </channel>
</rss>

