-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix temporal type default value bug postgres #15877
fix temporal type default value bug postgres #15877
Conversation
/test connector=connectors/source-postgres
Build PassedTest summary info:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple minor/clarifying comments, lgtm otherwise
|
||
public static String convertToTimeWithTimezone(final Object time) { | ||
if (time instanceof final java.time.OffsetTime timetz) { | ||
return timetz.format(TIMETZ_FORMATTER); | ||
} else { | ||
if (!loggedUnknownTimeWithTimeZoneClass) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this! Maybe it's worth asking infra to set an alert if this shows up in cloud (or maybe push oss telemetry)
airbyte-db/db-lib/src/main/java/io/airbyte/db/jdbc/DateTimeConverter.java
Outdated
Show resolved
Hide resolved
...ezium-v1-9-2/src/main/java/io/airbyte/integrations/debezium/internals/PostgresConverter.java
Outdated
Show resolved
Hide resolved
...ezium-v1-9-2/src/main/java/io/airbyte/integrations/debezium/internals/PostgresConverter.java
Show resolved
Hide resolved
...te/integrations/io/airbyte/integration_tests/sources/AbstractPostgresSourceDatatypeTest.java
Show resolved
Hide resolved
...te/integrations/io/airbyte/integration_tests/sources/AbstractPostgresSourceDatatypeTest.java
Show resolved
Hide resolved
"'infinity'", | ||
"'-infinity'") | ||
.addExpectedValues( | ||
"+294247-01-10T04:00:25.200000", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, debezium
what type is debezium giving to us in this case? I think it would be nice to have a comment explaining why this is different from the snapshot test
} else { | ||
if (!loggedUnknownTimestampClass) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong but this logic is supposed to say something like, if in the else
case this is indicative of an unknownTimestampClass
and there is a negation here to only log this unknown once, right?
If so, what's the reason for limiting multiple logging instances? This logic wasn't initially clear why the loggedUnknownTime...
variables were set to false
and then set to true
but it seems that when an loggedUnknownTime...
variable has been set to true
that indicates an unknownTime...
was seen, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I only want to log it once is to avoid the scenario where we have a million of these logs! That could happen in case if a table has a million records and debezium starts sending a different class type for those records
/test connector=connectors/source-postgres
Build PassedTest summary info:
|
"13:00:00.000000") | ||
.build()); | ||
} | ||
|
||
// time without time zone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: it seems this comment is the same as the test above and this tests for null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah I just copied the above test and replaced the values with null. the idea is to test whether columns with time without time zone data type and null values sync properly or not
/publish connector=connectors/source-postgres
if you have connectors that successfully published but failed definition generation, follow step 4 here |
/publish connector=connectors/source-postgres-strict-encrypt
if you have connectors that successfully published but failed definition generation, follow step 4 here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, overall like the ability to log these unknown types as well
As Ed has noted, it may be useful to have these log messages surfaces into something where it can be tracked for cloud users
* fix temporal datatype bug for columns with default in postgres cdc * fix test * add test for date and time as well * add more logs for unknown classes * review comments * bump version * auto-bump connector version [ci skip] Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
Issue : #15840
The bug is happening for date, timestamp (without time zone) and time without timezone data types with default values. While building the internal schema of the columns, debezium is failing with the error
🚨 User Impact 🚨
Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.