<?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: How to use SQL within a QueryRecord Processor to query an Avro Schema in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/305095#M222313</link>
    <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I am trying some stuff now to parse data using the JoltSpec/JoltTransformJSON processor that could help me with this issue, but thanks for this help, hopefully can get things running more smoothly soon. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Oct 2020 14:54:48 GMT</pubDate>
    <dc:creator>robnew666</dc:creator>
    <dc:date>2020-10-29T14:54:48Z</dc:date>
    <item>
      <title>How to use SQL within a QueryRecord Processor to query an Avro Schema</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/304912#M222253</link>
      <description>&lt;P&gt;I am trying to reference an Avro Schema that already works from a CEF file and take out a part of that file (time as rt) by referencing the Schema, but I am a bit rusty with my SQL so it's not going to plan rn - does anyone have any examples of doing this in NiFi?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 11:23:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/304912#M222253</guid>
      <dc:creator>robnew666</dc:creator>
      <dc:date>2026-04-21T11:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SQL within a QueryRecord Processor to query an Avro Schema</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/304981#M222264</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/82383"&gt;@robnew666&lt;/a&gt;&amp;nbsp; &amp;nbsp;You should provide more information in order for community members to respond with specific details.&amp;nbsp; Without seeing schema, sample data, what you have, etc, we have little to go off.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That said below is an example of query record with a query.&amp;nbsp; The important theory here is to use + to add new queries and use SELECT * FROM FLOWFILE.&amp;nbsp; You can add WHERE [your query logic here] to operate agains schema columns just like SQL.&amp;nbsp; You can have more than 1 query and route them separately down stream.&amp;nbsp; So for testing start with your first query1 (result) like below.&amp;nbsp; Next begin to add WHERE and operate against your requirements.&amp;nbsp; As you further advance your query, make new query2, query3, working methodically towards what works.&amp;nbsp; When done, delete the test queries you do not need and then route the final query downstream.&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-center" image-alt="Screen Shot 2020-10-28 at 8.48.45 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/29278i4BC7CEF2FAF08579/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-10-28 at 8.48.45 AM.png" alt="Screen Shot 2020-10-28 at 8.48.45 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Steven&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 12:54:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/304981#M222264</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2020-10-28T12:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SQL within a QueryRecord Processor to query an Avro Schema</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/305057#M222297</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant put any data up here, but I think we are getting close.&amp;nbsp; I can pull all data through which then marries it up with the schema, so it is formatted as data associated with the schema. I am then wondering how I can then add another QueryRecord Processor below which I can then add individual sql lines which can pull out coloumns from this data, ie &lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;SELECT *, FROM FLOWFILE &lt;SPAN class="token keyword"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;table_name&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'rt'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 10:20:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/305057#M222297</guid>
      <dc:creator>robnew666</dc:creator>
      <dc:date>2020-10-29T10:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SQL within a QueryRecord Processor to query an Avro Schema</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/305070#M222305</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/82383"&gt;@robnew666&lt;/a&gt;&amp;nbsp; &amp;nbsp;yes you can do that, you just need to experiment with SQL statements that satisfy your requirements.&amp;nbsp; You should work on some tests and inspect what you get in the flowfile after a select *.&amp;nbsp; This will depend on your reader, etc.&amp;nbsp; &amp;nbsp;You can also have multiples QueryRecord Processors but dont forget it is possible to have multiple queries in a single processor.&amp;nbsp; The key you use to hold the query will become a route out of the processor downstream.&amp;nbsp; For example you could select all results that match a certain condition, and separate those from the rest.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 12:28:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/305070#M222305</guid>
      <dc:creator>stevenmatison</dc:creator>
      <dc:date>2020-10-29T12:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use SQL within a QueryRecord Processor to query an Avro Schema</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/305095#M222313</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I am trying some stuff now to parse data using the JoltSpec/JoltTransformJSON processor that could help me with this issue, but thanks for this help, hopefully can get things running more smoothly soon. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 14:54:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-SQL-within-a-QueryRecord-Processor-to-query-an/m-p/305095#M222313</guid>
      <dc:creator>robnew666</dc:creator>
      <dc:date>2020-10-29T14:54:48Z</dc:date>
    </item>
  </channel>
</rss>

