morrySnow commented on code in PR #1980: URL: https://github.com/apache/doris-website/pull/1980#discussion_r1946479747
########## docs/sql-manual/sql-statements/table-and-view/data-and-status-management/SHOW-REPLICA-STATUS.md: ########## @@ -24,56 +24,133 @@ specific language governing permissions and limitations under the License. --> - - ## Description -This statement is used to display replica status information for a table or partition. +This statement is used to display the replica status information for a table or partition. -grammar: +## Syntax ```sql -SHOW REPLICA STATUS FROM [db_name.]tbl_name [PARTITION (p1, ...)] -[where_clause]; +SHOW REPLICA STATUS FROM [ <database_name>.]<table_name> [<partition_list>] +[where_clause] ``` +Where: -illustrate - -1. where_clause: - WHERE STATUS [!]= "replica_status" - -2. replica_status: - OK: replica is healthy - DEAD: The Backend where the replica is located is unavailable - VERSION_ERROR: replica data version is missing - SCHEMA_ERROR: The schema hash of the replica is incorrect - MISSING: replica does not exist - -## Example - -1. View the status of all replicas of the table - - ```sql - SHOW REPLICA STATUS FROM db1.tbl1; - ``` - -2. View a copy of a table with a partition status of VERSION_ERROR - - ```sql - SHOW REPLICA STATUS FROM tbl1 PARTITION (p1, p2) - WHERE STATUS = "VERSION_ERROR"; - ``` - -3. View all unhealthy replicas of the table - - ```sql - SHOW REPLICA STATUS FROM tbl1 - WHERE STATUS != "OK"; - ``` +```sql +partition_list +: PARTITION (<partition_name>[ , ... ]) +``` -## Keywords +Where: - SHOW, REPLICA, STATUS +```sql +where_clause +: WHERE <output_column_name> = <value> +``` -## Best Practice +## Required Parameters +**1. `<table_name>`** + +> The identifier (i.e., name) of the table, which must be unique within the database (Database). +> +> The identifier must start with a letter character (or any character from supported languages if Unicode name support is enabled), and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., My Object). +> +> Identifiers cannot use reserved keywords. +> +> For more details, refer to the identifier requirements and reserved keywords. + + +## Optional Parameters + +**1. `<db_name>`** + +> The identifier (i.e., name) of the database, which must be unique within the cluster (Cluster). +> +> The identifier must start with a letter character (or any character from supported languages if Unicode name support is enabled), and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., My Object). +> +> Identifiers cannot use reserved keywords. +> +> For more details, refer to the identifier requirements and reserved keywords. + +**2. `<partition_list>`** + +> A comma-separated list of partition identifiers (i.e., names), which must be unique within the table (Table). +> +> The identifier must start with a letter character (or any character from supported languages if Unicode name support is enabled), and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., My Object). +> +> Identifiers cannot use reserved keywords. +> +> For more details, refer to the identifier requirements and reserved keywords. + +**3. `<WHERE output_column_name = value>`** Review Comment: ```suggestion **3. `WHERE <output_column_name> = <value>`** ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org