From 7aff70a91490ed0904cef7f20d0e9980fec1ce5d Mon Sep 17 00:00:00 2001 From: TanZiYen <104113819+TanZiYen@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:02:50 +0800 Subject: [PATCH 1/3] Docs: Move-from-reference-folder-to-openmldbsql-datatypes-folder --- .../data_types/date_and_time_types.md | 14 ++++++++++ docs/en/openmldb_sql/data_types/index.rst | 11 ++++++++ .../openmldb_sql/data_types/numeric_types.md | 26 +++++++++++++++++++ .../openmldb_sql/data_types/string_types.md | 13 ++++++++++ 4 files changed, 64 insertions(+) create mode 100644 docs/en/openmldb_sql/data_types/date_and_time_types.md create mode 100644 docs/en/openmldb_sql/data_types/index.rst create mode 100644 docs/en/openmldb_sql/data_types/numeric_types.md create mode 100644 docs/en/openmldb_sql/data_types/string_types.md diff --git a/docs/en/openmldb_sql/data_types/date_and_time_types.md b/docs/en/openmldb_sql/data_types/date_and_time_types.md new file mode 100644 index 00000000000..7c35f0a94d1 --- /dev/null +++ b/docs/en/openmldb_sql/data_types/date_and_time_types.md @@ -0,0 +1,14 @@ +# Date and Time Type + +OpenMLDB supports date type `DATE` and timestamp `TIMESTAMP`. + +Each time type has a valid range of values ​​and a NULL value. The NULL value is used when specifying an invalid value that cannot be represented. + +| Type | Size (bytes) | Scope | Format | Use | +| :-------- | :----------- | :----------------------------------------------------------- | :-------------- | :----------------------- | +| DATE | 4 | 1900-01-01 ~ | YYYY-MM-DD | Date Value | +| TIMESTAMP | 8 | ~ INT64_MAX | online: int64, offline `LOAD DATA`: int64 or 'yyyy-MM-dd'T'HH:mm:ss[.SSS][XXX]' | Mixed Date and Time Value, Timestamp | + +## Time Zone Handling + +When a time string is converted to `TIMESTAMP`, OpenMLDB will convert it to a timestamp in the UTC time zone. However, when `TIMESTAMP` is converted to a time string, OpenMLDB converts the stored `TIMESTAMP` to a time string in the current time zone. Note: Currently OpenMLDB only supports one time zone which is UTC/GMT+08:00 time zone. We will support the configuration of TimeZone as soon as possible. diff --git a/docs/en/openmldb_sql/data_types/index.rst b/docs/en/openmldb_sql/data_types/index.rst new file mode 100644 index 00000000000..c008e08e24f --- /dev/null +++ b/docs/en/openmldb_sql/data_types/index.rst @@ -0,0 +1,11 @@ +============================= +Data Type +============================= + + +.. toctree:: + :maxdepth: 1 + + numeric_types + string_types + date_and_time_types diff --git a/docs/en/openmldb_sql/data_types/numeric_types.md b/docs/en/openmldb_sql/data_types/numeric_types.md new file mode 100644 index 00000000000..f96f2ad762c --- /dev/null +++ b/docs/en/openmldb_sql/data_types/numeric_types.md @@ -0,0 +1,26 @@ +# Numeric Type + +OpenMLDB boolean types supported: + +| type | size | range(signed) | range(unsigned) | use | +| :--- | :----- | :------------- | :------------- | :------- | +| BOOL | 1 byte | (-128,127) | (0,255) | small integer value | + +## Integer Type (Exact Value) + +OpenMLDB supports integer types: `INT`, `SMALLINT`, `BIGINT` + +| type | size | range (signed) | range (unsigned) | use | +| :-------------- | :------ | :------------------------------------------------------ | :------------------------------ | :--------- | +| SMALLINT or INT16 | 2 bytes | (-32 768,32 767) | (0,65 535) | small integer value | +| INT or INT32 | 4 bytes | (-2 147 483 648,2 147 483 647) | (0,4 294 967 295) | large integer value | +| BIGINT or INT64 | 8 bytes | (-9,223,372,036,854,775,808,9 223 372 036 854 775 807) | (0,18 446 744 073 709 551 615) | very large integer value | + +## Floating Point Type (Approximate Value) + +OpenMLDB supports two floating point types: `FLOAT`, `DOUBLE` + +| type | size | range(signed) | range(unsigned) | use | +| :----- | :------ | :----------------------------------------------------------- | :----------------------------------------------------------- | :-------------- | +| FLOAT | 4 bytes | (-3.402 823 466 E+38,-1.175 494 351 E-38),0,(1.175 494 351 E-38,3.402 823 466 351 E+38) | 0,(1.175 494 351 E-38,3.402 823 466 E+38) | single precision floating point value | +| DOUBLE | 8 bytes | (-1.797 693 134 862 315 7 E+308,-2.225 073 858 507 201 4 E-308),0,(2.225 073 858 507 201 4 E-308,1.797 693 134 862 315 7 E+308) | 0,(2.225 073 858 507 201 4 E-308,1.797 693 134 862 315 7 E+308) | double-precision floating-point value | diff --git a/docs/en/openmldb_sql/data_types/string_types.md b/docs/en/openmldb_sql/data_types/string_types.md new file mode 100644 index 00000000000..9e7b5b90cf0 --- /dev/null +++ b/docs/en/openmldb_sql/data_types/string_types.md @@ -0,0 +1,13 @@ +# String Type + +A string is a sequence of bytes or characters, enclosed within either single quote (`'`) or double quote (`"`) characters. Examples:(https://zh.wikipedia.org/wiki/characters) + +```SQL +'a string' +"another string" +``` + +| type | size | use | +| :----- | :--- | :--------------------- | +| STRING | 2M | String variable length | + From 6f74e613f0ff846cfe30f08263c35ecf8382195e Mon Sep 17 00:00:00 2001 From: TanZiYen <104113819+TanZiYen@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:24:36 +0800 Subject: [PATCH 2/3] Docs: Delete-reference-sql-datatypes-folder --- .../sql/data_types/date_and_time_types.md | 14 ---------- docs/en/reference/sql/data_types/index.rst | 11 -------- .../reference/sql/data_types/numeric_types.md | 26 ------------------- .../reference/sql/data_types/string_types.md | 13 ---------- 4 files changed, 64 deletions(-) delete mode 100644 docs/en/reference/sql/data_types/date_and_time_types.md delete mode 100644 docs/en/reference/sql/data_types/index.rst delete mode 100644 docs/en/reference/sql/data_types/numeric_types.md delete mode 100644 docs/en/reference/sql/data_types/string_types.md diff --git a/docs/en/reference/sql/data_types/date_and_time_types.md b/docs/en/reference/sql/data_types/date_and_time_types.md deleted file mode 100644 index 7c35f0a94d1..00000000000 --- a/docs/en/reference/sql/data_types/date_and_time_types.md +++ /dev/null @@ -1,14 +0,0 @@ -# Date and Time Type - -OpenMLDB supports date type `DATE` and timestamp `TIMESTAMP`. - -Each time type has a valid range of values ​​and a NULL value. The NULL value is used when specifying an invalid value that cannot be represented. - -| Type | Size (bytes) | Scope | Format | Use | -| :-------- | :----------- | :----------------------------------------------------------- | :-------------- | :----------------------- | -| DATE | 4 | 1900-01-01 ~ | YYYY-MM-DD | Date Value | -| TIMESTAMP | 8 | ~ INT64_MAX | online: int64, offline `LOAD DATA`: int64 or 'yyyy-MM-dd'T'HH:mm:ss[.SSS][XXX]' | Mixed Date and Time Value, Timestamp | - -## Time Zone Handling - -When a time string is converted to `TIMESTAMP`, OpenMLDB will convert it to a timestamp in the UTC time zone. However, when `TIMESTAMP` is converted to a time string, OpenMLDB converts the stored `TIMESTAMP` to a time string in the current time zone. Note: Currently OpenMLDB only supports one time zone which is UTC/GMT+08:00 time zone. We will support the configuration of TimeZone as soon as possible. diff --git a/docs/en/reference/sql/data_types/index.rst b/docs/en/reference/sql/data_types/index.rst deleted file mode 100644 index c008e08e24f..00000000000 --- a/docs/en/reference/sql/data_types/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -============================= -Data Type -============================= - - -.. toctree:: - :maxdepth: 1 - - numeric_types - string_types - date_and_time_types diff --git a/docs/en/reference/sql/data_types/numeric_types.md b/docs/en/reference/sql/data_types/numeric_types.md deleted file mode 100644 index f96f2ad762c..00000000000 --- a/docs/en/reference/sql/data_types/numeric_types.md +++ /dev/null @@ -1,26 +0,0 @@ -# Numeric Type - -OpenMLDB boolean types supported: - -| type | size | range(signed) | range(unsigned) | use | -| :--- | :----- | :------------- | :------------- | :------- | -| BOOL | 1 byte | (-128,127) | (0,255) | small integer value | - -## Integer Type (Exact Value) - -OpenMLDB supports integer types: `INT`, `SMALLINT`, `BIGINT` - -| type | size | range (signed) | range (unsigned) | use | -| :-------------- | :------ | :------------------------------------------------------ | :------------------------------ | :--------- | -| SMALLINT or INT16 | 2 bytes | (-32 768,32 767) | (0,65 535) | small integer value | -| INT or INT32 | 4 bytes | (-2 147 483 648,2 147 483 647) | (0,4 294 967 295) | large integer value | -| BIGINT or INT64 | 8 bytes | (-9,223,372,036,854,775,808,9 223 372 036 854 775 807) | (0,18 446 744 073 709 551 615) | very large integer value | - -## Floating Point Type (Approximate Value) - -OpenMLDB supports two floating point types: `FLOAT`, `DOUBLE` - -| type | size | range(signed) | range(unsigned) | use | -| :----- | :------ | :----------------------------------------------------------- | :----------------------------------------------------------- | :-------------- | -| FLOAT | 4 bytes | (-3.402 823 466 E+38,-1.175 494 351 E-38),0,(1.175 494 351 E-38,3.402 823 466 351 E+38) | 0,(1.175 494 351 E-38,3.402 823 466 E+38) | single precision floating point value | -| DOUBLE | 8 bytes | (-1.797 693 134 862 315 7 E+308,-2.225 073 858 507 201 4 E-308),0,(2.225 073 858 507 201 4 E-308,1.797 693 134 862 315 7 E+308) | 0,(2.225 073 858 507 201 4 E-308,1.797 693 134 862 315 7 E+308) | double-precision floating-point value | diff --git a/docs/en/reference/sql/data_types/string_types.md b/docs/en/reference/sql/data_types/string_types.md deleted file mode 100644 index 328bd22ad34..00000000000 --- a/docs/en/reference/sql/data_types/string_types.md +++ /dev/null @@ -1,13 +0,0 @@ -# String Type - -A string is a sequence of bytes or characters, enclosed within either single quote (`'`) or double quote (`"`) characters. Examples:(https://zh.wikipedia.org/wiki/characters) - -```SQL -'a string' -"another string" -``` - -| type | size | use | -| :----- | :--- | :--------- | -| STRING | 2M | 变长字符串 | - From e42635cad76973cb6b74fd6a7003982b3797cbaf Mon Sep 17 00:00:00 2001 From: Siqi Wang Date: Tue, 2 Jan 2024 18:44:01 +0800 Subject: [PATCH 3/3] Update string_types.md --- docs/en/openmldb_sql/data_types/string_types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/openmldb_sql/data_types/string_types.md b/docs/en/openmldb_sql/data_types/string_types.md index 9e7b5b90cf0..4f556a9ec76 100644 --- a/docs/en/openmldb_sql/data_types/string_types.md +++ b/docs/en/openmldb_sql/data_types/string_types.md @@ -9,5 +9,5 @@ A string is a sequence of bytes or characters, enclosed within either single quo | type | size | use | | :----- | :--- | :--------------------- | -| STRING | 2M | String variable length | +| STRING | 2M | Variable-length character strings |