-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: add CREATE … NOT VISIBLE to parser #84783
Conversation
@@ -28,7 +36,8 @@ SELECT | |||
column_name, | |||
direction, | |||
storing::BOOL, | |||
implicit::BOOL` | |||
implicit::BOOL, | |||
is_visible::BOOL AS visible` |
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.
nit: use tabs not spaces for consistency
(alternatively, replace the other tabs with spaces)
pkg/sql/delegate/show_table.go
Outdated
@@ -135,7 +138,7 @@ WHERE | |||
AND table_schema=%[5]s | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked Wenyi to make this change (here). Columns 1, 2, 4 are the natural key of the query, and will be unique.
@@ -704,6 +704,10 @@ func (tt *Table) addIndexWithVersion( | |||
tt.addUniqueConstraint(def.Name, def.Columns, def.Predicate, false /* withoutIndex */) | |||
} | |||
|
|||
if def.Hidden { | |||
panic("unimplemented: creating an invisible index is not supported yet.") |
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.
nit: panic(unimplemented.New(...))
pkg/sql/sem/tree/create.go
Outdated
@@ -232,6 +232,7 @@ type CreateIndex struct { | |||
StorageParams StorageParams | |||
Predicate Expr | |||
Concurrently bool | |||
Hidden bool |
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.
Rename this to NotVisible
. Your future self will thank you.
pkg/sql/sem/tree/create.go
Outdated
@@ -978,6 +982,7 @@ type IndexTableDef struct { | |||
PartitionByIndex *PartitionByIndex | |||
StorageParams StorageParams | |||
Predicate Expr | |||
Hidden bool |
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.
ditto
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
This commit adds parsing support for ALTER INDEX … [VISIBLE | NOT VISIBLE]. Executing the command returns an `unimplemented error`. Assists: cockroachdb#72576 See also: cockroachdb#84783 Release note (sql change): Parser now supports altering an index to visible or not visible. But no implementation has done yet, and executing it returns an “unimplemented” error immediately.
This commit adds the actual execution for ALTER INDEX … [VISIBLE | NOT VISIBLE]. Assists: cockroachdb#72576 See also: cockroachdb#84783 Release note (sql change): Altering an index to visible or not visible using ALTER INDEX … VISIBLE | NOT VISIBLE is now supported.
This commit adds parsing support for ALTER INDEX … [VISIBLE | NOT VISIBLE]. Executing the command returns an `unimplemented error`. Assists: cockroachdb#72576 See also: cockroachdb#84783 Release note (sql change): Parser now supports altering an index to visible or not visible. But no implementation has done yet, and executing it returns an “unimplemented” error immediately.
This commit adds the actual execution for ALTER INDEX … [VISIBLE | NOT VISIBLE]. Assists: cockroachdb#72576 See also: cockroachdb#84783 Release note (sql change): Altering an index to visible or not visible using ALTER INDEX … VISIBLE | NOT VISIBLE is now supported.
This commit adds parsing support for ALTER INDEX … [VISIBLE | NOT VISIBLE]. Executing the command returns an `unimplemented error`. Assists: cockroachdb#72576 See also: cockroachdb#84783 Release note (sql change): Parser now supports altering an index to visible or not visible. But no implementation has done yet, and executing it returns an “unimplemented” error immediately. # Conflicts: # pkg/sql/sem/tree/stmt.go
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: #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.