<?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: QueryRecord processor issue with nested JSON in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/QueryRecord-processor-issue-with-nested-JSON/m-p/338647#M232884</link>
    <description>&lt;P&gt;Thank you Araujo. This has helped a lot.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Mar 2022 06:19:39 GMT</pubDate>
    <dc:creator>Onkar_Gagre</dc:creator>
    <dc:date>2022-03-15T06:19:39Z</dc:date>
    <item>
      <title>QueryRecord processor issue with nested JSON</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryRecord-processor-issue-with-nested-JSON/m-p/338556#M232846</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am facing issue accessing one of the child json attribute while forming SQL in QureyRecord processor. PFB details&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my Avro schema added for JSON reader and writter.&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"name": "MyClass",&lt;BR /&gt;"type": "record",&lt;BR /&gt;"namespace": "com.acme.avro",&lt;BR /&gt;"fields": [&lt;BR /&gt;{&lt;BR /&gt;"name": "labels",&lt;BR /&gt;"type": {&lt;BR /&gt;"name": "labels",&lt;BR /&gt;"type": "record",&lt;BR /&gt;"fields": [&lt;BR /&gt;{&lt;BR /&gt;"name": "__name__",&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "cucsMemoryUnitInstanceId",&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "instance",&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "job",&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "monitor",&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "site_identifier",&lt;BR /&gt;"type": "string"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "name",&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "timestamp",&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "value",&lt;BR /&gt;"type": "string"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "producedAt",&lt;BR /&gt;"type": "string"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now the SQL quary for first level attribute works fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like SELECT * from FLOWFILE where name = 'xyz'&amp;nbsp; &amp;nbsp;or&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT * from FLOWFILE where&amp;nbsp;producedAt = 'dd-mm-yyyy'&lt;/P&gt;&lt;P&gt;however If I have to access attribute of nested JSON it wont work&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g&lt;/P&gt;&lt;P&gt;SELECT * from FLOWFILE where&amp;nbsp;site_identifier = 'xyz'&amp;nbsp; &amp;nbsp; --&amp;gt; This throws the error.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 08:01:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryRecord-processor-issue-with-nested-JSON/m-p/338556#M232846</guid>
      <dc:creator>Onkar_Gagre</dc:creator>
      <dc:date>2022-03-14T08:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: QueryRecord processor issue with nested JSON</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryRecord-processor-issue-with-nested-JSON/m-p/338618#M232877</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/96402"&gt;@Onkar_Gagre&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use a Record Path expression to do what you want in a QueryRecord processor. Please try the example below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT *
FROM FLOWFILE
WHERE RPATH(labels, '/site_identifier') = 'xyz'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;André&lt;/P&gt;&lt;P&gt;&lt;EM&gt;--&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Was your question answered? Please take some time to click on "&lt;STRONG&gt;Accept as Solution&lt;/STRONG&gt;" below this post.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;If you find a reply useful, say thanks by clicking on the thumbs up button.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 02:14:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryRecord-processor-issue-with-nested-JSON/m-p/338618#M232877</guid>
      <dc:creator>araujo</dc:creator>
      <dc:date>2022-03-15T02:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: QueryRecord processor issue with nested JSON</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryRecord-processor-issue-with-nested-JSON/m-p/338647#M232884</link>
      <description>&lt;P&gt;Thank you Araujo. This has helped a lot.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 06:19:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryRecord-processor-issue-with-nested-JSON/m-p/338647#M232884</guid>
      <dc:creator>Onkar_Gagre</dc:creator>
      <dc:date>2022-03-15T06:19:39Z</dc:date>
    </item>
  </channel>
</rss>

