Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Source MSSQL: fix data type (smalldatetime, smallmoney) conversion from mssql source (#5609) #7386

Merged
merged 7 commits into from
Nov 5, 2021

Conversation

yurii-bidiuk
Copy link
Contributor

@yurii-bidiuk yurii-bidiuk commented Oct 26, 2021

What

Fixed data type (smalldatetime, smallmoney) conversion from mssql source (#5609)

How

Created custom MSSQLConverter that implements CustomConverter

Recommended reading order

  1. MSSQLConverter.java
  2. DebeziumConverterUtils.java

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions
  • Connector added to connector index like described here

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions
  • Connector version bumped like described here
  • Connector strict-encrypt version bumped and published

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

Connector Generator

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed.

@CLAassistant
Copy link

CLAassistant commented Oct 26, 2021

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Oct 26, 2021
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets October 26, 2021 12:58 Inactive
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Oct 26, 2021

/test connector=connectors/source-mssql

🕑 connectors/source-mssql https://github.com/airbytehq/airbyte/actions/runs/1385732281
✅ connectors/source-mssql https://github.com/airbytehq/airbyte/actions/runs/1385732281
No Python unittests run

Copy link
Contributor

@irynakruk irynakruk left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@DoNotPanicUA DoNotPanicUA left a comment

Choose a reason for hiding this comment

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

Good PR.
I'm only worrying about DebeziumConverterUtils.java and possible conflicts.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public final class DebeziumConverterUtils {
Copy link
Contributor

Choose a reason for hiding this comment

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

There will be a conflict with PR #7339 where DebeziumConverterUtils.java is also added!
This change should be consolidated in order to avoid merge conflicts and any effects on earlier merge code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. I will apply changes from #7339 once it is merged to master

@@ -26,6 +26,10 @@ static Properties getDebeziumProperties() {
// https://debezium.io/documentation/reference/1.4/connectors/sqlserver.html#sqlserver-property-provide-transaction-metadata
props.setProperty("provide.transaction.metadata", "false");

props.setProperty("converters", "smalldatetime, smallmoney");
props.setProperty("smalldatetime.type", "io.airbyte.integrations.debezium.internals.MSSQLConverter");
Copy link
Contributor

Choose a reason for hiding this comment

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

you should not put multiply properties for the same converter.
there is no relation between converter name and actual types which are covered by it. Please leave only one.
https://debezium.io/documentation/reference/development/converters.html
P.S. I agree that our names confuse mostly and would be better to use converter name.type instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@DoNotPanicUA DoNotPanicUA temporarily deployed to more-secrets October 26, 2021 15:15 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets October 26, 2021 19:16 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets October 27, 2021 11:02 Inactive
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Oct 28, 2021

/test connector=connectors/source-mssql

🕑 connectors/source-mssql https://github.com/airbytehq/airbyte/actions/runs/1393967799
✅ connectors/source-mssql https://github.com/airbytehq/airbyte/actions/runs/1393967799
No Python unittests run

@jrhizor jrhizor temporarily deployed to more-secrets October 28, 2021 09:32 Inactive
@yurii-bidiuk yurii-bidiuk force-pushed the yurii-bidiuk/5609-source-mssql-fix-convert branch from 623f680 to 72172cb Compare November 3, 2021 22:01
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets November 3, 2021 22:03 Inactive
@yurii-bidiuk yurii-bidiuk force-pushed the yurii-bidiuk/5609-source-mssql-fix-convert branch from 72172cb to 8df87e2 Compare November 4, 2021 09:55
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets November 4, 2021 09:57 Inactive
Copy link
Contributor

@alexandr-shegeda alexandr-shegeda left a comment

Choose a reason for hiding this comment

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

LGTM. we can proceed with publish/merge without airbyte review

@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets November 4, 2021 10:34 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets November 4, 2021 12:49 Inactive
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Nov 4, 2021

/test connector=connectors/source-mssql

🕑 connectors/source-mssql https://github.com/airbytehq/airbyte/actions/runs/1421420518
✅ connectors/source-mssql https://github.com/airbytehq/airbyte/actions/runs/1421420518
No Python unittests run

@jrhizor jrhizor temporarily deployed to more-secrets November 4, 2021 13:23 Inactive
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Nov 4, 2021

/test connector=connectors/source-mssql-strict-encrypt

🕑 connectors/source-mssql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1421778804
✅ connectors/source-mssql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1421778804
No Python unittests run

@jrhizor jrhizor temporarily deployed to more-secrets November 4, 2021 14:49 Inactive
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Nov 4, 2021

/publish connector=connectors/source-mssql

🕑 connectors/source-mssql https://github.com/airbytehq/airbyte/actions/runs/1421926615
✅ connectors/source-mssql https://github.com/airbytehq/airbyte/actions/runs/1421926615

@jrhizor jrhizor temporarily deployed to more-secrets November 4, 2021 15:21 Inactive
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Nov 4, 2021

/publish connector=connectors/source-mssql-strict-encrypt

🕑 connectors/source-mssql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1422205024
❌ connectors/source-mssql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1422205024

@jrhizor jrhizor temporarily deployed to more-secrets November 4, 2021 16:25 Inactive
@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented Nov 4, 2021

/publish connector=connectors/source-mssql-strict-encrypt

🕑 connectors/source-mssql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1422294704
❌ connectors/source-mssql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1422294704
🕑 connectors/source-mssql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1422294704
❌ connectors/source-mssql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1422294704

@jrhizor jrhizor temporarily deployed to more-secrets November 4, 2021 16:48 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets November 4, 2021 18:13 Inactive
@yurii-bidiuk yurii-bidiuk marked this pull request as ready for review November 5, 2021 10:20
@yurii-bidiuk yurii-bidiuk merged commit 56db806 into master Nov 5, 2021
@yurii-bidiuk yurii-bidiuk deleted the yurii-bidiuk/5609-source-mssql-fix-convert branch November 5, 2021 10:21
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
…from mssql source (airbytehq#5609) (airbytehq#7386)

* Fix data type (smalldatetime, smallmoney) conversion from mssql source (airbytehq#5609)

* Fixed code format

* Bumb new version

* Update documentation (mssql.md)

* formating

* fixed converter properties

* aligned converter utils with airbytehq#7339

Co-authored-by: Andrii Leonets <30464745+DoNotPanicUA@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source MSSQL to S3 Failed to convert JSON to Avro
6 participants