-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIFI-11858 Configurable Column Name Normalization in PutDatabaseRecord and UpdateDatabaseTable #7544
base: main
Are you sure you want to change the base?
Conversation
…abaseTable processor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinarayansingh Thanks for the contribution. There are still some static code analysis issues. You can test locally by running the following command:
./mvnw clean install -Pcontrib-check -am -pl :nifi-standard-processors
Hi @exceptionfactory , following is the rat report: SummaryGenerated at: 2023-08-01T08:57:42-07:00 Notes: 24 Apache Licensed: 13 JavaDocs are generated, thus a license header is optional. 14 Unknown Licenses Files with unapproved licenses: nifi-h2/nifi-h2-database/nifi-h2-database.iml Archives:
Files with Apache License headers will be marked AL let me know if i have to change anything |
@ravinarayansingh The Static Analysis build lists the particular problem: https://github.com/apache/nifi/actions/runs/5719909353/job/15509139654?pr=7544#step:5:5763 It looks like those |
Hi @exceptionfactory |
@ravinarayansingh you have a merge conflict. |
…NIFI-11858 � Conflicts: � nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UpdateDatabaseTable.java � nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/TableSchema.java
resolved |
Hi @exceptionfactory , |
@ravinarayansingh These changes still need substantive review, along with a number of other pull requests, but thanks for addressing the initial feedback so far. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience on this pull request review @ravinarayansingh. Reviewing the implementation details, the general concept of a configurable column normalization strategy is helpful.
As a general recommendation, it looks like it would be helpful to make ColumnNameNormalizer
an interface, with getNormalizedName(String columnName)
as the interface method. Although the current implementation is simple enough, providing separate implementations would remove the need for the conditional logic. Given that this method will be called for every column, there seems to be value in having narrowly defined implementation classes.
Hi @exceptionfactory |
…NIFI-11858 � Conflicts: � nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java
Hi @exceptionfactory , I have made the required changes, please have a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @ravinarayansingh. The general approach looks good, but there are a few more naming recommendations. In particular, any regular expression pattern should be parsed to a Pattern
object for more efficient processing in the normalizer implementation.
...standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java
Outdated
Show resolved
Hide resolved
...standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java
Outdated
Show resolved
Hide resolved
...standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java
Outdated
Show resolved
Hide resolved
...standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java
Outdated
Show resolved
Hide resolved
...standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java
Outdated
Show resolved
Hide resolved
...rd-processors/src/main/java/org/apache/nifi/processors/standard/db/ColumnNameNormalizer.java
Outdated
Show resolved
Hide resolved
...essors/src/main/java/org/apache/nifi/processors/standard/db/ColumnNameNormalizerUtility.java
Outdated
Show resolved
Hide resolved
...ard-processors/src/main/java/org/apache/nifi/processors/standard/db/TranslationStrategy.java
Outdated
Show resolved
Hide resolved
...ard-processors/src/main/java/org/apache/nifi/processors/standard/db/TranslationStrategy.java
Outdated
Show resolved
Hide resolved
...ard-processors/src/main/java/org/apache/nifi/processors/standard/db/TranslationStrategy.java
Outdated
Show resolved
Hide resolved
…/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java Co-authored-by: David Handermann <[email protected]>
…/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java Co-authored-by: David Handermann <[email protected]>
Hi @dan-s1 and @exceptionfactory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinarayansingh Thanks for your work and patience on this pull request.
Unfortunately I may not have been clear in previous comments regarding the interface-based approached for the ColumnNameNormalizer
. I did not intend for the ColumnNameNormalizer
to be implemented by each Processor, but instead, the ColumnNameNormalizer
should have separate implementations for each strategy.
If it would be helpful, I could follow up with a commit that implements the approach I described.
…NIFI-11858 # Conflicts: # nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDatabaseRecord.java
Hi @exceptionfactory |
Thanks for the updates @ravinarayansingh, the |
This needs a rebase against the latest main, then I will take a look also, thanks! |
Hi @mattyb149 |
…NIFI-11858 # Conflicts: # nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/ColumnNameNormalizer.java # nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/ColumnNameNormalizerFactory.java # nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/TranslationStrategy.java # nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/PatternNormalizer.java # nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/RemoveAllSpecialCharNormalizer.java # nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/RemoveSpaceNormalizer.java # nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/RemoveUnderscoreNormalizer.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed this PR today. I would like at least 24 hours more to review this and see if I have feedback on the code. Right now I am giving some wording feedback.
...ard-processors/src/main/java/org/apache/nifi/processors/standard/db/TranslationStrategy.java
Outdated
Show resolved
Hide resolved
...ard-processors/src/main/java/org/apache/nifi/processors/standard/db/TranslationStrategy.java
Outdated
Show resolved
Hide resolved
...ard-processors/src/main/java/org/apache/nifi/processors/standard/db/TranslationStrategy.java
Outdated
Show resolved
Hide resolved
...ard-processors/src/main/java/org/apache/nifi/processors/standard/db/TranslationStrategy.java
Outdated
Show resolved
Hide resolved
…NIFI-11858 # Conflicts: # nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/PutDatabaseRecordTest.java
Hi @jrsteinebrey |
Thanks for the changes you made. Some other files in this PR now have checkstyle violations: Warning: src/main/java/org/apache/nifi/processors/standard/db/TableSchema.java:[155,47] (whitespace) WhitespaceAround: '!=' is not followed by whitespace. |
The checkstyle rules were recently made more stringent, looks like this needs another rebase and please run your Maven build with the |
Summary
NiFi 11858
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000
NIFI-00000
Pull Request Formatting
main
branchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-check
Licensing
LICENSE
andNOTICE
filesDocumentation