Conversation
bakaid
left a comment
There was a problem hiding this comment.
Please see my inline comments, some are minor, some are important.
After the build fixes I have been able to use a mysql ODBC driver on macOS to connect to a mysql instance and the processor seems to work alright, there is some good stuff in here!
Attached are all the fixes in a patch file (they are also added as inline comments, but this might be easier to use):
sql-extension-patch.txt
a43582a to
7dc002e
Compare
|
@phrocker Fixed attribution. |
|
Added PutSQL implementation. |
extensions/sql/processors/PutSQL.cpp
Outdated
| if (connection) { | ||
| const auto dbSession = connection->getSession(); | ||
|
|
||
| try { |
There was a problem hiding this comment.
What are we supposed to do here?
Given the name (PutSQL) I would expect content of flowfiles to be put to the DB.
Although I don't see any sign of that in the code, we only execute the statements provided by the user.
Have a success relationship hardly makes sense, but I think we should have a failure and work as:
-Send to success in case we could properly execute the put.
-Send to failure in case SQL operation failed. (Optional rollback here)
Please take a look at PutSQL in NiFi:
https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.6.0/org.apache.nifi.processors.standard.PutSQL/
Especially the flowfile-dependent attributes it reads.
arpadboda
left a comment
There was a problem hiding this comment.
Far from getting to the end.
Added some comments. Please also address the older ones in case they are still valid.
…ixes for soci.
1fb58fc to
a7b80a2
Compare
bakaid
left a comment
There was a problem hiding this comment.
Releasing what I have so far. I have marked the most important comments with (!). Did not yet review QueryDatabaseTable, and did not test anything so far.
| @@ -0,0 +1,134 @@ | |||
| /** | |||
| * @file PutSQL.cpp | |||
There was a problem hiding this comment.
(!) Is this processor finished? It seems to be equivalent to ExecuteSQL, as it gets a bunch of statements as a Property. With PutSQL the statement should be contained in the FlowFile content and substitutions should be made based on FF-attributes: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.10.0/org.apache.nifi.processors.standard.PutSQL/
bakaid
left a comment
There was a problem hiding this comment.
Reviewing and testing - not nearly finished, but releasing what I have before going to lunch.
bakaid
left a comment
There was a problem hiding this comment.
Releasing the next batch.
…ts like Avro in addition to JSON.
…inifi-cpp into minifi-1013-soci
|
@am-c-p-p do we need this PR? |
|
@arpadboda Yes, we need it. It is reviewed by @bakaid and pending testing before merging to apache. |
|
@arpadboda @am-c-p-p The diff on this PR currently looks like this: |
|
@bakaid @arpadboda Instead of this PR please review new #732. |
|
@amarmer Closing this, feel free to reopen if it is relevant after all. |

Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically master)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.