<legend id='Dx4O4'><style id='Dx4O4'><dir id='Dx4O4'><q id='Dx4O4'></q></dir></style></legend>

    1. <tfoot id='Dx4O4'></tfoot>
      • <bdo id='Dx4O4'></bdo><ul id='Dx4O4'></ul>

    2. <small id='Dx4O4'></small><noframes id='Dx4O4'>

      1. <i id='Dx4O4'><tr id='Dx4O4'><dt id='Dx4O4'><q id='Dx4O4'><span id='Dx4O4'><b id='Dx4O4'><form id='Dx4O4'><ins id='Dx4O4'></ins><ul id='Dx4O4'></ul><sub id='Dx4O4'></sub></form><legend id='Dx4O4'></legend><bdo id='Dx4O4'><pre id='Dx4O4'><center id='Dx4O4'></center></pre></bdo></b><th id='Dx4O4'></th></span></q></dt></tr></i><div id='Dx4O4'><tfoot id='Dx4O4'></tfoot><dl id='Dx4O4'><fieldset id='Dx4O4'></fieldset></dl></div>

        putSql处理器后executeSql失败

        时间:2023-08-22

          <bdo id='UQCDb'></bdo><ul id='UQCDb'></ul>
        • <i id='UQCDb'><tr id='UQCDb'><dt id='UQCDb'><q id='UQCDb'><span id='UQCDb'><b id='UQCDb'><form id='UQCDb'><ins id='UQCDb'></ins><ul id='UQCDb'></ul><sub id='UQCDb'></sub></form><legend id='UQCDb'></legend><bdo id='UQCDb'><pre id='UQCDb'><center id='UQCDb'></center></pre></bdo></b><th id='UQCDb'></th></span></q></dt></tr></i><div id='UQCDb'><tfoot id='UQCDb'></tfoot><dl id='UQCDb'><fieldset id='UQCDb'></fieldset></dl></div>
            <tbody id='UQCDb'></tbody>
            • <small id='UQCDb'></small><noframes id='UQCDb'>

                  <tfoot id='UQCDb'></tfoot>

                • <legend id='UQCDb'><style id='UQCDb'><dir id='UQCDb'><q id='UQCDb'></q></dir></style></legend>
                • 本文介绍了putSql处理器后executeSql失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我的用例是查询一组表的一组数据并将其插入到一个表中.所以我的 nifi 处理器基本上是这样的:

                  my use case is to query a set of data for bunch of table and insert it into one table. so my nifi processor basically is like this:

                  executeSql(查询数据集) >>> convertAvrotoJson >>>> convetJSONtoSQL(转换为插入语句) >>>> putSQL (插入语句) >>> executeSQL(删除与第一个处理器查询相关的行表)

                  executeSql(query set of dataset) >>> convertAvrotoJson >>>> convetJSONtoSQL(convert to insert statement) >>>> putSQL (insert statement) >>> executeSQL(delete a row associated with first processor query in set of table)

                  问题出在最后一个 executeSQL 处理器中,当它没有执行我的 sql 时,它一直试图运行 putSQL 查询.

                  the problem is in the last executeSQL processor, when its not executing my sql, instead it keep trying to run putSQL query.

                  为了测试(这是在executeSQL中),我只用一个普通的选择替换了我的删除查询:

                  i replace my delete query with just a normal select for the sake of testing (this is in the executeSQL) :

                  这是 executeSQL 的数据来源,我们可以清楚地看到它仍在尝试执行来自 putSQL 的插入语句,即使我已经指定只执行查询:

                  and this is the data provenance for executeSQL, we can clearly see its still trying to execute the insert statement coming from putSQL even i already specified to just do a query:

                  这是错误,错误清楚地表明我没有提供参数,而我显然不希望它执行插入语句:

                  and this is the error, the error clearly say i didnt provide parameter when im clearly dont want it to execute an insert statement:

                  如何在表 A 中成功插入记录后在表 B 上执行删除语句?请帮助我坚持这一点.请不要与图像混淆,因为我只是用普通选择测试它以确保 nifi 可以正确执行我的查询.我使用的是 mysql 5.7

                  how to execute a delete statement on table B after i successfully insert a record in Table A? please help as im stuck at this. please dont get confuse with the image, as im just testing it with normal select to ensure that nifi can execute my query correctly. im using mysql 5.7

                  推荐答案

                  如果流文件上有 sql.args 属性,则 ExecuteSQL 将尝试使用它们用参数填充 PreparedStatement.这是因为指定的查询(无论是通过流文件正文还是通过 SQL 选择查询 属性传入)可以具有 ? 参数,由流文件属性填充.对于上面的流程,您可以在 PutSQL 和 ExecuteSQL 之间放置一个 UpdateAttribute 处理器,将 Delete Attributes Expression 属性设置为 sql\.args\..* 或其他内容,以删除参数.

                  If there are sql.args attributes on the flow file, ExecuteSQL will attempt to use them to populate a PreparedStatement with parameters. This is because the specified query (whether coming in via the flowfile body or the SQL select query property) can have ? parameters, to be filled in by the flow file attributes. For your flow above, you could put an UpdateAttribute processor between the PutSQL and ExecuteSQL, setting the Delete Attributes Expression property to sql\.args\..* or something, to remove the parameters.

                  话虽如此,我建议您将整个流程替换为 ExecuteSQL -> PutDatabaseRecord -> ExecuteSQL.这绕过了转换逻辑,SQL 生成/执行在内部完成(因此不需要 sql.args 属性).

                  Having said that, I recommend you replace your whole flow with ExecuteSQL -> PutDatabaseRecord -> ExecuteSQL. This bypasses the conversion logic and the SQL generation/execution is done internally (so no need for sql.args attributes).

                  这篇关于putSql处理器后executeSql失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:covertJSONtoSQL 在 NiFi 中返回空值 下一篇:Apache Nifi 如何使用嵌套数组 JSON 加载 JSON 并调用

                  相关文章

                  最新文章

                    <legend id='Hwc1j'><style id='Hwc1j'><dir id='Hwc1j'><q id='Hwc1j'></q></dir></style></legend><tfoot id='Hwc1j'></tfoot>

                  1. <small id='Hwc1j'></small><noframes id='Hwc1j'>

                  2. <i id='Hwc1j'><tr id='Hwc1j'><dt id='Hwc1j'><q id='Hwc1j'><span id='Hwc1j'><b id='Hwc1j'><form id='Hwc1j'><ins id='Hwc1j'></ins><ul id='Hwc1j'></ul><sub id='Hwc1j'></sub></form><legend id='Hwc1j'></legend><bdo id='Hwc1j'><pre id='Hwc1j'><center id='Hwc1j'></center></pre></bdo></b><th id='Hwc1j'></th></span></q></dt></tr></i><div id='Hwc1j'><tfoot id='Hwc1j'></tfoot><dl id='Hwc1j'><fieldset id='Hwc1j'></fieldset></dl></div>
                      <bdo id='Hwc1j'></bdo><ul id='Hwc1j'></ul>