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 <adelwageeh222@gmail.com>
@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
@github-actions
Copy link

Automated review is marking this PR as stale due to lack of updates in the past four months. This PR will be closed in 15 days if the stale label is not removed. This stale label and automated closure does not indicate a judgement of the PR, just lack of reviewer bandwidth and helps us keep the PR queue more manageable. If you would like this PR re-opened you can do so and a committer can remove the stale label. Or you can open a new PR. Try to help review other PRs to increase PR review bandwidth which in turn helps yours.

@github-actions github-actions bot added the Stale label Dec 20, 2025
Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @Adelwageeh96, unfortunately available review cycles have not provided the opportunity to focus on considering this addition.

On a quick scan, I observed a handful of issues with the test implementation, including many unnecessary anonymous classes, instead of using standard implementations.

Since the original pull request submission, the project repository now requires signed commits, and has a handful of new Checkstyle rules.

I'm not sure if there will be available cycles to review these changes given the lack of activity. However, having this PR linked from the Jira issue provides a helpful point of reference if others are willing to review the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants