<?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 I am trying to read nested data from json file to put it into streaming table using dlt in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/i-am-trying-to-read-nested-data-from-json-file-to-put-it-into/m-p/61380#M31776</link>
    <description>&lt;P&gt;So i have this nested data with more than 200+columns and i have extracted this data into json file&amp;nbsp;&lt;BR /&gt;when i use the below code to read the json files, if in data there are few columns which have no value at all it doest inclued those columns in schema .&lt;/P&gt;&lt;P&gt;from pyspark.sql import SparkSession&lt;BR /&gt;spark = (&lt;BR /&gt;SparkSession.builder.master("local[1]")&lt;BR /&gt;.config("spark.sql.jsonGenerator.ignoreNullFields", "false")&lt;BR /&gt;).getOrCreate()&lt;BR /&gt;# Create a SparkSession&lt;/P&gt;&lt;P&gt;df=spark.read.option("multiline","true").option("inferschema","true").json("file.json")&lt;BR /&gt;df.printSchema()&lt;/P&gt;&lt;P&gt;i can create schema and read it that will solve the issue i guess&amp;nbsp;&lt;BR /&gt;but wanted to know if there is any alternate approach to this&amp;nbsp;&lt;BR /&gt;Also can anyone help me with how to write this nested data to streaming table in bronze layer&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2024 16:29:20 GMT</pubDate>
    <dc:creator>zero234</dc:creator>
    <dc:date>2024-02-21T16:29:20Z</dc:date>
    <item>
      <title>I am trying to read nested data from json file to put it into streaming table using dlt</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-trying-to-read-nested-data-from-json-file-to-put-it-into/m-p/61380#M31776</link>
      <description>&lt;P&gt;So i have this nested data with more than 200+columns and i have extracted this data into json file&amp;nbsp;&lt;BR /&gt;when i use the below code to read the json files, if in data there are few columns which have no value at all it doest inclued those columns in schema .&lt;/P&gt;&lt;P&gt;from pyspark.sql import SparkSession&lt;BR /&gt;spark = (&lt;BR /&gt;SparkSession.builder.master("local[1]")&lt;BR /&gt;.config("spark.sql.jsonGenerator.ignoreNullFields", "false")&lt;BR /&gt;).getOrCreate()&lt;BR /&gt;# Create a SparkSession&lt;/P&gt;&lt;P&gt;df=spark.read.option("multiline","true").option("inferschema","true").json("file.json")&lt;BR /&gt;df.printSchema()&lt;/P&gt;&lt;P&gt;i can create schema and read it that will solve the issue i guess&amp;nbsp;&lt;BR /&gt;but wanted to know if there is any alternate approach to this&amp;nbsp;&lt;BR /&gt;Also can anyone help me with how to write this nested data to streaming table in bronze layer&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 16:29:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-trying-to-read-nested-data-from-json-file-to-put-it-into/m-p/61380#M31776</guid>
      <dc:creator>zero234</dc:creator>
      <dc:date>2024-02-21T16:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to read nested data from json file to put it into streaming table using dlt</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-trying-to-read-nested-data-from-json-file-to-put-it-into/m-p/61391#M31780</link>
      <description>&lt;P&gt;replying to my above question&lt;BR /&gt;we cannot use inferschema on streaming table we need to externally specify schema&amp;nbsp;&lt;BR /&gt;can anyone please suggest a way to write data in nested form to streaming table and if this is possible?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 18:57:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-trying-to-read-nested-data-from-json-file-to-put-it-into/m-p/61391#M31780</guid>
      <dc:creator>zero234</dc:creator>
      <dc:date>2024-02-21T18:57:30Z</dc:date>
    </item>
  </channel>
</rss>

