-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: make SPLIT AT output be consistent with SHOW EXPERIMENTAL_RANGES #24740
Copy link
Copy link
Closed
Labels
A-sql-executionRelating to SQL execution.Relating to SQL execution.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-easyEasy issue to tackle, requires little or no CockroachDB experienceEasy issue to tackle, requires little or no CockroachDB experienceS-3-ux-surpriseIssue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.good first issue
Description
This is a feature request.
On version 2.0.0, the pretty-printed key output format differs between SHOW TESTING_RANGES and SPLIT AT as shown below.
This is a bit confusing when you are trying to learn the key output format so you can understand what is happening under the hood when you execute these statements.
The feature request is for SPLIT AT to use the same "short form" as SHOW TESTING_RANGES to make it easier to visually compare the outputs.
(The table t below is taken from the SQL tests for the SHOW TESTING_RANGES PR.)
> SELECT version();
+-----------------------------------------------------------------------------------+
| version |
+-----------------------------------------------------------------------------------+
| CockroachDB CCL v2.0.0 (x86_64-apple-darwin13, built 2018/04/03 20:52:33, go1.10) |
+-----------------------------------------------------------------------------------+
(1 row)
> SHOW CREATE TABLE t;
+-------+------------------------------------------------------------+
| Table | CreateTable |
+-------+------------------------------------------------------------+
| t | CREATE TABLE t ( +|
| | k1 INT NOT NULL, +|
| | k2 INT NOT NULL, +|
| | v INT NULL, +|
| | w INT NULL, +|
| | CONSTRAINT "primary" PRIMARY KEY (k1 ASC, k2 ASC),+|
| | INDEX idx (v ASC, w ASC), +|
| | FAMILY "primary" (k1, k2, v, w) +|
| | ) |
+-------+------------------------------------------------------------+
(1 row)
> ALTER TABLE t SPLIT AT VALUES (1), (10);
+----------+----------------+
| key | pretty |
+----------+----------------+
| \xbc8989 | /Table/52/1/1 |
| \xbc8992 | /Table/52/1/10 |
+----------+----------------+
(2 rows)
root=> SHOW TESTING_RANGES FROM TABLE t;
+-----------+---------+----------+----------+--------------+
| Start Key | End Key | Range ID | Replicas | Lease Holder |
+-----------+---------+----------+----------+--------------+
| | /1 | 33 | {1,3,4} | 3 |
| /1 | /10 | 34 | {1,3,5} | 3 |
| /10 | | 35 | {1,3,5} | 3 |
+-----------+---------+----------+----------+--------------+
(3 rows)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-executionRelating to SQL execution.Relating to SQL execution.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-easyEasy issue to tackle, requires little or no CockroachDB experienceEasy issue to tackle, requires little or no CockroachDB experienceS-3-ux-surpriseIssue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.good first issue