fix: describe distribute table (#988)

* fix: describe distribute table
This commit is contained in:
LFC
2023-02-15 17:48:43 +08:00
committed by GitHub
parent 34fdba77df
commit 5533040be7
9 changed files with 63 additions and 151 deletions

View File

@@ -1,90 +0,0 @@
CREATE TABLE integers (i BIGINT);
Error: 2000(InvalidSyntax), Missing time index constraint
CREATE TABLE integers (i INT TIME INDEX);
Error: 1004(InvalidArguments), Invalid column option, column name: i, error: time index column data type should be timestamp or bigint
CREATE TABLE integers (i BIGINT TIME INDEX NULL);
Error: 1004(InvalidArguments), Invalid column option, column name: i, error: time index column can't be null
CREATE TABLE integers (i BIGINT TIME INDEX, j BIGINT, TIME INDEX(j));
Error: 2000(InvalidSyntax), Invalid time index: expected only one time index constraint but actual 2
CREATE TABLE integers (i BIGINT TIME INDEX, j BIGINT, TIME INDEX(i, j));
Error: 2000(InvalidSyntax), Invalid time index: it should contain only one column in time index
CREATE TABLE integers (i BIGINT TIME INDEX);
Affected Rows: 0
CREATE TABLE times (i TIMESTAMP TIME INDEX DEFAULT CURRENT_TIMESTAMP);
Affected Rows: 0
CREATE TABLE IF NOT EXISTS integers (i BIGINT TIME INDEX);
Affected Rows: 0
CREATE TABLE test1 (i INTEGER, j INTEGER);
Error: 2000(InvalidSyntax), Missing time index constraint
CREATE TABLE test1 (i INTEGER, j BIGINT TIME INDEX NOT NULL);
Affected Rows: 0
CREATE TABLE test2 (i INTEGER, j BIGINT TIME INDEX NULL);
Error: 1004(InvalidArguments), Invalid column option, column name: j, error: time index column can't be null
CREATE TABLE test2 (i INTEGER, j BIGINT TIME INDEX);
Affected Rows: 0
DESC TABLE integers;
+-------+-------+------+---------+---------------+
| Field | Type | Null | Default | Semantic Type |
+-------+-------+------+---------+---------------+
| i | Int64 | NO | | TIME INDEX |
+-------+-------+------+---------+---------------+
DESC TABLE test1;
+-------+-------+------+---------+---------------+
| Field | Type | Null | Default | Semantic Type |
+-------+-------+------+---------+---------------+
| i | Int32 | YES | | VALUE |
| j | Int64 | NO | | TIME INDEX |
+-------+-------+------+---------+---------------+
DESC TABLE test2;
+-------+-------+------+---------+---------------+
| Field | Type | Null | Default | Semantic Type |
+-------+-------+------+---------+---------------+
| i | Int32 | YES | | VALUE |
| j | Int64 | NO | | TIME INDEX |
+-------+-------+------+---------+---------------+
DROP TABLE integers;
Affected Rows: 1
DROP TABLE times;
Affected Rows: 1
DROP TABLE test1;
Affected Rows: 1
DROP TABLE test2;
Affected Rows: 1

View File

@@ -1,40 +0,0 @@
CREATE TABLE integers (i BIGINT);
CREATE TABLE integers (i INT TIME INDEX);
CREATE TABLE integers (i BIGINT TIME INDEX NULL);
CREATE TABLE integers (i BIGINT TIME INDEX, j BIGINT, TIME INDEX(j));
CREATE TABLE integers (i BIGINT TIME INDEX, j BIGINT, TIME INDEX(i, j));
CREATE TABLE integers (i BIGINT TIME INDEX);
CREATE TABLE times (i TIMESTAMP TIME INDEX DEFAULT CURRENT_TIMESTAMP);
CREATE TABLE IF NOT EXISTS integers (i BIGINT TIME INDEX);
CREATE TABLE test1 (i INTEGER, j INTEGER);
CREATE TABLE test1 (i INTEGER, j BIGINT TIME INDEX NOT NULL);
CREATE TABLE test2 (i INTEGER, j BIGINT TIME INDEX NULL);
CREATE TABLE test2 (i INTEGER, j BIGINT TIME INDEX);
DESC TABLE integers;
DESC TABLE test1;
DESC TABLE test2;
DROP TABLE integers;
DROP TABLE times;
DROP TABLE test1;
DROP TABLE test2;
-- TODO(LFC): Finish #923 in Distribute Mode, port standalone test cases.
-- TODO(LFC): Seems creating distributed table has some column schema related issues, look into "order_variable_size_payload" test cases.

View File

@@ -108,13 +108,13 @@ Affected Rows: 1
CREATE TABLE test_multiple_pk_definitions (timestamp BIGINT TIME INDEX, host STRING PRIMARY KEY, value DOUBLE, PRIMARY KEY(host));
Error: 1004(InvalidArguments), Invalid primary key: Multiple definitions of primary key found
Error: 1004(InvalidArguments), Illegal primary keys definition: found definitions of primary keys in multiple places
CREATE TABLE test_multiple_pk_definitions (timestamp BIGINT TIME INDEX, host STRING PRIMARY KEY, value DOUBLE, PRIMARY KEY(host), PRIMARY KEY(host));
Error: 1004(InvalidArguments), Invalid primary key: Multiple definitions of primary key found
Error: 1004(InvalidArguments), Illegal primary keys definition: found definitions of primary keys in multiple places
CREATE TABLE test_multiple_inline_pk_definitions (timestamp BIGINT TIME INDEX, host STRING PRIMARY KEY, value DOUBLE PRIMARY KEY);
Error: 1004(InvalidArguments), Invalid primary key: Multiple definitions of primary key found
Error: 1004(InvalidArguments), Illegal primary keys definition: not allowed to inline multiple primary keys in columns options

View File

@@ -123,3 +123,5 @@ DROP table test7;
DROP table test8;
DROP TABLE DirectReports;
-- TODO(LFC): Seems creating distributed table has some column schema related issues, look into "order_variable_size_payload" test case.