<?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 Ways to validate final Dataframe schema  against JSON schema config file in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/ways-to-validate-final-dataframe-schema-against-json-schema/m-p/29145#M20902</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have to validate transformed dataframe output schema with json schema config file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the scenario &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our input json schema and target json schema are different. Using Databricks we are doing the required schema changes. Now, we need to validate final dataframe schema against target JSON schema config file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : JSON schema is very complex (it contains upto 7 level differences between input and output)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried with few python libraries but all are working fine for simple schemas without any issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are looking for an approach like if we have any way to convert complex JSON schema config to sample json data (i.e target json schema config) so we can easily validate against final dataframe schema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Feb 2022 13:07:00 GMT</pubDate>
    <dc:creator>SailajaB</dc:creator>
    <dc:date>2022-02-08T13:07:00Z</dc:date>
    <item>
      <title>Ways to validate final Dataframe schema  against JSON schema config file</title>
      <link>https://community.databricks.com/t5/data-engineering/ways-to-validate-final-dataframe-schema-against-json-schema/m-p/29145#M20902</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have to validate transformed dataframe output schema with json schema config file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the scenario &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our input json schema and target json schema are different. Using Databricks we are doing the required schema changes. Now, we need to validate final dataframe schema against target JSON schema config file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : JSON schema is very complex (it contains upto 7 level differences between input and output)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried with few python libraries but all are working fine for simple schemas without any issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are looking for an approach like if we have any way to convert complex JSON schema config to sample json data (i.e target json schema config) so we can easily validate against final dataframe schema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 13:07:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ways-to-validate-final-dataframe-schema-against-json-schema/m-p/29145#M20902</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2022-02-08T13:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Ways to validate final Dataframe schema  against JSON schema config file</title>
      <link>https://community.databricks.com/t5/data-engineering/ways-to-validate-final-dataframe-schema-against-json-schema/m-p/29146#M20903</link>
      <description>&lt;P&gt;Hello, for several levels you can use the functions &lt;B&gt;explode&lt;/B&gt;(&lt;B&gt;array&lt;/B&gt;(desired-level)).&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/* A little bit for your understanding. */
df =   testDF\
.withColumn("company",explode(array("company")))\
.withColumn("employees",explode(array("company.employees")))\&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 21:56:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ways-to-validate-final-dataframe-schema-against-json-schema/m-p/29146#M20903</guid>
      <dc:creator>weldermartins</dc:creator>
      <dc:date>2022-02-08T21:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Ways to validate final Dataframe schema  against JSON schema config file</title>
      <link>https://community.databricks.com/t5/data-engineering/ways-to-validate-final-dataframe-schema-against-json-schema/m-p/29147#M20904</link>
      <description>&lt;P&gt;Hi @welder martins​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your reply..&lt;/P&gt;&lt;P&gt;We are looking for ways to validate the output dataframe schema against the JSON schema config.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope above one will be useful if we need to flatten the nested json structure.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 04:31:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ways-to-validate-final-dataframe-schema-against-json-schema/m-p/29147#M20904</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2022-02-09T04:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Ways to validate final Dataframe schema  against JSON schema config file</title>
      <link>https://community.databricks.com/t5/data-engineering/ways-to-validate-final-dataframe-schema-against-json-schema/m-p/29148#M20905</link>
      <description>&lt;P&gt;@Sailaja B​&amp;nbsp;- Hi! My name is Piper, and I'm a moderator for the community. Thanks for your question. Please let us know how things go. If @welder martins​' response answers your question, would you be happy to come back and mark their answer as best? That will help other members find the answer more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 15:57:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/ways-to-validate-final-dataframe-schema-against-json-schema/m-p/29148#M20905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-09T15:57:39Z</dc:date>
    </item>
  </channel>
</rss>

