-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bulk-cdk: fix bugs surfaced by CAT tests (#44543)
## What I tried to get the CAT tests running on airbyte-enterprise today. There were a few failures which surfaced bugs in the Bulk CDK, which doesn't always emit STATE or TRACE ERROR messages when required during a READ. ## How Emit TRACE ERROR messages if the configured streams are bad. Emit at least one STATE message for each stream with an input state. ## Review guide Commit by commit ## User Impact None ## Can this PR be safely reverted and rolled back? <!-- * If unsure, leave it blank. --> - [x] YES 💚 - [ ] NO ❌
- Loading branch information
Showing
11 changed files
with
281 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
airbyte-cdk/bulk/toolkits/extract-jdbc/src/test/resources/h2source/bad-catalog.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"streams": [ | ||
{ | ||
"stream": { | ||
"name": "FOO", | ||
"json_schema": { | ||
"type": "object", | ||
"properties": { | ||
"BAR": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"supported_sync_modes": ["full_refresh", "incremental"], | ||
"source_defined_cursor": false, | ||
"default_cursor_field": [], | ||
"source_defined_primary_key": [], | ||
"is_resumable": false, | ||
"namespace": "PUBLIC" | ||
}, | ||
"sync_mode": "incremental", | ||
"cursor_field": ["BAR"], | ||
"destination_sync_mode": "overwrite", | ||
"primary_key": [] | ||
} | ||
] | ||
} |
24 changes: 24 additions & 0 deletions
24
...olkits/extract-jdbc/src/test/resources/h2source/expected-messages-stream-bad-catalog.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"type": "LOG", | ||
"log": { | ||
"level": "WARN", | ||
"message": "StreamNotFound(streamName=FOO, streamNamespace=PUBLIC)" | ||
} | ||
}, | ||
{ | ||
"type": "TRACE", | ||
"trace": { | ||
"type": "ERROR", | ||
"emitted_at": 3.1336416e12, | ||
"error": { | ||
"stream_descriptor": { | ||
"name": "FOO", | ||
"namespace": "PUBLIC" | ||
}, | ||
"message": "Stream 'PUBLIC_FOO' not found or not accessible in source.", | ||
"failure_type": "config_error" | ||
} | ||
} | ||
} | ||
] |
51 changes: 51 additions & 0 deletions
51
...kits/extract-jdbc/src/test/resources/h2source/expected-messages-stream-too-far-ahead.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[ | ||
{ | ||
"type": "TRACE", | ||
"trace": { | ||
"type": "STREAM_STATUS", | ||
"emitted_at": 3.1336416e12, | ||
"stream_status": { | ||
"stream_descriptor": { | ||
"name": "EVENTS", | ||
"namespace": "PUBLIC" | ||
}, | ||
"status": "STARTED" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "STATE", | ||
"state": { | ||
"type": "STREAM", | ||
"stream": { | ||
"stream_descriptor": { | ||
"name": "EVENTS", | ||
"namespace": "PUBLIC" | ||
}, | ||
"stream_state": { | ||
"primary_key": {}, | ||
"cursors": { | ||
"TS": "2024-04-30T00:00:00.000000-04:00" | ||
} | ||
} | ||
}, | ||
"sourceStats": { | ||
"recordCount": 0.0 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "TRACE", | ||
"trace": { | ||
"type": "STREAM_STATUS", | ||
"emitted_at": 3.1336416e12, | ||
"stream_status": { | ||
"stream_descriptor": { | ||
"name": "EVENTS", | ||
"namespace": "PUBLIC" | ||
}, | ||
"status": "COMPLETE" | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ | |
} | ||
}, | ||
"sourceStats": { | ||
"recordCount": 2.0 | ||
"recordCount": 1.0 | ||
} | ||
} | ||
}, | ||
|
Oops, something went wrong.