<?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: Apache NiFi :  QueryRecord JSON Select child field in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/349048#M235508</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/90327"&gt;@janis-ax&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This reply comes a bit late but I was just researching the same issue. According to the official NiFi documentation, this should be possible using the "RPath" function in the 'Where' clause.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check out the "SQL over hierarchical data" section here:&amp;nbsp;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/latest/org.apache.nifi.processors.standard.QueryRecord/additionalDetails.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/latest/org.apache.nifi.processors.standard.QueryRecord/additionalDetails.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 23:50:26 GMT</pubDate>
    <dc:creator>mkohs</dc:creator>
    <dc:date>2022-07-28T23:50:26Z</dc:date>
    <item>
      <title>Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/320897#M228213</link>
      <description>&lt;P&gt;Is it possible to select with the QueryRecord processor also child fields of an given JSON structrue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. following JSON:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "name" : "Max",
  "id" : 1,
  "location" : {
    "city" : "Frankfurt"
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I would do the following query:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT name, location.city FROM FLOWFILE&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this throws an error:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;QueryRecord[id=a4744340-017a-1000-6944-73fe4d362d90] Unable to query StandardFlowFileRecord[uuid=706e8ae8-f76c-4ebb-9c65-c46cb7026c89,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1626251405764-2, container=default, section=2], offset=790026, length=67],offset=0,name=55b72cfd-5308-4e83-9304-166193e76478,size=67] due to java.sql.SQLException: Error while preparing statement [SELECT "name", "location.city" FROM FLOWFILE]: org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Error while preparing statement [SELECT "name", "location.city" FROM FLOWFILE]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something that I'm doing wrong? Here is the configuration:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="janis-ax_0-1626258776077.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31874i0C3A51DC708AF838/image-size/medium?v=v2&amp;amp;px=400" role="button" title="janis-ax_0-1626258776077.png" alt="janis-ax_0-1626258776077.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 10:33:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/320897#M228213</guid>
      <dc:creator>janis-ax</dc:creator>
      <dc:date>2021-07-14T10:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/321007#M228241</link>
      <description>&lt;P&gt;Your sample query has no "quotes" but the one configured does.&amp;nbsp; Just wanted to make sure you tried without those quotes ?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 14:57:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/321007#M228241</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2021-07-15T14:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/321058#M228247</link>
      <description>&lt;P&gt;I tried both ways. For keys on the root level, it doesn't matter if you use quotes. If I want to access child keys I got following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="janis-ax_0-1626422128111.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31911i7080966037CA7AE0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="janis-ax_0-1626422128111.png" alt="janis-ax_0-1626422128111.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 07:55:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/321058#M228247</guid>
      <dc:creator>janis-ax</dc:creator>
      <dc:date>2021-07-16T07:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/321074#M228251</link>
      <description>&lt;P&gt;Understood, had to make sure!&amp;nbsp; &amp;nbsp; Next for good measure, make sure flow works for just name.&amp;nbsp; This will show you if the issue is the entire setup or with just "location.city".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next look at the configurations for the Reader/Writer and share those for us to see incase they are not default configs,etc.&amp;nbsp; I believe the particular error:&lt;/P&gt;&lt;PRE&gt;SQLException: Error while preparing statement&lt;/PRE&gt;&lt;P&gt;occurs with a schema conflict or issue with flowfile being different than expected schema.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 12:02:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/321074#M228251</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2021-07-16T12:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/321081#M228256</link>
      <description>&lt;P&gt;For only "name", it's working fine, I get following FlowFile content:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="janis-ax_0-1626440525178.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31916iCE223E3BE82A8E4E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="janis-ax_0-1626440525178.png" alt="janis-ax_0-1626440525178.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess the issue is within the ControllerServices. I used JSON-TreeReader but with default configuration:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="janis-ax_1-1626440579211.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/31917iD9DFFD1EE3E2752A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="janis-ax_1-1626440579211.png" alt="janis-ax_1-1626440579211.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 13:03:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/321081#M228256</guid>
      <dc:creator>janis-ax</dc:creator>
      <dc:date>2021-07-16T13:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/349048#M235508</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/90327"&gt;@janis-ax&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This reply comes a bit late but I was just researching the same issue. According to the official NiFi documentation, this should be possible using the "RPath" function in the 'Where' clause.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check out the "SQL over hierarchical data" section here:&amp;nbsp;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/latest/org.apache.nifi.processors.standard.QueryRecord/additionalDetails.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/latest/org.apache.nifi.processors.standard.QueryRecord/additionalDetails.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 23:50:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/349048#M235508</guid>
      <dc:creator>mkohs</dc:creator>
      <dc:date>2022-07-28T23:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/349211#M235560</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/17615"&gt;@mkohs&lt;/a&gt;&amp;nbsp;mentioned, using the RPATH function is the way to go here.&lt;/P&gt;&lt;P&gt;It can be used on the SELECT clause, for projection, as well as on the WHERE cause, for filtering.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see a similar use of it in this post here:&amp;nbsp;&lt;A href="https://community.cloudera.com/t5/Support-Questions/QueryRecord-processor-issue-with-nested-JSON/td-p/338556" target="_blank"&gt;https://community.cloudera.com/t5/Support-Questions/QueryRecord-processor-issue-with-nested-JSON/td-p/338556&lt;/A&gt;&lt;/P&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 01:09:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/349211#M235560</guid>
      <dc:creator>araujo</dc:creator>
      <dc:date>2022-08-01T01:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/349377#M235633</link>
      <description>&lt;P&gt;Thanks this works! I just have to use RPATH_STRING&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 15:11:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/349377#M235633</guid>
      <dc:creator>janis-ax</dc:creator>
      <dc:date>2022-08-02T15:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/372192#M241177</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/17615"&gt;@mkohs&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using QueryRecord processor and using SQL len function in the select statement. However, the processor results with the below error: "No match found for function signature len(CHARACTER)"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kiranq_2-1686051694984.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/37732iD143EB69651BAFAA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kiranq_2-1686051694984.png" alt="Kiranq_2-1686051694984.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is this the processor specific error because the same sql statement in running fine in sql server.&amp;nbsp;&lt;BR /&gt;Any help would be appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 11:45:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/372192#M241177</guid>
      <dc:creator>Kiranq</dc:creator>
      <dc:date>2023-06-06T11:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/372200#M241179</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Nifi QueryRecord uses Apache Calcite SQL. Per the documentation (&lt;A href="https://calcite.apache.org/docs/reference.html" target="_blank"&gt;https://calcite.apache.org/docs/reference.html&lt;/A&gt; ) you can use either &lt;STRONG&gt;CHAR_LENGTH&lt;/STRONG&gt; or &lt;STRONG&gt;CHARACTER_LENGTH&lt;/STRONG&gt; to get the string size. Both functions seem to have the same behavior according to the documentation.&lt;/P&gt;&lt;P&gt;If you find this helpful please accept solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 13:24:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/372200#M241179</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-06-06T13:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi :  QueryRecord JSON Select child field</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/372234#M241189</link>
      <description>&lt;P&gt;This worked. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 08:58:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-QueryRecord-JSON-Select-child-field/m-p/372234#M241189</guid>
      <dc:creator>Kiranq</dc:creator>
      <dc:date>2023-06-07T08:58:51Z</dc:date>
    </item>
  </channel>
</rss>

