<?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: How would i retrieve data JSON data with namespaces using spark SQL? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-would-i-retrieve-data-json-data-with-namespaces-using-spark/m-p/21360#M14550</link>
    <description>&lt;P&gt;HI @Ramesh Bathini​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure what you have tried, but maybe you can try this way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; select `w:document`.`w.body`.`w:p` from ramp&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2022 11:45:00 GMT</pubDate>
    <dc:creator>Pat</dc:creator>
    <dc:date>2022-11-22T11:45:00Z</dc:date>
    <item>
      <title>How would i retrieve data JSON data with namespaces using spark SQL?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-would-i-retrieve-data-json-data-with-namespaces-using-spark/m-p/21359#M14549</link>
      <description>&lt;P&gt;File.json from the below code contains huge JSON data with each key containing namespace prefix(This JSON file converted from the XML file).&lt;/P&gt;&lt;P&gt;I could able to retrieve if JSON does not contain namespaces but what could be the approach to retrieve records/values if each key is with a namespace prefix?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;jsondf = spark.read.json("&amp;lt;path&amp;gt;/file.json")
&amp;nbsp;
#jsondf.printSchema()
jsondf.createOrReplaceTempView("ramp")
&amp;nbsp;
elements = spark.sql("SELECT * FROM ramp")
elements.show()
&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here,I wanted to retrieve records of w: document/w.body/w:p. I tried different ways but nothing is working. Any suggestions really helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1152iFBE1446C666B8922/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1150iE2E5938160D4E473/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 06:17:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-would-i-retrieve-data-json-data-with-namespaces-using-spark/m-p/21359#M14549</guid>
      <dc:creator>rammy</dc:creator>
      <dc:date>2022-11-22T06:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: How would i retrieve data JSON data with namespaces using spark SQL?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-would-i-retrieve-data-json-data-with-namespaces-using-spark/m-p/21360#M14550</link>
      <description>&lt;P&gt;HI @Ramesh Bathini​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure what you have tried, but maybe you can try this way:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; select `w:document`.`w.body`.`w:p` from ramp&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 11:45:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-would-i-retrieve-data-json-data-with-namespaces-using-spark/m-p/21360#M14550</guid>
      <dc:creator>Pat</dc:creator>
      <dc:date>2022-11-22T11:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: How would i retrieve data JSON data with namespaces using spark SQL?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-would-i-retrieve-data-json-data-with-namespaces-using-spark/m-p/21361#M14551</link>
      <description>&lt;P&gt;Thanks alot @Pat Sienkiewicz​&amp;nbsp; for your response. It works for me&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 17:48:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-would-i-retrieve-data-json-data-with-namespaces-using-spark/m-p/21361#M14551</guid>
      <dc:creator>rammy</dc:creator>
      <dc:date>2022-11-22T17:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: How would i retrieve data JSON data with namespaces using spark SQL?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-would-i-retrieve-data-json-data-with-namespaces-using-spark/m-p/21362#M14552</link>
      <description>&lt;P&gt;I case of struct you can use (.) For extracting the value &lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 20:45:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-would-i-retrieve-data-json-data-with-namespaces-using-spark/m-p/21362#M14552</guid>
      <dc:creator>SS2</dc:creator>
      <dc:date>2022-11-29T20:45:22Z</dc:date>
    </item>
  </channel>
</rss>

