-
Notifications
You must be signed in to change notification settings - Fork 5k
docs: update subscription docs in english #33447
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @danielclow, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances and reorganizes the English documentation for TDengine's data subscription feature. It introduces new, detailed guides for native subscription capabilities, covering everything from topic definition and consumer management to advanced features like data replay. The changes aim to provide clearer, more structured, and comprehensive information for users looking to leverage TDengine's built-in message queue-like functionalities, simplifying application design by reducing the need for external message queue systems. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request updates the documentation for data subscriptions, including restructuring the files and adding new content for topics and native subscriptions. The changes are well-organized and improve the documentation structure. I've provided a few minor suggestions to fix typos and improve consistency in the new markdown files.
| 1. Once this type of TOPIC is created, the structure of the subscribed data is fixed. | ||
| 1. Columns or tags that are subscribed to or referenced in calculations cannot be deleted (`ALTER TABLE DROP`) or modified (`ALTER TABLE MODIFY`). | ||
| 1. If the table schema changes, any newly added columns will not appear in the subscription result. | ||
| 1. For SELECT \*, the subscription expands to include all columns present at creation time. For subtables and normal tables, these are data columns; for supertables, they include both data and tag columns. |
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.
For consistency and better readability of the markdown source, TOPIC on line 33 should be in lowercase as topic. Additionally, it's recommended to use sequential numbers for ordered lists.
| 1. Once this type of TOPIC is created, the structure of the subscribed data is fixed. | |
| 1. Columns or tags that are subscribed to or referenced in calculations cannot be deleted (`ALTER TABLE DROP`) or modified (`ALTER TABLE MODIFY`). | |
| 1. If the table schema changes, any newly added columns will not appear in the subscription result. | |
| 1. For SELECT \*, the subscription expands to include all columns present at creation time. For subtables and normal tables, these are data columns; for supertables, they include both data and tag columns. | |
| 1. Once this type of topic is created, the structure of the subscribed data is fixed. | |
| 2. Columns or tags that are subscribed to or referenced in calculations cannot be deleted (`ALTER TABLE DROP`) or modified (`ALTER TABLE MODIFY`). | |
| 3. If the table schema changes, any newly added columns will not appear in the subscription result. | |
| 4. For SELECT \*, the subscription expands to include all columns present at creation time. For subtables and normal tables, these are data columns; for supertables, they include both data and tag columns. |
| 1. Schema changes are not restricted. Any structural changes to the supertable, as well as new data inserted afterward, will continue to be included in the subscription. | ||
| 1. The returned data is unstructured, and its schema dynamically adapts to changes in the supertable definition. | ||
| 1. The optional `WITH META` parameter allows the subscription to return statements for creating the supertable and its subtables — primarily used by taosX during supertable migration. | ||
| 1. The optional `WHERE` condition parameter filters the subtables to subscribe to. | ||
| - Only tags or tbname can be used in the `WHERE` clause; regular columns are not allowed. | ||
| - Functions can be used to filter tags, but aggregate functions are not supported, since subtable tag values cannot be aggregated. | ||
| - Constant expressions such as 2 > 1 (subscribe to all subtables) or FALSE (subscribe to none) are also valid. | ||
| 1. The returned data does not include tag values. |
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.
For better readability of the markdown source, it's recommended to use sequential numbers for this ordered list.
| 1. Schema changes are not restricted. Any structural changes to the supertable, as well as new data inserted afterward, will continue to be included in the subscription. | |
| 1. The returned data is unstructured, and its schema dynamically adapts to changes in the supertable definition. | |
| 1. The optional `WITH META` parameter allows the subscription to return statements for creating the supertable and its subtables — primarily used by taosX during supertable migration. | |
| 1. The optional `WHERE` condition parameter filters the subtables to subscribe to. | |
| - Only tags or tbname can be used in the `WHERE` clause; regular columns are not allowed. | |
| - Functions can be used to filter tags, but aggregate functions are not supported, since subtable tag values cannot be aggregated. | |
| - Constant expressions such as 2 > 1 (subscribe to all subtables) or FALSE (subscribe to none) are also valid. | |
| 1. The returned data does not include tag values. | |
| 1. Schema changes are not restricted. Any structural changes to the supertable, as well as new data inserted afterward, will continue to be included in the subscription. | |
| 2. The returned data is unstructured, and its schema dynamically adapts to changes in the supertable definition. | |
| 3. The optional `WITH META` parameter allows the subscription to return statements for creating the supertable and its subtables — primarily used by taosX during supertable migration. | |
| 4. The optional `WHERE` condition parameter filters the subtables to subscribe to. | |
| - Only tags or tbname can be used in the `WHERE` clause; regular columns are not allowed. | |
| - Functions can be used to filter tags, but aggregate functions are not supported, since subtable tag values cannot be aggregated. | |
| - Constant expressions such as 2 > 1 (subscribe to all subtables) or FALSE (subscribe to none) are also valid. | |
| 5. The returned data does not include tag values. |
| 1. The optional `WITH META` parameter allows the subscription to return metadata statements for creating, deleting, or modifying all supertables, subtables, and regular tables in the database. This is primarily used by taosX for database migration. | ||
| 1. Supertable and database-level subscriptions are considered advanced subscription modes and are more prone to errors. If you need to use them, please consult technical support in advance. |
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.
For better readability of the markdown source, it's recommended to use sequential numbers for this ordered list.
| 1. The optional `WITH META` parameter allows the subscription to return metadata statements for creating, deleting, or modifying all supertables, subtables, and regular tables in the database. This is primarily used by taosX for database migration. | |
| 1. Supertable and database-level subscriptions are considered advanced subscription modes and are more prone to errors. If you need to use them, please consult technical support in advance. | |
| 1. The optional `WITH META` parameter allows the subscription to return metadata statements for creating, deleting, or modifying all supertables, subtables, and regular tables in the database. This is primarily used by taosX for database migration. | |
| 2. Supertable and database-level subscriptions are considered advanced subscription modes and are more prone to errors. If you need to use them, please consult technical support in advance. |
| 1. The first record will be replayed immediately. | ||
| 1. The second record will be returned 5 seconds later. | ||
| 1. The third record will be returned 3 seconds after the second one. |
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.
For better readability of the markdown source, it's recommended to use sequential numbers for this ordered list.
| 1. The first record will be replayed immediately. | |
| 1. The second record will be returned 5 seconds later. | |
| 1. The third record will be returned 3 seconds after the second one. | |
| 1. The first record will be replayed immediately. | |
| 2. The second record will be returned 5 seconds later. | |
| 3. The third record will be returned 3 seconds after the second one. |
| The following SQL statement creates a subscription named `topic_meters`. Each record retrieved from this subscription will contain the columns selected by the query `SELECT ts, current, voltage, phase, groupid, location FROM meters`. | ||
|
|
||
| ```sql | ||
| `CREATE TOPIC IF NOT EXISTS topic_meters AS SELECT ts, current, voltage, phase, groupid, location FROM meters` |
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.
The SQL statement within the code block is incorrectly enclosed in backticks, which will cause rendering issues. It's also a good practice to terminate SQL statements with a semicolon.
| `CREATE TOPIC IF NOT EXISTS topic_meters AS SELECT ts, current, voltage, phase, groupid, location FROM meters` | |
| CREATE TOPIC IF NOT EXISTS topic_meters AS SELECT ts, current, voltage, phase, groupid, location FROM meters; |
update existing docs and add native subscription