Skip to content

πŸ› πŸ“ don't missparse +/-infinity in postgres-source - #31856

Merged
Stephane Geneix (stephane-airbyte) merged 3 commits into
masterfrom
stephane-19952-postgres-infinity
Nov 9, 2023
Merged

Stephane Geneix (stephane-airbyte) merged 3 commits into
masterfrom
stephane-19952-postgres-infinity

Conversation

@stephane-airbyte

@stephane-airbyte Stephane Geneix (stephane-airbyte) commented Oct 25, 2023 •

Copy link
Copy Markdown
Contributor

fixes #19952

Postgres has the ability to store +infinity and -infinity in its date, timestamp and timestamp with timezone datatypes. Unfortunately, we don't handle them, and PG-JDBC does some unnatural stuff to still return a java.sql.* java type: It returns a special value of a Timestamp/Date/OffsetDateTime, which is not their max value either. Debezium will do the same thing.

So in this change, I look for those special values and return +infinity and -infinity instead of a non-sensical date.

There's some changes to the CDK because the postgres debezum converter is in there.

I added some tests to the AbstractPostgresSourceDatatypeTest, but I'm not 100% clear what the destination's behavior will be WRT the new values

@vercel

vercel Bot commented Oct 25, 2023 •

Copy link
Copy Markdown

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Nov 9, 2023 6:22pm

@CLAassistant

CLAassistant commented Oct 25, 2023 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! πŸŽ‰

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

}
}

protected void addTimestampWithInfinityValuesTest() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed the test because 1) it was doing the wrong thing and 2) we added a lot more tests in the original test block

}

@Override
protected void addTimestampWithInfinityValuesTest() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed this because 1) it's testing the wrong thing and 2) we have a lot more infinity tests in the abstract class above

"description": "An RFC 3339\u00a75.6 full-time, extended with +/-infinity"
},
"TimeWithoutTimezone": {
"type": "string",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oops

@@ -9,7 +9,7 @@ plugins {
airbyteJavaConnector {
cdkVersionRequired = '0.4.1'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

push new CDK

@github-actions

github-actions Bot commented Nov 7, 2023 •

Copy link
Copy Markdown
Contributor

Coverage report for source-postgres

File Coverage [35.11%] ❌
PostgresSourceOperations.java 35.11% ❌
Total Project Coverage 71.75% 🍏

@stephane-airbyte
Stephane Geneix (stephane-airbyte) marked this pull request as ready for review November 8, 2023 21:02
@stephane-airbyte Stephane Geneix (stephane-airbyte) changed the title don't missparse +/-infinity in postgres-source πŸ› πŸ“ don't missparse +/-infinity in postgres-source Nov 8, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reminder to unset this before merging.

@stephane-airbyte

Stephane Geneix (stephane-airbyte) commented Nov 8, 2023 •

Copy link
Copy Markdown
Contributor Author

/publish-java-cdk

πŸ•‘ https://github.com/airbytehq/airbyte/actions/runs/6804841041
❌ Publish Java CDK version=0.4.7version=0.4.6 failed!

@stephane-airbyte

Stephane Geneix (stephane-airbyte) commented Nov 8, 2023 •

Copy link
Copy Markdown
Contributor Author

/publish-java-cdk

πŸ•‘ https://github.com/airbytehq/airbyte/actions/runs/6805251415
❌ Publish Java CDK version=0.4.7version=0.4.6 failed!

@stephane-airbyte

Stephane Geneix (stephane-airbyte) commented Nov 8, 2023 •

Copy link
Copy Markdown
Contributor Author

/publish-java-cdk

πŸ•‘ https://github.com/airbytehq/airbyte/actions/runs/6805316543
βœ… Successfully published Java CDK version=0.4.7!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should comment that this isn't currently used (if that hasn't already been said)

…postgres-source

add tests. Add support for arrays of timestamps

refactor

more fixes

Automated Commit - Formatting Changes

fix

add infinityHandling for CDC

fix infinity for CDC

Automated Commit - Formatting Changes

simplify comparisons

update CDK version

revert change

revert change

change +/-infinity to (-)Infinity

Update build.gradle

Update version.properties

revert last changes

push CDK to 0.4.7
@stephane-airbyte

Stephane Geneix (stephane-airbyte) commented Nov 9, 2023 •

Copy link
Copy Markdown
Contributor Author

/publish-java-cdk

πŸ•‘ https://github.com/airbytehq/airbyte/actions/runs/6815901227
❌ Publish Java CDK version=0.4.7 failed!

@stephane-airbyte
Stephane Geneix (stephane-airbyte) deleted the stephane-19952-postgres-infinity branch November 9, 2023 18:33
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 CDK Connector Development Kit connectors/source/postgres

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source Postgres: Don't misparse "infinity" timestamps

5 participants