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-mysql: Row IDs and View Discovery #2451

Merged
merged 4 commits into from
Feb 27, 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
502 changes: 251 additions & 251 deletions source-mysql-batch/.snapshots/TestAsyncCapture-Capture

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions source-mysql-batch/.snapshots/TestAsyncCapture-Discovery
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ Binding 0:
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
},
"row_id": {
"type": "integer",
"title": "Row ID",
"description": "Row ID of the Document"
},
"op": {
"type": "string",
"enum": [
"c",
"u",
"d"
],
"title": "Change Operation",
"description": "Operation type (c: Create / u: Update / d: Delete)",
"default": "u"
}
},
"type": "object",
Expand Down
10 changes: 5 additions & 5 deletions source-mysql-batch/.snapshots/TestBinaryTypes-Capture
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# ================================
# Collection "acmeCo/test/test_binarytypes_537491": 4 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"binary_col":"binary_data_1234","blob_col":"blob_data","id":0,"longblob_col":"longblob_data","mediumblob_col":"mediumblob_data","tinyblob_col":"tinyblob_data","varbinary_col":"varbinary_data"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"binary_col":"short\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","blob_col":"short","id":1,"longblob_col":"short","mediumblob_col":"short","tinyblob_col":"short","varbinary_col":"short"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"binary_col":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","blob_col":"","id":2,"longblob_col":"","mediumblob_col":"","tinyblob_col":"","varbinary_col":""}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"binary_col":null,"blob_col":null,"id":3,"longblob_col":null,"mediumblob_col":null,"tinyblob_col":null,"varbinary_col":null}
{"_meta":{"polled":"<TIMESTAMP>","index":0,"row_id":0},"binary_col":"binary_data_1234","blob_col":"blob_data","id":0,"longblob_col":"longblob_data","mediumblob_col":"mediumblob_data","tinyblob_col":"tinyblob_data","varbinary_col":"varbinary_data"}
{"_meta":{"polled":"<TIMESTAMP>","index":1,"row_id":1},"binary_col":"short\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","blob_col":"short","id":1,"longblob_col":"short","mediumblob_col":"short","tinyblob_col":"short","varbinary_col":"short"}
{"_meta":{"polled":"<TIMESTAMP>","index":2,"row_id":2},"binary_col":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","blob_col":"","id":2,"longblob_col":"","mediumblob_col":"","tinyblob_col":"","varbinary_col":""}
{"_meta":{"polled":"<TIMESTAMP>","index":3,"row_id":3},"binary_col":null,"blob_col":null,"id":3,"longblob_col":null,"mediumblob_col":null,"tinyblob_col":null,"varbinary_col":null}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"test_binarytypes_537491":{"CursorNames":["id"],"CursorValues":[3],"LastPolled":"<TIMESTAMP>"}}}
{"bindingStateV1":{"test_binarytypes_537491":{"CursorNames":["id"],"CursorValues":[3],"LastPolled":"<TIMESTAMP>","DocumentCount":4}}}

