sql: add CREATE … NOT VISIBLE to parser#84783
Conversation
| storing::BOOL, | ||
| implicit::BOOL` | ||
| implicit::BOOL, | ||
| is_visible::BOOL AS visible` |
There was a problem hiding this comment.
nit: use tabs not spaces for consistency
(alternatively, replace the other tabs with spaces)
| AND table_name=%[2]s | ||
| ORDER BY | ||
| 1, 2, 3, 4, 5, 6, 7, 8;` | ||
| 1, 2, 4;` |
There was a problem hiding this comment.
was it on purpose you removed the other ordering columns?
Looks to me like this will make the output non-deterministic.
There was a problem hiding this comment.
I asked Wenyi to make this change (here). Columns 1, 2, 4 are the natural key of the query, and will be unique.
| } | ||
|
|
||
| if def.Hidden { | ||
| panic("unimplemented: creating an invisible index is not supported yet.") |
There was a problem hiding this comment.
nit: panic(unimplemented.New(...))
pkg/sql/sem/tree/create.go
Outdated
| StorageParams StorageParams | ||
| Predicate Expr | ||
| Concurrently bool | ||
| Hidden bool |
There was a problem hiding this comment.
Rename this to NotVisible. Your future self will thank you.
pkg/sql/sem/tree/create.go
Outdated
| PartitionByIndex *PartitionByIndex | ||
| StorageParams StorageParams | ||
| Predicate Expr | ||
| Hidden bool |
9ad7242 to
eb99a47
Compare
|
Previously, knz (kena) wrote…
Done. |
|
Previously, knz (kena) wrote…
I made the change because I thought it would be deterministic if I order them by |
eb99a47 to
be9784b
Compare
|
Previously, knz (kena) wrote…
Done. |
|
Previously, knz (kena) wrote…
Done. I'm sure I will. |
|
Previously, knz (kena) wrote…
Done. |
b803557 to
30e30a8
Compare
d1c0928 to
6c341aa
Compare
|
Previously, mgartner (Marcus Gartner) wrote…
This shouldn't error, and that was why the error wasn't printed 😬 |
83d6f5b to
f7bdf28
Compare
|
Previously, mgartner (Marcus Gartner) wrote…
Done. Code quote: |
|
Previously, mgartner (Marcus Gartner) wrote…
Done. |
f7bdf28 to
566916c
Compare
|
bors r+ |
|
Bazel failure looks irrelevant. |
|
Build failed (retrying...): |
|
I think this requires a rebase on top of latest master to regenerate the logic tests given the recent refactor of the logic test framework. bors r- |
|
Canceled. |
566916c to
1d700bc
Compare
Thanks for letting me know! I just rebased. |
|
You also need to run |
This commit adds parsing support for `CREATE INDEX … NOT VISIBLE` and `CREATE TABLE (... INDEX() NOT VISIBLE)`. This commit does not add any logic to the optimizer, and executing it returns an “unimplemented” error immediately. Assists: cockroachdb#72576 See also: cockroachdb#84912 Release note (sql change): Parser now supports creating an index with the option to mark them as invisible. But no implementation has done yet, and executing it returns an “unimplemented” error immediately.
1d700bc to
f07a20d
Compare
|
Bazel failure ( bors r+ |
|
Build failed (retrying...): |
|
Build succeeded: |
This commit populates the field `NotVisible` for `IndexDescriptor`, `Tree.CreateIndex`, and `Tree.TableIndexDef` at different places. In order to add some test cases for this commit, I included a test case that checks the output of `SHOW CREATE` under `pkg/sql/opt/xform/testdata/rules/not_visible_index` to make sure that the field has been populated correctly. Creating invisible indexes under `pkg/sql/opt/testutils/testcat` no longer returns an unimplemented error. But executing `CREATE INDEX ... NOT VISIBLE` in logictests or in a cluster still returns an unimplemented error. See also: cockroachdb#84783 Assists: cockroachdb#72576 Release note: none
This commit adds parsing support for
CREATE INDEX … NOT VISIBLEand
CREATE TABLE (... INDEX() NOT VISIBLE).This commit does not add any logic to the optimizer, and executing it returns an
“unimplemented” error immediately.
Assists: #72576
See also: #84912
Release note (sql change): Parser now supports creating an index with the option
to mark them as invisible. But no implementation has done yet, and executing it
returns an “unimplemented” error immediately.