Repository navigation
fix temporal type default value bug postgres - #15877
Subodh Chaturvedi (subodh1810) merged 8 commits into
Conversation
|
/test connector=connectors/source-postgres
Build PassedTest summary info: |
Edward Gao (edgao)
left a comment
There was a problem hiding this comment.
couple minor/clarifying comments, lgtm otherwise
| if (time instanceof final java.time.OffsetTime timetz) { | ||
| return timetz.format(TIMETZ_FORMATTER); | ||
| } else { | ||
| if (!loggedUnknownTimeWithTimeZoneClass) { |
There was a problem hiding this comment.
I like this! Maybe it's worth asking infra to set an alert if this shows up in cloud (or maybe push oss telemetry)
| "'infinity'", | ||
| "'-infinity'") | ||
| .addExpectedValues( | ||
| "+294247-01-10T04:00:25.200000", |
There was a problem hiding this comment.
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
| final String value = localDateTime.format(TIMESTAMP_FORMATTER); | ||
| return resolveEra(date, value); | ||
| } else { | ||
| if (!loggedUnknownTimestampClass) { |
There was a problem hiding this comment.
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.
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: |
| .build()); | ||
| } | ||
|
|
||
| // time without time zone |
There was a problem hiding this comment.
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.
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 |
* 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.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding changelog. See changelog exampledocs/integrations/README.mdairbyte-integrations/builds.mdAirbyter
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/publishcommand described hereUpdating a connector
Community member or Airbyter
airbyte_secret./gradlew :airbyte-integrations:connectors:<name>:integrationTest.README.mdbootstrap.md. See description and examplesdocs/integrations/<source or destination>/<name>.mdincluding 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/publishcommand described hereConnector Generator
-scaffoldin their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplatesthen 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.