16 changes: 16 additions & 0 deletions source-mysql-batch/.snapshots/TestBinaryTypes-Discovery
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ Binding 0:
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
},
"row_id": {
"type": "integer",
"title": "Row ID",
"description": "Row ID of the Document"
},
"op": {
"type": "string",
"enum": [
"c",
"u",
"d"
],
"title": "Change Operation",
"description": "Operation type (c: Create / u: Update / d: Delete)",
"default": "u"
}
},
"type": "object",
Expand Down
45 changes: 45 additions & 0 deletions source-mysql-batch/.snapshots/TestCaptureFromView-Capture
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# ================================
# Collection "acmeCo/test/test_capturefromview_194890": 23 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":0,"row_id":0},"id":0,"name":"Row 0","updated_at":"2025-02-13 12:00:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":1,"row_id":1},"id":1,"name":"Row 1","updated_at":"2025-02-13 12:01:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":2,"row_id":2},"id":2,"name":"Row 2","updated_at":"2025-02-13 12:02:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":3,"row_id":3},"id":3,"name":"Row 3","updated_at":"2025-02-13 12:03:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":4,"row_id":4},"id":4,"name":"Row 4","updated_at":"2025-02-13 12:04:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":5,"row_id":5},"id":5,"name":"Row 5","updated_at":"2025-02-13 12:05:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":6,"row_id":6},"id":6,"name":"Row 6","updated_at":"2025-02-13 12:06:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":7,"row_id":7},"id":7,"name":"Row 7","updated_at":"2025-02-13 12:07:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":8,"row_id":8},"id":8,"name":"Row 8","updated_at":"2025-02-13 12:08:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":9,"row_id":9},"id":9,"name":"Row 9","updated_at":"2025-02-13 12:09:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":0,"row_id":10},"id":10,"name":"Row 10","updated_at":"2025-02-13 12:10:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":1,"row_id":11},"id":11,"name":"Row 11","updated_at":"2025-02-13 12:11:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":2,"row_id":12},"id":12,"name":"Row 12","updated_at":"2025-02-13 12:12:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":3,"row_id":13},"id":13,"name":"Row 13","updated_at":"2025-02-13 12:13:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":4,"row_id":14},"id":14,"name":"Row 14","updated_at":"2025-02-13 12:14:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":5,"row_id":15},"id":15,"name":"Row 15","updated_at":"2025-02-13 12:15:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":6,"row_id":16},"id":16,"name":"Row 16","updated_at":"2025-02-13 12:16:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":7,"row_id":17},"id":17,"name":"Row 17","updated_at":"2025-02-13 12:17:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":8,"row_id":18},"id":18,"name":"Row 18","updated_at":"2025-02-13 12:18:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":9,"row_id":19},"id":19,"name":"Row 19","updated_at":"2025-02-13 12:19:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":0,"row_id":20},"id":2,"name":"Row 2","updated_at":"2025-02-13 12:20:00","visible":0}
{"_meta":{"polled":"<TIMESTAMP>","index":1,"row_id":21},"id":3,"name":"Row 3","updated_at":"2025-02-13 12:20:00","visible":1}
{"_meta":{"polled":"<TIMESTAMP>","index":2,"row_id":22},"id":4,"name":"Row 4","updated_at":"2025-02-13 12:20:00","visible":0}
# ================================
# Collection "acmeCo/test/test_capturefromview_227836": 11 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":0,"row_id":0},"id":0,"name":"Row 0","updated_at":"2025-02-13 12:00:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":1,"row_id":1},"id":2,"name":"Row 2","updated_at":"2025-02-13 12:02:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":2,"row_id":2},"id":4,"name":"Row 4","updated_at":"2025-02-13 12:04:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":3,"row_id":3},"id":6,"name":"Row 6","updated_at":"2025-02-13 12:06:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":4,"row_id":4},"id":8,"name":"Row 8","updated_at":"2025-02-13 12:08:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":0,"row_id":5},"id":10,"name":"Row 10","updated_at":"2025-02-13 12:10:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":1,"row_id":6},"id":12,"name":"Row 12","updated_at":"2025-02-13 12:12:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":2,"row_id":7},"id":14,"name":"Row 14","updated_at":"2025-02-13 12:14:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":3,"row_id":8},"id":16,"name":"Row 16","updated_at":"2025-02-13 12:16:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":4,"row_id":9},"id":18,"name":"Row 18","updated_at":"2025-02-13 12:18:00"}
{"_meta":{"polled":"<TIMESTAMP>","index":0,"row_id":10},"id":3,"name":"Row 3","updated_at":"2025-02-13 12:20:00"}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"test_capturefromview_194890":{"CursorNames":["updated_at"],"CursorValues":["2025-02-13 12:20:00"],"DocumentCount":23,"LastPolled":"<TIMESTAMP>"},"test_capturefromview_227836":{"CursorNames":["updated_at"],"CursorValues":["2025-02-13 12:20:00"],"DocumentCount":11,"LastPolled":"<TIMESTAMP>"}}}

138 changes: 138 additions & 0 deletions source-mysql-batch/.snapshots/TestCaptureFromView-DiscoveryWithViews
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
Binding 0:
{
"resource_config_json": {
"name": "test_capturefromview_194890",
"schema": "test",
"table": "capturefromview_194890"
},
"resource_path": [
"test_capturefromview_194890"
],
"collection": {
"name": "acmeCo/test/test_capturefromview_194890",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-mysql-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."
},
"row_id": {
"type": "integer",
"title": "Row ID",
"description": "Row ID of the Document"
},
"op": {
"type": "string",
"enum": [
"c",
"u",
"d"
],
"title": "Change Operation",
"description": "Operation type (c: Create / u: Update / d: Delete)",
"default": "u"
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "test_capturefromview_194890"
}
Binding 1:
{
"resource_config_json": {
"name": "test_capturefromview_227836",
"schema": "test",
"table": "capturefromview_227836"
},
"resource_path": [
"test_capturefromview_227836"
],
"collection": {
"name": "acmeCo/test/test_capturefromview_227836",
"read_schema_json": {
"type": "object",
"required": [
"_meta"
],
"properties": {
"_meta": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-mysql-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."
},
"row_id": {
"type": "integer",
"title": "Row ID",
"description": "Row ID of the Document"
},
"op": {
"type": "string",
"enum": [
"c",
"u",
"d"
],
"title": "Change Operation",
"description": "Operation type (c: Create / u: Update / d: Delete)",
"default": "u"
}
},
"type": "object",
"required": [
"polled",
"index"
]
}
},
"x-infer-schema": true
},
"key": [
"/_meta/polled",
"/_meta/index"
],
"projections": null
},
"state_key": "test_capturefromview_227836"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Binding 0:
{
"resource_config_json": {
"name": "test_capturefromview_194890",
"schema": "test",
"table": "capturefromview_194890"
},
"resource_path": [
"test_capturefromview_194890"
],
"collection": {
"name": "acmeCo/test/test_capturefromview_194890",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-mysql-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."
},
"row_id": {
"type": "integer",
"title": "Row ID",
"description": "Row ID of the Document"
},
"op": {
"type": "string",
"enum": [
"c",
"u",
"d"
],
"title": "Change Operation",
"description": "Operation type (c: Create / u: Update / d: Delete)",
"default": "u"
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "test_capturefromview_194890"
}

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

16 changes: 16 additions & 0 deletions source-mysql-batch/.snapshots/TestCaptureWithEmptyPoll-Discovery
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ Binding 0:
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
},
"row_id": {
"type": "integer",
"title": "Row ID",
"description": "Row ID of the Document"
},
"op": {
"type": "string",
"enum": [
"c",
"u",
"d"
],
"title": "Change Operation",
"description": "Operation type (c: Create / u: Update / d: Delete)",
"default": "u"
}
},
"type": "object",
Expand Down
Loading
Loading