简体   繁体   中英

Apache NIFI "Execute Processor"

Can Apache NIFI "ExecuteSQL Processor" stream large set of select result in chunks say 'x' MB?

The ExecuteSQL Processor can "stream" large numbers of rows in the sense that it will stream the data directly to FlowFile content (which will not be held in-memory/heap) so it is very memory efficient. It does not, at this time, chunk the results, though. There is a ticket https://issues.apache.org/jira/browse/NIFI-1251 to provide such capabilities, though.

现在,您可以使用通过“每个流文件的最大行数”属性支持分块的QueryDatabaseTable处理器。

You can also specify a limit statement in the SQL itself (along with a sort by ID), pull one batch, get the last ID, pull all >max(id), repeat until done, ie

                                       Start
                                         |
    UpdateAttr: maxid--------- SQL ... $maxid:isEmpty():ifElse('', 'where id>maxid') order by id limit n
           |_____________________________|
                                         |
                                        do sth

it's by # records and not size - but knowing the approx size per record, you can still do it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM