NIFI-7686: Support multiple key columns in database lookup services#11188
NIFI-7686: Support multiple key columns in database lookup services#11188lhapollo wants to merge 1 commit into
Conversation
Added composite key support to DatabaseRecordLookupService and SimpleDatabaseLookupService. When LOOKUP_KEY_COLUMN contains a comma-separated list of column names, the services build a composite WHERE clause and expect coordinates keyed by column name instead of the single 'key' coordinate. Includes type coercion so String values from LookupRecord are converted to the correct SQL types based on ParameterMetaData. Backward compatible: single-key behavior is unchanged.
|
@lhapollo It looks like there are Checkstyle and PMD violations in the two builds that are failing. Please correct those. |
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for proposing this new feature @lhapollo. On initial review, this change introduces notable behavior changes, and has duplicative logic for things like coercing values. Expanding the semantic behavior of the Lookup Key Column property is also potentially confusing, so at minimum, it would require renaming the property. For all of these reasons, I think the approach needs closer consideration. It may warrant a different service implementation, rather than changes to the existing implementations.
|
Closing this pull request for now, glad to discuss further options on the referenced Jira issue to decide on the best path forward before returning to code review. |
Summary
NIFI-7686
Added composite key support to DatabaseRecordLookupService and SimpleDatabaseLookupService. When LOOKUP_KEY_COLUMN contains a comma-separated list of column names, the services build a composite WHERE clause and expect coordinates keyed by column name instead of the single 'key' coordinate.
Includes type coercion so String values from LookupRecord are converted to the correct SQL types based on ParameterMetaData.
Backward compatible: single-key behavior is unchanged.
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation