Skip to content

NIFI-14869: Add MSSQL MERGE-based upsert via new DatabaseDialectService#11442

Open
Adelwageeh96 wants to merge 1 commit into
apache:mainfrom
Adelwageeh96:feature/NIFI-14869-mssql-upsert
Open

NIFI-14869: Add MSSQL MERGE-based upsert via new DatabaseDialectService#11442
Adelwageeh96 wants to merge 1 commit into
apache:mainfrom
Adelwageeh96:feature/NIFI-14869-mssql-upsert

Conversation

@Adelwageeh96

Copy link
Copy Markdown

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.

Summary

NIFI-14869

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

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>
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.

1 participant