<?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: NiFi Error on QueryRecord in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Error-on-QueryRecord/m-p/289413#M214231</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38301"&gt;@mburgess&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am facing the same error. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Am a beginner in Nifi, and trying out some example use-cases available over internet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying out "&lt;SPAN&gt;Real-Time SQL On Event Streams"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Use case: CSV to Json Conversion&lt;/P&gt;&lt;P&gt;CSV is like :&lt;/P&gt;&lt;P&gt;purchase_no, customer_id, item_id, item_name, price, quantity&lt;BR /&gt;10280, 40070, 1028, Box of pencils, 6.99, 2&lt;BR /&gt;10280, 40070, 4402, Stapler, 12.99, 1&lt;BR /&gt;12440, 28302, 1029, Box of ink pens, 8.99, 1&lt;BR /&gt;28340, 41028, 1028, Box of pencils, 6.99, 18&lt;BR /&gt;28340, 41028, 1029, Box of ink pens, 8.99, 18&lt;BR /&gt;28340, 41028, 2038, Printer paper, 14.99, 10&lt;BR /&gt;28340, 41028, 4018, Clear tape, 2.99, 10&lt;BR /&gt;28340, 41028, 3329, Tape dispenser, 14.99, 10&lt;BR /&gt;28340, 41028, 5192, Envelopes, 4.99, 45&lt;BR /&gt;28340, 41028, 3203, Laptop Computer, 978.88, 2&lt;BR /&gt;28340, 41028, 2937, 24\" Monitor, 329.98, 2&lt;BR /&gt;49102, 47208, 3204, Powerful Laptop Computer, 1680.99, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and my schema looks like:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"name": "helloWorld",&lt;BR /&gt;"namespace": "org.apache.nifi.blogs",&lt;BR /&gt;"type": "record",&lt;BR /&gt;"fields": [&lt;BR /&gt;{ "name": "purchase_no", "type": "long" },&lt;BR /&gt;{ "name": "customer_id", "type": "long" },&lt;BR /&gt;{ "name": "item_id", "type": ["null", "long"] },&lt;BR /&gt;{ "name": "item_name", "type": ["null", "string"] },&lt;BR /&gt;{ "name": "price", "type": ["null", "double"] },&lt;BR /&gt;{ "name": "quantity", "type": ["null", "int"] },&lt;BR /&gt;{ "name": "total_price", "type": ["null", "double"] }&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made sure that all the field type is matched, still facing the below error.&lt;/P&gt;&lt;P&gt;ERROR 418b70f8-b8a3-3b60-5042-85ad82a7bf72&lt;BR /&gt;QueryRecord[id=418b70f8-b8a3-3b60-5042-85ad82a7bf72] Unable to query StandardFlowFileRecord[uuid=80edfc74-9637-4eaa-abcb-ad2444f1c2da,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1580960212569-1, container=default, section=1], offset=4270, length=599],offset=0,name=80edfc74-9637-4eaa-abcb-ad2444f1c2da,size=599] due to Failed to read next record in stream for StandardFlowFileRecord[uuid=80edfc74-9637-4eaa-abcb-ad2444f1c2da,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1580960212569-1, container=default, section=1], offset=4270, length=599],offset=0,name=80edfc74-9637-4eaa-abcb-ad2444f1c2da,size=599] due to Error while getting next record. Root cause: java.lang.NumberFormatException: For input string: "purchase_no, customer_id, item_id, item_name, price, quantity": org.apache.nifi.processor.exception.ProcessException: Failed to read next record in stream for StandardFlowFileRecord[uuid=80edfc74-9637-4eaa-abcb-ad2444f1c2da,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1580960212569-1, container=default, section=1], offset=4270, length=599],offset=0,name=80edfc74-9637-4eaa-abcb-ad2444f1c2da,size=599] due to Error while getting next record. Root cause: java.lang.NumberFormatException: For input string: "purchase_no, customer_id, item_id, item_name, price, quantity"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Queries are as below: [added below as attributes in QueruRecord Processor to query ]&lt;/P&gt;&lt;P&gt;Query 1:&amp;nbsp; Will include the purchase_no and customer_id fields of any purchase that cost more than $1,000.00 and will also include a new field named total_price that is the dollar amount for the entire purchase.&lt;/P&gt;&lt;P&gt;Property name : "over.1000"&lt;/P&gt;&lt;P&gt;Value : SELECT purchase_no, customer_id, SUM(price * quantity) AS total_priceFROM FLOWFILEGROUP BY purchase_no, customer_idHAVING SUM(price * quantity) &amp;gt; 1000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query 2: Will contain the purchase_no, customer_id, and total price of the most expensive single purchase (as defined by price times quantity) in the data:&amp;nbsp;Property : "largest.order"&amp;nbsp;&amp;nbsp;Value : SELECT purchase_no, customer_id, SUM(price * quantity) AS total_priceFROM FLOWFILEGROUP BY purchase_no, customer_idORDER BY total_price DESCLIMIT 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 09 Feb 2020 16:09:40 GMT</pubDate>
    <dc:creator>Sush217</dc:creator>
    <dc:date>2020-02-09T16:09:40Z</dc:date>
  </channel>
</rss>

