-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: initial support for virtual columns
This change adds very basic support for virtual columns to the non-test descriptors and catalog. This is gated behind an experimental session setting. Release note: None
- Loading branch information
1 parent
741e031
commit 2794f69
Showing
19 changed files
with
624 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
statement ok | ||
SET experimental_enable_virtual_columns = true | ||
|
||
# Test that we don't allow FAMILY constraints with virtual columns. | ||
statement error virtual computed column "v" cannot be part of a family | ||
CREATE TABLE t ( | ||
a INT PRIMARY KEY, | ||
b INT, | ||
v INT AS (a+b) VIRTUAL, | ||
FAMILY (a, b, v) | ||
) | ||
|
||
statement error virtual computed column "v" cannot be part of a family | ||
CREATE TABLE t ( | ||
a INT PRIMARY KEY, | ||
b INT, | ||
v INT AS (a+b) VIRTUAL, | ||
FAMILY (a), | ||
FAMILY (b), | ||
FAMILY (v) | ||
) | ||
|
||
statement ok | ||
CREATE TABLE t ( | ||
a INT PRIMARY KEY, | ||
b INT, | ||
v INT AS (a+b) VIRTUAL, | ||
FAMILY (a,b) | ||
) | ||
|
||
statement ok | ||
INSERT INTO t VALUES (1, 1) | ||
|
||
statement ok | ||
INSERT INTO t(a,b) VALUES (2, 2) | ||
|
||
statement error cannot write directly to computed column | ||
INSERT INTO t(a,b,v) VALUES (2, 2, 0) | ||
|
||
query III colnames,rowsort | ||
SELECT * FROM t | ||
---- | ||
a b v | ||
1 1 2 | ||
2 2 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.