Skip to content

Comments

MINIFI-1013 Used soci library.#656

Closed
am-c-p-p wants to merge 90 commits intoapache:masterfrom
am-c-p-p:minifi-1013-soci
Closed

MINIFI-1013 Used soci library.#656
am-c-p-p wants to merge 90 commits intoapache:masterfrom
am-c-p-p:minifi-1013-soci

Conversation

@am-c-p-p
Copy link

@am-c-p-p am-c-p-p commented Oct 1, 2019

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:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

Copy link
Contributor

@arpadboda arpadboda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks to be a nice work, thanks!
Questionable points for me are:
-Linux compilation
-Parallel onTrigger calls, connection reuse

Some minor comments as well, but those are low hanging fruits.

Copy link
Contributor

@bakaid bakaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

@phrocker phrocker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the attribution of these commits is correct. That should be addressed before merge to be safe. Feel free to correct me @am-c-p-p

@am-c-p-p
Copy link
Author

am-c-p-p commented Oct 8, 2019

@phrocker Fixed attribution.

@am-c-p-p
Copy link
Author

Added PutSQL implementation.

if (connection) {
const auto dbSession = connection->getSession();

try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@arpadboda arpadboda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Far from getting to the end.
Added some comments. Please also address the older ones in case they are still valid.

Copy link
Contributor

@bakaid bakaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(!) 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/

Copy link
Contributor

@bakaid bakaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing and testing - not nearly finished, but releasing what I have before going to lunch.

Copy link
Contributor

@bakaid bakaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Releasing the next batch.

@arpadboda
Copy link
Contributor

@am-c-p-p do we need this PR?
Please close otherwise.

@am-c-p-p
Copy link
Author

am-c-p-p commented Feb 6, 2020

@arpadboda Yes, we need it. It is reviewed by @bakaid and pending testing before merging to apache.

@bakaid
Copy link
Contributor

bakaid commented Feb 10, 2020

@arpadboda @am-c-p-p The diff on this PR currently looks like this:
image
My guess is that a rebased branch has been merged, ending up recreating most of the history.
@am-c-p-p please fix this, rebase to the latest master and squash the whole PR into one commit, after that I will do a final verification.

@am-c-p-p
Copy link
Author

am-c-p-p commented Feb 11, 2020

@bakaid @arpadboda Instead of this PR please review new #732.
Current one can be used as a reference, I'll delete it after new one is merged into apache.

@am-c-p-p am-c-p-p mentioned this pull request Feb 11, 2020
8 tasks
@bakaid
Copy link
Contributor

bakaid commented Apr 8, 2020

@amarmer since #732 is merged, I assume we can close this, is that right?

@bakaid
Copy link
Contributor

bakaid commented Apr 15, 2020

@amarmer Closing this, feel free to reopen if it is relevant after all.

@bakaid bakaid closed this Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants