-
Notifications
You must be signed in to change notification settings - Fork 27
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(source): PostgreSQL/MySQL CDC source vs table relationship #2449
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -149,11 +149,11 @@ If you are running RisingWave locally from binaries and intend to use the native | |||||
|
||||||
## Create a table using the native CDC connector in RisingWave | ||||||
|
||||||
To ensure all data changes are captured, you must create a table and specify primary keys. See the [`CREATE TABLE`](/sql/commands/sql-create-table.md) command for more details. | ||||||
To ensure all data changes are captured, you must create a table and specify primary keys. | ||||||
|
||||||
### Syntax | ||||||
|
||||||
Syntax for creating a CDC source. | ||||||
Syntax for creating a shared CDC source. | ||||||
|
||||||
```sql | ||||||
CREATE SOURCE [ IF NOT EXISTS ] source_name WITH ( | ||||||
|
@@ -162,7 +162,7 @@ CREATE SOURCE [ IF NOT EXISTS ] source_name WITH ( | |||||
); | ||||||
``` | ||||||
|
||||||
Syntax for creating a CDC table. Note that a primary key is required and must be consistent with the upstream table. | ||||||
Syntax for creating a CDC table based on the shared source. Note that a primary key is required and must be consistent with the upstream table. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better use a complete sentence.
Suggested change
|
||||||
|
||||||
```sql | ||||||
CREATE TABLE [ IF NOT EXISTS ] table_name ( | ||||||
|
@@ -173,7 +173,7 @@ CREATE TABLE [ IF NOT EXISTS ] table_name ( | |||||
WITH ( | ||||||
snapshot='true' | ||||||
) | ||||||
FROM source TABLE table_name; | ||||||
FROM source_name TABLE table_name; | ||||||
``` | ||||||
|
||||||
### Connector parameters | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,11 +151,11 @@ If you are running RisingWave locally from binaries and intend to use the native | |
|
||
## Create a table using the native CDC connector | ||
|
||
To ensure all data changes are captured, you must create a table or source and specify primary keys. See the [`CREATE TABLE`](/sql/commands/sql-create-table.md) command for more details. | ||
To ensure all data changes are captured, you must create a shared source first and create tables based on that source. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's ok as of now in this PR, but I feel it would be more useful if we have a topic or section about "shared sources" that we can now point to. There are a few RisingWave-specific concepts that we may want to elaborate somewhere. In addition, the "Sources" term in Glossary should be updated. cc: @st1page @WanYixian There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. The shared source is still in development by @xxchan and it is expected to release in v2.1. I think we will add the doc that time. |
||
|
||
### Syntax | ||
|
||
Syntax for creating a CDC source. | ||
Syntax for creating a shared CDC source. | ||
|
||
```sql | ||
CREATE SOURCE [ IF NOT EXISTS ] source_name WITH ( | ||
|
@@ -164,7 +164,7 @@ CREATE SOURCE [ IF NOT EXISTS ] source_name WITH ( | |
); | ||
``` | ||
|
||
Syntax for creating a CDC table. Note that a primary key is required and must be consistent with the upstream table. | ||
Syntax for creating a CDC table based on the shared source. Note that a primary key is required and must be consistent with the upstream table. | ||
|
||
```sql | ||
CREATE TABLE [ IF NOT EXISTS ] table_name ( | ||
|
@@ -175,7 +175,7 @@ CREATE TABLE [ IF NOT EXISTS ] table_name ( | |
WITH ( | ||
snapshot='true' | ||
) | ||
FROM source TABLE table_name; | ||
FROM source_name TABLE table_name; | ||
``` | ||
|
||
To check the progress of backfilling historical data, find the corresponding internal table using the [`SHOW INTERNAL TABLES`](/sql/commands/sql-show-internal-tables.md) command and query from it. | ||
|
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.
Better to clarify the logic first: need to create a
source
before creatingtable