From bb2b29c64f4da351a2c7b7ae60afafa47409ba6a Mon Sep 17 00:00:00 2001 From: zhoubintao <35688959+zbtzbtzbt@users.noreply.github.com> Date: Sun, 17 Oct 2021 22:54:12 +0800 Subject: [PATCH] [Doc] Add type BOOLEAN when enter 'help create table' in mysql client (#6852) some user do not know Doris support type boolean, they use TINYINT, so i add type BOOLEAN when enter 'help create table' in mysql client. currently, type BOOLEAN size is 1 byte, but the value of boolean column only in {0,1} , which waste some memory, and i want change it's implement to 1 bit in the future. --- .../sql-statements/Data Definition/CREATE TABLE.md | 9 ++++++--- .../sql-statements/Data Definition/CREATE TABLE.md | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/en/sql-reference/sql-statements/Data Definition/CREATE TABLE.md b/docs/en/sql-reference/sql-statements/Data Definition/CREATE TABLE.md index b8275a21c8..707f19d674 100644 --- a/docs/en/sql-reference/sql-statements/Data Definition/CREATE TABLE.md +++ b/docs/en/sql-reference/sql-statements/Data Definition/CREATE TABLE.md @@ -52,6 +52,8 @@ Syntax: col_name: Name of column col_type: Type of column ``` + BOOLEAN(1 Byte) + Range: {0,1} TINYINT(1 Byte) Range: -2^7 + 1 ~ 2^7 - 1 SMALLINT(2 Bytes) @@ -338,13 +340,14 @@ Syntax: ``` CREATE TABLE example_db.table_hash ( - k1 TINYINT, - k2 DECIMAL(10, 2) DEFAULT "10.5", + k1 BOOLEAN, + k2 TINYINT, + k3 DECIMAL(10, 2) DEFAULT "10.5", v1 CHAR(10) REPLACE, v2 INT SUM ) ENGINE=olap - AGGREGATE KEY(k1, k2) + AGGREGATE KEY(k1, k2, k3) COMMENT "my first doris table" DISTRIBUTED BY HASH(k1) BUCKETS 32; ``` diff --git a/docs/zh-CN/sql-reference/sql-statements/Data Definition/CREATE TABLE.md b/docs/zh-CN/sql-reference/sql-statements/Data Definition/CREATE TABLE.md index 9623a5dc26..a99fd99b9a 100644 --- a/docs/zh-CN/sql-reference/sql-statements/Data Definition/CREATE TABLE.md +++ b/docs/zh-CN/sql-reference/sql-statements/Data Definition/CREATE TABLE.md @@ -54,6 +54,8 @@ under the License. col_type:列类型 ``` + BOOLEAN(1字节) + 范围:{0,1} TINYINT(1字节) 范围:-2^7 + 1 ~ 2^7 - 1 SMALLINT(2字节) @@ -370,13 +372,14 @@ under the License. ``` CREATE TABLE example_db.table_hash ( - k1 TINYINT, - k2 DECIMAL(10, 2) DEFAULT "10.5", + k1 BOOLEAN, + k2 TINYINT, + k3 DECIMAL(10, 2) DEFAULT "10.5", v1 CHAR(10) REPLACE, v2 INT SUM ) ENGINE=olap - AGGREGATE KEY(k1, k2) + AGGREGATE KEY(k1, k2, k3) COMMENT "my first doris table" DISTRIBUTED BY HASH(k1) BUCKETS 32; ```