NIFI-14869: Add MSSQL MERGE-based upsert via new DatabaseDialectService - #11442
NIFI-14869: Add MSSQL MERGE-based upsert via new DatabaseDialectService#11442Adelwageeh96 wants to merge 1 commit into
Conversation
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for proposing this addition @Adelwageeh96.
On initial review, I think the service implementation should be limited to current versions of Microsoft SQL Server. MS SQL Server 2008 reached end of support in 2019, so that implementation should be removed.
6dfc86d to
6dddce5
Compare
|
Hi @exceptionfactory , thanks for the review. I've removed MSSQL2008DatabaseDialectService and its test as requested — SQL Server 2008 reached end of support in 2019, so the dialect service now only targets SQL Server 2012+. Changes pushed to the branch (commit 6dddce5): Removed MSSQL2008DatabaseDialectService.java |
6dddce5 to
eeaed88
Compare
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for scoping down the changes @Adelwageeh96.
On further review, there are several additional things to adjust:
- The new class should be moved to the
nifi-database-dialect-servicemodule, not placed innifi-standard-processors - The test class should have all
publicmodifiers removed since they are not necessary - Strings that span more than one line should be able to use multiline strings, instead of concatenation
eeaed88 to
39d308c
Compare
|
Hello @exceptionfactory , thanks for the detailed feedback. I've made all three changes:
Latest commit: 39d308c. Ready for another look whenever you have a chance. |
39d308c to
7765f2f
Compare
Implement supportsUpsert() and getUpsertStatement() in MSSQLDatabaseDialectService to produce a MERGE statement for UPSERT operations on SQL Server. - Added new controller service: MSSQLDatabaseDialectService Provides SELECT with paging, UPSERT using MERGE, and basic ALTER/CREATE DDL generation for SQL Server 2012+. - Added new controller service: MSSQL2008DatabaseDialectService Extends MSSQLDatabaseDialectService to support SQL Server 2008, including SELECT with ROW_NUMBER() paging. - Registered both services in META-INF/services/org.apache.nifi.controller.ControllerService Enables NiFi to discover and use the new MSSQL dialect services. - Added unit tests: - TestMSSQLDatabaseDialectService.java: Verifies SQL generation and UPSERT logic for MSSQLDatabaseDialectService. - TestMSSQL2008DatabaseDialectService.java: Verifies paging and SELECT logic for MSSQL2008DatabaseDialectService. Signed-off-by: Adel Wageih <adelwageeh222@gmail.com>
7765f2f to
3e078d6
Compare
|
Hi @exceptionfactory , There's one failing check, code-compliance/Scan, but it's unrelated to this change — it failed on a network timeout downloading py4j (nifi-python-framework's download-py4j step), not anything in the MSSQL dialect service. I don't have permission to re-run it myself; happy to have it re-triggered whenever convenient. |
Implement supportsUpsert() and getUpsertStatement() in MSSQLDatabaseDialectService to produce a MERGE statement for UPSERT operations on SQL Server.
Added new controller service: MSSQLDatabaseDialectService Provides SELECT with paging, UPSERT using MERGE, and basic ALTER/CREATE DDL generation for SQL Server 2012+.
Added new controller service: MSSQL2008DatabaseDialectService Extends MSSQLDatabaseDialectService to support SQL Server 2008, including SELECT with ROW_NUMBER() paging.
Registered both services in META-INF/services/org.apache.nifi.controller.ControllerService Enables NiFi to discover and use the new MSSQL dialect services.
Added unit tests:
Summary
NIFI-14869
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation