Skip to content

Conversation

@Adelwageeh96
Copy link

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

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number: NIFI-14869
  • Pull Request commit message starts with Apache NiFi Jira issue number: NIFI-14869

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

Build

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

Licensing

  • No new dependencies introduced

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 <[email protected]>
@Adelwageeh96 Adelwageeh96 force-pushed the feature/NIFI-14869-mssql-upsert branch 2 times, most recently from 45b82c3 to 4924732 Compare August 21, 2025 12:52
@Adelwageeh96 Adelwageeh96 force-pushed the feature/NIFI-14869-mssql-upsert branch from 4924732 to 073be0a Compare August 21, 2025 13:11
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