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-bigquery-batch: Code health improvements #2435

Merged
merged 3 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions source-bigquery-batch/.snapshots/TestBinaryTypes-Capture
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ================================
# Collection "acmeCo/test/binarytypes_537491": 6 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bool_val":true,"bytes_val":"aGVsbG8gd29ybGQ=","id":1}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bool_val":false,"bytes_val":"AAECAw==","id":2}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bool_val":null,"bytes_val":null,"id":3}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bool_val":true,"bytes_val":null,"id":4}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bool_val":false,"bytes_val":"qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==","id":5}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bool_val":true,"bytes_val":"SGVsbG8sIOS4lueVjCE=","id":6}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"binarytypes_537491":{"CursorNames":["id"],"CursorValues":[6],"LastPolled":"<TIMESTAMP>"}}}

58 changes: 58 additions & 0 deletions source-bigquery-batch/.snapshots/TestBinaryTypes-Discovery
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Binding 0:
{
"resource_config_json": {
"name": "binarytypes_537491",
"schema": "testdata",
"table": "binarytypes_537491",
"cursor": [
"id"
]
},
"resource_path": [
"binarytypes_537491"
],
"collection": {
"name": "acmeCo/test/binarytypes_537491",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "http://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-bigquery-batch/document-metadata",
"properties": {
"polled": {
"type": "string",
"format": "date-time",
"title": "Polled Timestamp",
"description": "The time at which the update query which produced this document as executed."
},
"index": {
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "binarytypes_537491"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ================================
# Collection "acmeCo/test/capturewithdatetimecursor_877736": 10 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 0","id":0,"updated_at":"2025-02-13T12:00:00.000000"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 1","id":1,"updated_at":"2025-02-13T12:01:00.000000"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 2","id":2,"updated_at":"2025-02-13T12:02:00.000000"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 3","id":3,"updated_at":"2025-02-13T12:03:00.000000"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 4","id":4,"updated_at":"2025-02-13T12:04:00.000000"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 5","id":5,"updated_at":"2025-02-13T12:10:00.000000"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 6","id":6,"updated_at":"2025-02-13T12:11:00.000000"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 7","id":7,"updated_at":"2025-02-13T12:12:00.000000"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 8","id":8,"updated_at":"2025-02-13T12:13:00.000000"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 9","id":9,"updated_at":"2025-02-13T12:14:00.000000"}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"capturewithdatetimecursor_877736":{"CursorNames":["updated_at"],"CursorValues":["2025-02-13T12:14:00.000000"],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Binding 0:
{
"resource_config_json": {
"name": "capturewithdatetimecursor_877736",
"schema": "testdata",
"table": "capturewithdatetimecursor_877736",
"cursor": [
"updated_at"
]
},
"resource_path": [
"capturewithdatetimecursor_877736"
],
"collection": {
"name": "acmeCo/test/capturewithdatetimecursor_877736",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "http://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-bigquery-batch/document-metadata",
"properties": {
"polled": {
"type": "string",
"format": "date-time",
"title": "Polled Timestamp",
"description": "The time at which the update query which produced this document as executed."
},
"index": {
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "capturewithdatetimecursor_877736"
}

18 changes: 18 additions & 0 deletions source-bigquery-batch/.snapshots/TestCaptureWithEmptyPoll-Capture
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ================================
# Collection "acmeCo/test/capturewithemptypoll_890703": 10 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 0","id":0,"updated_at":"2025-02-13T12:00:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 1","id":1,"updated_at":"2025-02-13T12:01:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 2","id":2,"updated_at":"2025-02-13T12:02:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 3","id":3,"updated_at":"2025-02-13T12:03:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 4","id":4,"updated_at":"2025-02-13T12:04:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 5","id":5,"updated_at":"2025-02-13T12:10:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 6","id":6,"updated_at":"2025-02-13T12:11:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 7","id":7,"updated_at":"2025-02-13T12:12:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 8","id":8,"updated_at":"2025-02-13T12:13:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 9","id":9,"updated_at":"2025-02-13T12:14:00Z"}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"capturewithemptypoll_890703":{"CursorNames":["updated_at"],"CursorValues":["2025-02-13T12:14:00Z"],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Binding 0:
{
"resource_config_json": {
"name": "capturewithemptypoll_890703",
"schema": "testdata",
"table": "capturewithemptypoll_890703",
"cursor": [
"updated_at"
]
},
"resource_path": [
"capturewithemptypoll_890703"
],
"collection": {
"name": "acmeCo/test/capturewithemptypoll_890703",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "http://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-bigquery-batch/document-metadata",
"properties": {
"polled": {
"type": "string",
"format": "date-time",
"title": "Polled Timestamp",
"description": "The time at which the update query which produced this document as executed."
},
"index": {
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "capturewithemptypoll_890703"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ================================
# Collection "acmeCo/test/capturewithmodifications_786099": 10 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Initial value for row 0","id":0,"updated_at":"2025-02-13T12:00:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Initial value for row 1","id":1,"updated_at":"2025-02-13T12:01:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Initial value for row 2","id":2,"updated_at":"2025-02-13T12:02:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Initial value for row 3","id":3,"updated_at":"2025-02-13T12:03:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Initial value for row 4","id":4,"updated_at":"2025-02-13T12:04:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Modified value for row 3","id":3,"updated_at":"2025-02-13T12:15:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Modified value for row 4","id":4,"updated_at":"2025-02-13T12:16:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 5","id":5,"updated_at":"2025-02-13T12:20:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 6","id":6,"updated_at":"2025-02-13T12:21:00Z"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 7","id":7,"updated_at":"2025-02-13T12:22:00Z"}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"capturewithmodifications_786099":{"CursorNames":["updated_at"],"CursorValues":["2025-02-13T12:22:00Z"],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Binding 0:
{
"resource_config_json": {
"name": "capturewithmodifications_786099",
"schema": "testdata",
"table": "capturewithmodifications_786099",
"cursor": [
"updated_at"
]
},
"resource_path": [
"capturewithmodifications_786099"
],
"collection": {
"name": "acmeCo/test/capturewithmodifications_786099",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "http://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-bigquery-batch/document-metadata",
"properties": {
"polled": {
"type": "string",
"format": "date-time",
"title": "Polled Timestamp",
"description": "The time at which the update query which produced this document as executed."
},
"index": {
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "capturewithmodifications_786099"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ================================
# Collection "acmeCo/test/capturewithnullcursor_662607": 5 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Another NULL cursor","id":2,"sort_col":null}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Third NULL cursor","id":4,"sort_col":null}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with NULL cursor","id":0,"sort_col":null}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with cursor 10","id":1,"sort_col":10}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with cursor 20","id":3,"sort_col":20}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"capturewithnullcursor_662607":{"CursorNames":["sort_col"],"CursorValues":[20],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ================================
# Collection "acmeCo/test/capturewithnullcursor_662607": 2 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Final value cursor 30","id":9,"sort_col":30}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with cursor 25","id":7,"sort_col":25}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"capturewithnullcursor_662607":{"CursorNames":["sort_col"],"CursorValues":[30],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Binding 0:
{
"resource_config_json": {
"name": "capturewithnullcursor_662607",
"schema": "testdata",
"table": "capturewithnullcursor_662607",
"cursor": [
"sort_col"
]
},
"resource_path": [
"capturewithnullcursor_662607"
],
"collection": {
"name": "acmeCo/test/capturewithnullcursor_662607",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "http://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-bigquery-batch/document-metadata",
"properties": {
"polled": {
"type": "string",
"format": "date-time",
"title": "Polled Timestamp",
"description": "The time at which the update query which produced this document as executed."
},
"index": {
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "capturewithnullcursor_662607"
}

Loading
Loading