github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/opt/testutils/testcat/testdata/table (about)

     1  exec-ddl
     2  CREATE TABLE kv (
     3      k INT PRIMARY KEY,
     4      v INT
     5  )
     6  ----
     7  
     8  exec-ddl
     9  SHOW CREATE kv
    10  ----
    11  TABLE kv
    12   ├── k int not null
    13   ├── v int
    14   └── INDEX primary
    15        └── k int not null
    16  
    17  exec-ddl
    18  CREATE TABLE abcdef (
    19      a INT NOT NULL,
    20      b INT,
    21      c INT DEFAULT (10),
    22      d INT AS (b + c + 1) STORED,
    23      e INT AS (a) STORED,
    24      f INT CHECK (f > 2)
    25  )
    26  ----
    27  
    28  exec-ddl
    29  SHOW CREATE abcdef
    30  ----
    31  TABLE abcdef
    32   ├── a int not null
    33   ├── b int
    34   ├── c int default ((10))
    35   ├── d int as ((b + c) + 1) stored
    36   ├── e int as (a) stored
    37   ├── f int
    38   ├── rowid int not null default (unique_rowid()) [hidden]
    39   ├── CHECK (f > 2)
    40   └── INDEX primary
    41        └── rowid int not null default (unique_rowid()) [hidden]
    42  
    43  exec-ddl
    44  CREATE TABLE uvwxy (
    45      u INT,
    46      v INT,
    47      w INT,
    48      x INT,
    49      y INT,
    50      PRIMARY KEY (u,v),
    51      FAMILY (u,v,w),
    52      FAMILY (x),
    53      FAMILY (y)
    54  )
    55  ----
    56  
    57  
    58  exec-ddl
    59  SHOW CREATE uvwxy
    60  ----
    61  TABLE uvwxy
    62   ├── u int not null
    63   ├── v int not null
    64   ├── w int
    65   ├── x int
    66   ├── y int
    67   ├── FAMILY family1 (u, v, w)
    68   ├── FAMILY family2 (x)
    69   ├── FAMILY family3 (y)
    70   └── INDEX primary
    71        ├── u int not null
    72        └── v int not null
    73  
    74  exec-ddl
    75  CREATE TABLE a (a INT UNIQUE)
    76  ----
    77  
    78  exec-ddl
    79  SHOW CREATE a
    80  ----
    81  TABLE a
    82   ├── a int
    83   ├── rowid int not null default (unique_rowid()) [hidden]
    84   ├── INDEX primary
    85   │    └── rowid int not null default (unique_rowid()) [hidden]
    86   └── INDEX a_a_key
    87        ├── a int
    88        └── rowid int not null default (unique_rowid()) [hidden] (storing)
    89  
    90  exec-ddl
    91  CREATE TABLE part1 (a INT PRIMARY KEY, b INT) PARTITION BY LIST (a) (
    92    PARTITION p1 VALUES IN (1),
    93    PARTITION p2 VALUES IN (3, 4, 5),
    94    PARTITION p3 VALUES IN (DEFAULT)
    95  )
    96  ----
    97  
    98  exec-ddl
    99  SHOW CREATE part1
   100  ----
   101  TABLE part1
   102   ├── a int not null
   103   ├── b int
   104   └── INDEX primary
   105        ├── a int not null
   106        └── partition by list prefixes
   107             ├── (1)
   108             ├── (3)
   109             ├── (4)
   110             └── (5)
   111  
   112  exec-ddl
   113  CREATE TABLE part2 (
   114    a STRING,
   115    b STRING,
   116    c INT,
   117    PRIMARY KEY(a,b,c),
   118    INDEX (c) PARTITION BY LIST (c) (
   119      PARTITION pi1 VALUES IN (1),
   120      PARTITION pi2 VALUES IN (3, 4)
   121    )
   122  ) PARTITION BY LIST (a, b) (
   123    PARTITION p1 VALUES IN (('foo', 'bar'), ('foo', 'baz'), ('qux', 'qux')),
   124    PARTITION p2 VALUES IN (('waldo', DEFAULT)),
   125    PARTITION p3 VALUES IN (DEFAULT)
   126  )
   127  ----
   128  
   129  exec-ddl
   130  SHOW CREATE part2
   131  ----
   132  TABLE part2
   133   ├── a string not null
   134   ├── b string not null
   135   ├── c int not null
   136   ├── INDEX primary
   137   │    ├── a string not null
   138   │    ├── b string not null
   139   │    ├── c int not null
   140   │    └── partition by list prefixes
   141   │         ├── ('foo', 'bar')
   142   │         ├── ('foo', 'baz')
   143   │         ├── ('qux', 'qux')
   144   │         └── ('waldo')
   145   └── INDEX secondary
   146        ├── c int not null
   147        ├── a string not null
   148        ├── b string not null
   149        └── partition by list prefixes
   150             ├── (1)
   151             ├── (3)
   152             └── (4)