Skip to content

Conversation

burakku
Copy link
Contributor

@burakku burakku commented Jul 23, 2025

What

How

Review guide

User Impact

Can this PR be safely reverted and rolled back?

  • YES πŸ’š
  • NO ❌

Copy link

vercel bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Jul 23, 2025 7:40am

Copy link
Contributor

πŸ‘‹ Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Helpful Resources

PR Slash Commands

Airbyte Maintainers (that's you!) can execute the following slash commands on your PR:

  • /format-fix - Fixes most formatting issues.
  • /bump-version - Bumps connector versions.
    • You can specify a custom changelog by passing changelog. Example: /bump-version changelog="My cool update"
    • Leaving the changelog arg blank will auto-populate the changelog from the PR title.
  • /run-cat-tests - Runs legacy CAT tests (Connector Acceptance Tests)
  • /build-connector-images - Builds and publishes a pre-release docker image for the modified connector(s).
  • /poe connector source-example lock - Run the Poe lock task on the source-example connector, committing the results back to the branch.
  • /poe source example lock - Alias for /poe connector source-example lock.
  • /poe source example use-cdk-branch my/branch - Pin the source-example CDK reference to the branch name specified.
  • /poe source example use-cdk-latest - Update the source-example CDK dependency to the latest available version.

πŸ“ Edit this welcome message.

Copy link
Contributor

github-actions bot commented Jul 23, 2025

source-mssql-v2 Connector Test Results

0 tests   0 βœ…β€ƒβ€ƒ0s ⏱️
0 suites  0 πŸ’€
0 files    0 ❌

Results for commit 7b41d01.

♻️ This comment has been updated with latest results.

@burakku burakku force-pushed the wenqi-mssql-migration branch 2 times, most recently from 9a4ae16 to 66ff966 Compare September 2, 2025 22:53
Copy link
Contributor

github-actions bot commented Sep 2, 2025

destination-dev-null Connector Test Results

47 tests   15 βœ…β€ƒβ€ƒ39s ⏱️
 4 suites  32 πŸ’€
 4 files     0 ❌

Results for commit fc52150.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Sep 2, 2025

destination-customer-io Connector Test Results

48 tests   18 βœ…β€ƒβ€ƒ25s ⏱️
 7 suites  30 πŸ’€
 7 files     0 ❌

Results for commit fc52150.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Sep 2, 2025

destination-hubspot Connector Test Results

44 tests   14 βœ…β€ƒβ€ƒ25s ⏱️
 5 suites  30 πŸ’€
 5 files     0 ❌

Results for commit fc52150.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Sep 2, 2025

source-mysql Connector Test Results

  8 files    8 suites   27s ⏱️
 51 tests  51 βœ…β€ƒ0 πŸ’€β€ƒ0 ❌
175 runsβ€Šβ€ƒ175 βœ…β€ƒ0 πŸ’€β€ƒ0 ❌

Results for commit fc52150.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Sep 2, 2025

destination-mssql Connector Test Results

135 tests   117 βœ…β€ƒβ€ƒ7m 32s ⏱️
 12 suites   18 πŸ’€
 12 files      0 ❌

Results for commit fc52150.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Sep 2, 2025

destination-s3 Connector Test Results

808 tests   459 βœ…β€ƒβ€ƒ2h 34m 35s ⏱️
 26 suites  349 πŸ’€
 26 files      0 ❌

Results for commit 66ff966.

@burakku burakku force-pushed the wenqi-mssql-migration branch from 2e95eb8 to 003eeae Compare September 3, 2025 18:10
Copy link
Contributor

github-actions bot commented Sep 3, 2025

Deploy preview for airbyte-docs ready!

βœ… Preview
https://airbyte-docs-atejcwfpu-airbyte-growth.vercel.app

Built with commit b3afefe.
This pull request is being automatically deployed with vercel-action

@burakku burakku force-pushed the wenqi-mssql-migration branch 3 times, most recently from a3b9731 to b0d1572 Compare September 5, 2025 23:56
@burakku burakku force-pushed the wenqi-mssql-migration branch 2 times, most recently from f07ec67 to 7b41d01 Compare September 10, 2025 23:18
@burakku burakku changed the title Wenqi mssql migration Migrate source mssql from old CDK to new CDK Sep 11, 2025
Copy link
Contributor

github-actions bot commented Sep 23, 2025

source-mssql Connector Test Results

  7 files    7 suites   14m 8s ⏱️
 61 tests  61 βœ…β€ƒ0 πŸ’€β€ƒ0 ❌
171 runsβ€Šβ€ƒ171 βœ…β€ƒ0 πŸ’€β€ƒ0 ❌

Results for commit b3afefe.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Oct 2, 2025

Note

Detected that there are differences in the Gradle dependencies.

@burakku burakku force-pushed the wenqi-mssql-migration branch 2 times, most recently from 98efdc7 to 392fbf9 Compare October 8, 2025 22:56
@burakku burakku marked this pull request as ready for review October 8, 2025 22:58
@burakku burakku requested a review from a team October 8, 2025 22:59
@burakku burakku force-pushed the wenqi-mssql-migration branch 5 times, most recently from 652f675 to 15df445 Compare October 9, 2025 17:14
Copy link
Contributor

Choose a reason for hiding this comment

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

Progressive rollout needs also

  releases:
    rolloutConfiguration:
	      enableProgressiveRollout: true

) {
recordData.set<JsonNode>(
CommonMetaField.CDC_UPDATED_AT.id,
CdcOffsetDateTimeMetaFieldType.jsonEncoder.encode(timestamp),
Copy link
Contributor

Choose a reason for hiding this comment

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

This should match the change in MsSqlServerDebeziumOperations:
CommonMetaField.CDC_UPDATED_AT.type.jsonEncoder as JsonEncoder<Any>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's when we decorate NativeRecordPayload not ObjectNode right?

Copy link
Contributor

Choose a reason for hiding this comment

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

ohhh 🀦
that's right.
ignore

@burakku burakku force-pushed the wenqi-mssql-migration branch from 5d1a565 to dd22c3e Compare October 9, 2025 22:18
@burakku burakku force-pushed the wenqi-mssql-migration branch 2 times, most recently from 6d1670a to 9735e06 Compare October 10, 2025 23:23
| 4.2.3 | 2025-07-01 | [62052](https://github.com/airbytehq/airbyte/pull/62052) | Revert change to CDK interface signature. |
| 4.2.2 | 2025-06-25 | [61729](https://github.com/airbytehq/airbyte/pull/61729) | Support the use of logical primary keys for CDC. |
| 4.2.1 | 2025-06-23 | [62015](https://github.com/airbytehq/airbyte/pull/62015) | Fix previous merge. Improve cutoff date handling |
| 4.3.0 | 2025-09-26 | [63731](https://github.com/airbytehq/airbyte/pull/63731) | Migrate source mssql from old CDK to new CDK |
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [vale] reported by reviewdog 🐢
[Vale.Spelling] Did you really mean 'mssql'?

| 4.2.2 | 2025-06-25 | [61729](https://github.com/airbytehq/airbyte/pull/61729) | Support the use of logical primary keys for CDC. |
| 4.2.1 | 2025-06-23 | [62015](https://github.com/airbytehq/airbyte/pull/62015) | Fix previous merge. Improve cutoff date handling |
| 4.3.0 | 2025-09-26 | [63731](https://github.com/airbytehq/airbyte/pull/63731) | Migrate source mssql from old CDK to new CDK |
| 4.2.5 | 2025-08-13 | [64905](https://github.com/airbytehq/airbyte/pull/64905) | bumping up java cdk version for mssql |
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [vale] reported by reviewdog 🐢
[Vale.Spelling] Did you really mean 'cdk'?

| 4.2.2 | 2025-06-25 | [61729](https://github.com/airbytehq/airbyte/pull/61729) | Support the use of logical primary keys for CDC. |
| 4.2.1 | 2025-06-23 | [62015](https://github.com/airbytehq/airbyte/pull/62015) | Fix previous merge. Improve cutoff date handling |
| 4.3.0 | 2025-09-26 | [63731](https://github.com/airbytehq/airbyte/pull/63731) | Migrate source mssql from old CDK to new CDK |
| 4.2.5 | 2025-08-13 | [64905](https://github.com/airbytehq/airbyte/pull/64905) | bumping up java cdk version for mssql |
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [vale] reported by reviewdog 🐢
[Vale.Spelling] Did you really mean 'mssql'?

| 4.2.1 | 2025-06-23 | [62015](https://github.com/airbytehq/airbyte/pull/62015) | Fix previous merge. Improve cutoff date handling |
| 4.3.0 | 2025-09-26 | [63731](https://github.com/airbytehq/airbyte/pull/63731) | Migrate source mssql from old CDK to new CDK |
| 4.2.5 | 2025-08-13 | [64905](https://github.com/airbytehq/airbyte/pull/64905) | bumping up java cdk version for mssql |
| 4.2.4 | 2025-07-03 | [62491](https://github.com/airbytehq/airbyte/pull/62491) | Improve Debezium performance by configuring the poll interval parameter. |
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [vale] reported by reviewdog 🐢
[Vale.Spelling] Did you really mean 'Debezium'?

Copy link
Contributor

@mwbayley mwbayley left a comment

Choose a reason for hiding this comment

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

Some questions and small requests. This is a huge piece of work! Thanks for handling it.

Comment on lines +15 to +22
@JsonProperty("pk_val") val pkVal: String? = null,
@JsonProperty("pk_name") val pkName: String? = null,
@JsonProperty("version") val version: Int? = null,
@JsonProperty("state_type") val stateType: String? = null,
@JsonProperty("incremental_state") val incrementalState: JsonNode? = null,
@JsonProperty("stream_name") val streamName: String? = null,
@JsonProperty("cursor_field") val cursorField: List<String>? = null,
@JsonProperty("stream_namespace") val streamNamespace: String? = null,
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't the default naming strategy for Jackson convert these names to snake_case?

Copy link
Contributor

@mwbayley mwbayley Oct 14, 2025

Choose a reason for hiding this comment

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

I looked this up and it's configurable in the ObjectMapper. We don't do that in Jsons, however. I imagine it's because we want to avoid doing any kind of renaming of fields or namespaces in the connection state. Given that, this way seems ideal.

Comment on lines +37 to +47
primaryKey: List<Field>,
primaryKeyCheckpoint: List<JsonNode>,
): OpaqueStateValue {
val primaryKeyField = primaryKey.first()
return when (primaryKeyCheckpoint.first().isNull) {
true -> Jsons.nullNode()
false ->
Jsons.valueToTree(
MsSqlServerCdcInitialSnapshotStateValue(
pkName = primaryKeyField.id,
pkVal = primaryKeyCheckpoint.first().asText(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we only using the first PK field? Imagine the PK fields are year, month, day. This way, we can't checkpoint until we finish reading a whole year's data, right? Is the snapshot state value object defined for backwards compatibility with old states so we can't add the other fields/values?

Comment on lines +27 to +43
private const val MSSQL_DATE_TYPE = "DATE"
private const val MSSQL_DATETIME_TYPE = "DATETIME"
private const val MSSQL_DATETIME2_TYPE = "DATETIME2"
private const val MSSQL_SMALLDATETIME_TYPE = "SMALLDATETIME"
private const val MSSQL_DATETIMEOFFSET_TYPE = "DATETIMEOFFSET"
private const val MSSQL_TIME_TYPE = "TIME"
private const val MSSQL_SMALLMONEY_TYPE = "SMALLMONEY"
private const val MSSQL_MONEY_TYPE = "MONEY"
private const val MSSQL_BINARY_TYPE = "BINARY"
private const val MSSQL_VARBINARY_TYPE = "VARBINARY"
private const val MSSQL_IMAGE_TYPE = "IMAGE"
private const val MSSQL_GEOMETRY_TYPE = "GEOMETRY"
private const val MSSQL_GEOGRAPHY_TYPE = "GEOGRAPHY"
private const val MSSQL_UNIQUEIDENTIFIER_TYPE = "UNIQUEIDENTIFIER"
private const val MSSQL_XML_TYPE = "XML"
private const val MSSQL_HIERARCHYID_TYPE = "HIERARCHYID"
private const val MSSQL_SQL_VARIANT_TYPE = "SQL_VARIANT"
Copy link
Contributor

Choose a reason for hiding this comment

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

as far as I can tell these are each used once - maybe we can just inline them?

if (value == null) return null

return try {
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSS")
Copy link
Contributor

Choose a reason for hiding this comment

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

this format is also present in MsSqlServerCursorCutoffTimeProvider. Maybe we can centralize the definition?

if (value == null) return null

return try {
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX")
Copy link
Contributor

Choose a reason for hiding this comment

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

This one looks slightly different than the one in MsSqlServerCursorCutoffTimeProvider. Should it be?

is And -> conj.flatMap { it.bindings() }
is Or -> disj.flatMap { it.bindings() }
is WhereClauseLeafNode -> {
val type = column.type as LosslessJdbcFieldType<*, *>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is related to some of the type issues that Rodi and I have been looking at recently. It would be nice if we had compile-time enforcement of which field types were eligible for use as a cursor and which weren't. Probably nothing we can do about it at the moment.

Comment on lines +355 to +356
// For MSSQL, we would need to deserialize the state to get the LSN
// This is a placeholder implementation - actual implementation would extract LSN from state
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is what we're doing. Old comment?

}
}
} catch (e: Exception) {
// Log error but don't fail the sync
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like we're not logging anything ATM

}
}
} catch (e: Exception) {
// Log error but don't fail the sync - keep the empty string value
Copy link
Contributor

Choose a reason for hiding this comment

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

same - no logging currently

Comment on lines +96 to +98
- pattern: (?i).*timeout expired.*
input-example: >-
com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out.
Copy link
Contributor

Choose a reason for hiding this comment

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

I imagine this was copied from the old connector, but it looks like the input example doesn't contain the pattern.

@burakku burakku force-pushed the wenqi-mssql-migration branch from 8db7e49 to 84192a3 Compare October 14, 2025 06:01
@burakku burakku force-pushed the wenqi-mssql-migration branch from 84192a3 to b3afefe Compare October 14, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants